mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 16:04:35 +02:00
add ability to chose only one module in discovery.php. give module name for cemp mempools. use sensor name for cisco-entity-sensors.
git-svn-id: http://www.observium.org/svn/observer/trunk@2015 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -60,10 +60,10 @@ if ($device['os'] == "ios" || $device['os_group'] == "ios")
|
||||
if ($entitysensor[$entry['entSensorType']] && is_numeric($entry['entSensorValue']) && is_numeric($index))
|
||||
{
|
||||
$entPhysicalIndex = $index;
|
||||
$descr = $entity_array[$index]['entPhysicalName'];
|
||||
if ($descr || $device['os'] == "iosxr")
|
||||
if ($entity_array[$index]['entPhysicalName'] || $device['os'] == "iosxr")
|
||||
{
|
||||
$descr = rewrite_entity_descr($descr);
|
||||
$descr = rewrite_entity_descr($entity_array[$index]['entPhysicalName']) . " - " . rewrite_entity_descr($entity_array[$index]['entPhysicalDescr']);
|
||||
|
||||
} else {
|
||||
$descr = $entity_array[$index]['entPhysicalDescr'];
|
||||
$descr = rewrite_entity_descr($descr);
|
||||
@@ -73,10 +73,13 @@ if ($device['os'] == "ios" || $device['os_group'] == "ios")
|
||||
if (is_numeric($entry['entSensorMeasuredEntity']) && $entry['entSensorMeasuredEntity'])
|
||||
{
|
||||
$measured_descr = $entity_array[$entry['entSensorMeasuredEntity']]['entPhysicalName'];
|
||||
if (!measured_descr)
|
||||
if (!$measured_descr)
|
||||
{
|
||||
$measured_descr = $entity_array[$entry['entSensorMeasuredEntity']]['entPhysicalDescr'];
|
||||
}
|
||||
|
||||
echo("descr: $descr | measured: $measured_descr\n");
|
||||
|
||||
$descr = $measured_descr . " - " . $descr;
|
||||
}
|
||||
|
||||
@@ -152,4 +155,4 @@ if ($device['os'] == "ios" || $device['os_group'] == "ios")
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -15,8 +15,9 @@ if ($device['os'] == "ios" || $device['os_group'] == "ios")
|
||||
if (is_numeric($entry['cempMemPoolUsed']) && $entry['cempMemPoolValid'] == "true")
|
||||
{
|
||||
list($entPhysicalIndex) = explode(".", $index);
|
||||
$entPhysicalName = snmp_get($device, "entPhysicalDescr.".$entPhysicalIndex, "-Oqv", "ENTITY-MIB");
|
||||
$descr = $entPhysicalDescr." - ".$entry['cempMemPoolName'];
|
||||
$entPhysicalName = snmp_get($device, "entPhysicalName.".$entPhysicalIndex, "-Oqv", "ENTITY-MIB");
|
||||
|
||||
$descr = $entPhysicalName." - ".$entry['cempMemPoolName'];
|
||||
|
||||
$descr = str_replace("Cisco ", "", $descr);
|
||||
$descr = str_replace("Network Processing Engine", "", $descr);
|
||||
@@ -27,4 +28,4 @@ if ($device['os'] == "ios" || $device['os_group'] == "ios")
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user