From 5a1183601fe1a568408df0e26665fc2115b1e321 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Mon, 14 Dec 2009 21:02:07 +0000 Subject: [PATCH] reactivate interface eventlogging git-svn-id: http://www.observium.org/svn/observer/trunk@549 61d68cd4-352d-0410-923a-c4978735b2b8 --- discovery.php | 1 + includes/polling/ports.inc.php | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/discovery.php b/discovery.php index a463dec3df..38228e5019 100755 --- a/discovery.php +++ b/discovery.php @@ -38,6 +38,7 @@ if(!$where) { exit; } +echo("Applying database updates...\n"); shell_exec("scripts/update-sql.php database-update.sql"); if(isset($options['d'])) { echo("DEBUG!\n"); $debug = 1; } diff --git a/includes/polling/ports.inc.php b/includes/polling/ports.inc.php index c7bb71b68f..465666001d 100755 --- a/includes/polling/ports.inc.php +++ b/includes/polling/ports.inc.php @@ -145,6 +145,15 @@ } // 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 ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), '$oid -> ".$this_port[$oid]."')"); + } + } + // End Eventlogging + /// Do EtherLike-MIB if($config['enable_etherlike']) { include("port-etherlike.inc.php"); }