diff --git a/database-update.sql b/database-update.sql index ffbf13f58..10a03ab6c 100644 --- a/database-update.sql +++ b/database-update.sql @@ -101,3 +101,4 @@ ALTER TABLE `links` CHANGE `src_if` `local_interface_id` INT( 11 ) NULL DEFAULT ALTER TABLE `links` CHANGE `vendor` `protocol` VARCHAR( 11 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL; ALTER TABLE `processors` CHANGE `processor_type` `processor_type` varchar(16) NOT NULL; ALTER TABLE `bgpPeers_cbgp` CHANGE `afi` `afi` VARCHAR( 16 ) NOT NULL , CHANGE `safi` `safi` VARCHAR( 16 ) NOT NULL; +ALTER TABLE `eventlog` ADD `reference` VARCHAR( 64 ) NOT NULL AFTER `type`; diff --git a/includes/functions.php b/includes/functions.php index 1f51fe064..f5aa1e69d 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -817,6 +817,14 @@ function eventlog($eventtext,$device_id = "", $interface_id = "") mysql_query($event_query); } +function log_event($text, $device = NULL, $type = NULL, $reference = NULL) { + $event_query = "INSERT INTO eventlog (host, reference, type, datetime, message) VALUES (" . ($device['device_id'] ? $device['device_id'] : "NULL"); + $event_query .= ", " . ($reference ? $reference : "NULL") . ", " . ($type ? $type : "NULL") . ", NOW(), '" . mres($text) . "')"; + echo($event_query . "\n"); + mysql_query($event_query); +} + + function notify($device,$title,$message) { global $config; diff --git a/includes/snmptrap/linkDown.inc.php b/includes/snmptrap/linkDown.inc.php new file mode 100644 index 000000000..820d95917 --- /dev/null +++ b/includes/snmptrap/linkDown.inc.php @@ -0,0 +1,20 @@ + diff --git a/includes/snmptrap/linkUp.inc.php b/includes/snmptrap/linkUp.inc.php new file mode 100644 index 000000000..e82531f2f --- /dev/null +++ b/includes/snmptrap/linkUp.inc.php @@ -0,0 +1,22 @@ + diff --git a/includes/static-config.php b/includes/static-config.php index f1f5620fb..ce61999b1 100644 --- a/includes/static-config.php +++ b/includes/static-config.php @@ -82,7 +82,6 @@ if(!$config['graph_colours']['mixed']) { $config['version'] = "0.10.0"; $config['rrd_opts_array'] = explode(" ", trim($config['rrdgraph_def_text'])); -# print_r($config['rrd_opts_array']); if($config['enable_nagios']) { $nagios_link = mysql_connect($config['nagios_db_host'], $config['nagios_db_user'], $config['nagios_db_pass']); diff --git a/snmptrap.php b/snmptrap.php new file mode 100755 index 000000000..c1275cb32 --- /dev/null +++ b/snmptrap.php @@ -0,0 +1,30 @@ +#!/usr/bin/php +