Browse Source

Add the PID of the device to the output.

Joe Clarke 5 months ago
parent
commit
ae233cfe59
1 changed files with 2 additions and 1 deletions
  1. 2 1
      www/status_api.php

+ 2 - 1
www/status_api.php

@@ -83,7 +83,7 @@ $infra = [];
 while ($row = $res->fetch()) {
     $target = [];
     $target['name'] = $row['assigned_switch'];
-    $sql = 'SELECT ip_address, location FROM SWITCHES WHERE name = :name';
+    $sql = 'SELECT ip_address, location, pid FROM SWITCHES WHERE name = :name';
     $sw_res = null;
     try {
         $sw_res = $dbh->prepare($sql);
@@ -99,6 +99,7 @@ while ($row = $res->fetch()) {
     }
     $target['ipv4'] = $sw_row['ip_address'];
     $target['location'] = $sw_row['location'];
+    $target['pid'] = $sw_row['pid'];
     $target['platform'] = "ietfcisco";
     array_push($infra, $target);
 }