mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-02 00:32:09 +02:00
sensors auth file for graphs (no real auth yet)
git-svn-id: http://www.observium.org/svn/observer/trunk@1535 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$sensor = mysql_fetch_array(mysql_query("SELECT * FROM sensors WHERE sensor_id = '".mres($_GET['id'])."'"));
|
||||||
|
$device = device_by_id_cache($sensor['device_id']);
|
||||||
|
|
||||||
|
## FIXME WE ACTUALLY NEED TO AUTH, OK?
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -34,8 +34,10 @@ if ($device['os'] == "ios" || $device['os_group'] == "ios")
|
|||||||
{
|
{
|
||||||
$entPhysicalIndex = $index;
|
$entPhysicalIndex = $index;
|
||||||
$descr = snmp_get($device, "entPhysicalName.".$index, "-Oqv", "ENTITY-MIB");
|
$descr = snmp_get($device, "entPhysicalName.".$index, "-Oqv", "ENTITY-MIB");
|
||||||
|
if(!$descr) { snmp_get($device, "entPhysicalDescr.".$index, "-Oqv", "ENTITY-MIB"); }
|
||||||
if(is_numeric($entry['entSensorMeasuredEntity']) && $entry['entSensorMeasuredEntity']) {
|
if(is_numeric($entry['entSensorMeasuredEntity']) && $entry['entSensorMeasuredEntity']) {
|
||||||
$measured_descr = snmp_get($device, "entPhysicalName.".$entry['entSensorMeasuredEntity'],"-Oqv", "ENTITY-MIB");
|
$measured_descr = snmp_get($device, "entPhysicalName.".$entry['entSensorMeasuredEntity'],"-Oqv", "ENTITY-MIB");
|
||||||
|
if(!measured_descr) { $measured_descr = snmp_get($device, "entPhysicalDescr.".$entry['entSensorMeasuredEntity'],"-Oqv", "ENTITY-MIB");}
|
||||||
$descr = $measured_descr . " - " . $descr;
|
$descr = $measured_descr . " - " . $descr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user