fixed eventlog *again*. eventlog rewrite incoming, i think.

git-svn-id: http://www.observium.org/svn/observer/trunk@551 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-12-16 05:21:49 +00:00
parent 3bdb7c14a4
commit df386fc721
+8 -6
View File
@@ -84,6 +84,7 @@
$update .= ", `$oid` = '".mysql_real_escape_string($this_port[$oid])."'";
#mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $port['device_id'] . "', '" . $port['interface_id'] . "', NOW(), '".$oid . ": ".$port[$oid]." -> " . $this_port[$oid]."')");
#eventlog($device['device_id'], 'interface', $port['interface_id'], $oid . ": ".$port[$oid]." -> " . $this_port[$oid]);
mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $device['device_id'] . "', '" . $port['interface_id'] . "', NOW(), '".$oid . ": ".$port[$oid]." -> " . $this_port[$oid]."')");
echo($oid . " ");
}
}
@@ -140,18 +141,19 @@
if ( $this_port[$oid] != $port[$oid] ) { // If data has changed, build a query
$update .= ", `$oid` = '".mres($this_port[$oid])."'";
echo("PAgP ");
mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $device['device_id'] . "', '" . $port['interface_id'] . "', NOW(), '$oid -> ".$this_port[$oid]."')");
}
}
}
// End Update PAgP
// Do Eventlogging
$eventlog_oids = array('ifDescr', 'ifName', 'ifAlias', 'ifOperStatus', 'ifAdminStatus');
foreach ($data_oids as $oid) { // Loop the OIDs
if ( $port[$oid] != $this_port[oid]) {
mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $device['device_id'] . "', '" . $port['interface_id'] . "', NOW(), '$oid -> ".$this_port[$oid]."')");
}
}
# $eventlog_oids = array('ifDescr', 'ifName', 'ifAlias', 'ifOperStatus', 'ifAdminStatus');
# foreach ($data_oids as $oid) { // Loop the OIDs
# if ( $port[$oid] != $this_port[oid]) {
# mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $device['device_id'] . "', '" . $port['interface_id'] . "', NOW(), '$oid -> ".$this_port[$oid]."')");
# }
# }
// End Eventlogging
/// Do EtherLike-MIB