2010-02-17 11:02:18 +00:00
|
|
|
<?php
|
|
|
|
|
2010-02-20 17:22:22 +00:00
|
|
|
$interface = mysql_fetch_array(mysql_query("SELECT * FROM `ports` WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '".$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
|
|
|
|
2011-03-15 15:41:57 +00:00
|
|
|
log_event("SNMP Trap: linkDown " . $interface['ifDescr'], $device, "interface", $interface['interface_id']);
|
2010-02-17 11:02:18 +00:00
|
|
|
|
2011-03-15 15:41:57 +00:00
|
|
|
#if ($ifAdminStatus != $interface['ifAdminStatus'])
|
|
|
|
#{
|
|
|
|
# log_event("Interface Disabled : " . $interface['ifDescr'] . " (TRAP)", $device, "interface", $interface['interface_id']);
|
|
|
|
#}
|
|
|
|
if ($ifOperStatus != $interface['ifOperStatus'])
|
|
|
|
{
|
|
|
|
log_event("Interface went Down : " . $interface['ifDescr'] . " (TRAP)", $device, "interface", $interface['interface_id']);
|
|
|
|
mysql_query("UPDATE `ports` SET ifOperStatus = 'down' WHERE `interface_id` = '".$interface['interface_id']."'");
|
|
|
|
}
|
2010-02-17 11:02:18 +00:00
|
|
|
|
2011-03-15 15:41:57 +00:00
|
|
|
?>
|