From a16c142658efa249e2ca8bf3457ee0d0ed95ea59 Mon Sep 17 00:00:00 2001 From: bergroth Date: Thu, 9 Nov 2017 22:28:26 +0100 Subject: [PATCH] * Health/sensor view for specific device/ports/port (#7684) * * Health/sensor view for specific device/ports/port * Removed code that didn't comply with standard * added extra check html/pages/device/port/sensors.inc.php * Update sensors.inc.php --- html/pages/device/port.inc.php | 4 +++ html/pages/device/port/sensors.inc.php | 36 ++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 html/pages/device/port/sensors.inc.php diff --git a/html/pages/device/port.inc.php b/html/pages/device/port.inc.php index b5693dd8ca..f26b0d6dc7 100644 --- a/html/pages/device/port.inc.php +++ b/html/pages/device/port.inc.php @@ -76,6 +76,10 @@ $menu_options['fdb'] = 'FDB Table'; $menu_options['events'] = 'Eventlog'; $menu_options['notes'] = 'Notes'; +if (dbFetchCell("SELECT COUNT(*) FROM `sensors` WHERE `device_id` = ? AND `entPhysicalIndex` = ? AND entPhysicalIndex_measured = 'ports'", array($device['device_id'],$port['ifIndex']))) { + $menu_options['sensors'] = 'Health'; +} + if (dbFetchCell("SELECT COUNT(*) FROM `ports_adsl` WHERE `port_id` = '".$port['port_id']."'")) { $menu_options['adsl'] = 'ADSL'; } diff --git a/html/pages/device/port/sensors.inc.php b/html/pages/device/port/sensors.inc.php new file mode 100644 index 0000000000..24b9ec5242 --- /dev/null +++ b/html/pages/device/port/sensors.inc.php @@ -0,0 +1,36 @@ + +
+

$sensor_descr
$sensor_current | $sensor_limit_low <> $sensor_limit

+
"; + echo "
"; + + $graph_array['id'] = $sensor['sensor_id']; + $graph_array['type'] = "sensor_" . $sensor['sensor_class']; + + include 'includes/print-graphrow.inc.php'; + echo '
'; + + $row++; +} +unset($row);