mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
fix cisco entity-sensors discoverer. don't set ports deleted when they are already deleted.
git-svn-id: http://www.observium.org/svn/observer/trunk@3001 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -138,8 +138,8 @@ if ($device['os_group'] == "cisco")
|
||||
if ($descr == "") { $ok = FALSE; } ## Invalid description. Lots of these on Nexus
|
||||
|
||||
if ($ok) {
|
||||
# echo("\n".$valid['sensor'].", $type, $device, $oid, $index, 'cisco-entity-sensor', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $limit, $warn_limit, $current");
|
||||
discover_sensor($valid['sensor'], $type, $device, $oid, $index, 'cisco-entity-sensor', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $limit, $warn_limit, $current, 'snmp', $entPhysicalIndex, $entry['entSensorMeasuredEntity']);
|
||||
# echo("\n".$valid['sensor'].", $type, $device, $oid, $index, 'cisco-entity-sensor', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current");
|
||||
discover_sensor($valid['sensor'], $type, $device, $oid, $index, 'cisco-entity-sensor', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entry['entSensorMeasuredEntity']);
|
||||
}
|
||||
$cisco_entity_temperature = 1;
|
||||
unset($limit, $limit_low, $warn_limit, $warn_limit_low);
|
||||
|
||||
@@ -143,8 +143,10 @@ foreach ($port_stats as $ifIndex => $port)
|
||||
$ports[$ifIndex]['deleted'] = "0";
|
||||
}
|
||||
} else {
|
||||
dbUpdate(array('deleted' => '1'), 'ports', '`interface_id` = ?', array($ports[$ifIndex]['interface_id']));
|
||||
$ports[$ifIndex]['deleted'] = "1";
|
||||
if($ports[$port['ifIndex']]['deleted'] != "1") {
|
||||
dbUpdate(array('deleted' => '1'), 'ports', '`interface_id` = ?', array($ports[$ifIndex]['interface_id']));
|
||||
$ports[$ifIndex]['deleted'] = "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
### End New interface detection
|
||||
@@ -443,7 +445,10 @@ foreach ($ports as $port)
|
||||
elseif ($port['disabled'] != "1")
|
||||
{
|
||||
echo("Port Deleted"); ### Port missing from SNMP cache.
|
||||
dbUpdate(array('deleted' => '1'), 'ports', '`device_id` = ? AND `ifIndex` = ?', array($device['device_id'], $port['ifIndex']));
|
||||
if($port['deleted'] != "1")
|
||||
{
|
||||
dbUpdate(array('deleted' => '1'), 'ports', '`device_id` = ? AND `ifIndex` = ?', array($device['device_id'], $port['ifIndex']));
|
||||
}
|
||||
} else {
|
||||
echo("Port Disabled.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user