2010-02-17 11:02:18 +00:00
|
|
|
<?php
|
|
|
|
|
2014-01-13 17:43:58 +00: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
|
|
|
|
2011-03-15 15:41:57 +00:00
|
|
|
if (!$interface) { exit; }
|
2010-02-17 11:02:18 +00:00
|
|
|
|
2011-03-15 15:41:57 +00:00
|
|
|
$ifOperStatus = "down";
|
|
|
|
#$ifAdminStatus = "down";
|
2010-02-17 11:02:18 +00:00
|
|
|
|
2012-05-16 13:25:50 +00:00
|
|
|
log_event("SNMP Trap: linkDown " . $interface['ifDescr'], $device, "interface", $interface['port_id']);
|
2010-02-17 11:02:18 +00:00
|
|
|
|
2011-03-15 15:41:57 +00:00
|
|
|
#if ($ifAdminStatus != $interface['ifAdminStatus'])
|
|
|
|
#{
|
2012-05-16 13:25:50 +00:00
|
|
|
# log_event("Interface Disabled : " . $interface['ifDescr'] . " (TRAP)", $device, "interface", $interface['port_id']);
|
2011-03-15 15:41:57 +00:00
|
|
|
#}
|
|
|
|
if ($ifOperStatus != $interface['ifOperStatus'])
|
|
|
|
{
|
2012-05-16 13:25:50 +00:00
|
|
|
log_event("Interface went Down : " . $interface['ifDescr'] . " (TRAP)", $device, "interface", $interface['port_id']);
|
2014-06-10 22:21:10 +01:00
|
|
|
dbUpdate(array('ifOperStatus' => 'down'), 'ports', 'port_id=?',array($interface['port_id']));
|
2011-03-15 15:41:57 +00:00
|
|
|
}
|
2010-02-17 11:02:18 +00:00
|
|
|
|
2014-01-13 17:43:58 +00:00
|
|
|
?>
|