2010-02-17 11:02:18 +00:00
|
|
|
<?php
|
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$interface = dbFetchRow('SELECT * FROM `ports` WHERE `device_id` = ? AND `ifIndex` = ?', array($device['device_id'], $entry[2]));
|
2010-02-17 11:02:18 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
if (!$interface) {
|
|
|
|
exit;
|
|
|
|
}
|
2010-02-17 11:02:18 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$ifOperStatus = 'down';
|
|
|
|
// $ifAdminStatus = "down";
|
2017-02-13 00:41:05 +02:00
|
|
|
log_event('SNMP Trap: linkDown ' . $interface['ifDescr'], $device, 'interface', 5, $interface['port_id']);
|
2010-02-17 11:02:18 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
// if ($ifAdminStatus != $interface['ifAdminStatus'])
|
|
|
|
// {
|
|
|
|
// log_event("Interface Disabled : " . $interface['ifDescr'] . " (TRAP)", $device, "interface", $interface['port_id']);
|
|
|
|
// }
|
|
|
|
if ($ifOperStatus != $interface['ifOperStatus']) {
|
2017-02-13 00:41:05 +02:00
|
|
|
log_event('Interface went Down : ' . $interface['ifDescr'] . ' (TRAP)', $device, 'interface', 5, $interface['port_id']);
|
2015-07-13 20:10:26 +02:00
|
|
|
dbUpdate(array('ifOperStatus' => 'down'), 'ports', 'port_id=?', array($interface['port_id']));
|
2011-03-15 15:41:57 +00:00
|
|
|
}
|