diff --git a/LibreNMS/Component.php b/LibreNMS/Component.php index 2edf823f11..d9fa977458 100644 --- a/LibreNMS/Component.php +++ b/LibreNMS/Component.php @@ -337,7 +337,7 @@ class Component $MSG .= $k." => ".$v.","; } $MSG = substr($MSG, 0, -1); - log_event($MSG, $device_id, 'component', $COMPONENT); + log_event($MSG, $device_id, 'component', 3, $COMPONENT); } // Process our AVP Adds and Updates @@ -350,14 +350,14 @@ class Component dbInsert($DATA, 'component_prefs'); // Log the addition to the Eventlog. - log_event("Component: " . $AVP[$COMPONENT]['type'] . "(" . $COMPONENT . "). Attribute: " . $ATTR . ", was added with value: " . $VALUE, $device_id, 'component', $COMPONENT); + log_event("Component: " . $AVP[$COMPONENT]['type'] . "(" . $COMPONENT . "). Attribute: " . $ATTR . ", was added with value: " . $VALUE, $device_id, 'component', 3, $COMPONENT); } elseif ($OLD[$device_id][$COMPONENT][$ATTR] != $VALUE) { // Attribute exists but the value is different, need to update $DATA = array('value'=>$VALUE); dbUpdate($DATA, 'component_prefs', '`component` = ? AND `attribute` = ?', array($COMPONENT, $ATTR)); // Add the modification to the Eventlog. - log_event("Component: " . $AVP[$COMPONENT]['type'] . "(" . $COMPONENT . "). Attribute: " . $ATTR . ", was modified from: " . $OLD[$COMPONENT][$ATTR] . ", to: " . $VALUE, $device_id, 'component', $COMPONENT); + log_event("Component: " . $AVP[$COMPONENT]['type'] . "(" . $COMPONENT . "). Attribute: " . $ATTR . ", was modified from: " . $OLD[$COMPONENT][$ATTR] . ", to: " . $VALUE, $device_id, 'component', 3, $COMPONENT); } } // End Foreach AVP @@ -368,7 +368,7 @@ class Component dbDelete('component_prefs', "`component` = ? AND `attribute` = ?", array($COMPONENT,$KEY)); // Log the addition to the Eventlog. - log_event("Component: " . $AVP[$COMPONENT]['type'] . "(" . $COMPONENT . "). Attribute: " . $KEY . ", was deleted.", $COMPONENT); + log_event("Component: " . $AVP[$COMPONENT]['type'] . "(" . $COMPONENT . "). Attribute: " . $KEY . ", was deleted.", 4, $COMPONENT); } } diff --git a/html/includes/forms/update-ifspeed.inc.php b/html/includes/forms/update-ifspeed.inc.php index ac48a70a39..6bc391d616 100644 --- a/html/includes/forms/update-ifspeed.inc.php +++ b/html/includes/forms/update-ifspeed.inc.php @@ -32,10 +32,10 @@ if (!empty($ifName) && is_numeric($port_id) && is_numeric($port_id)) { $device = device_by_id_cache($device_id); if (is_array($speed)) { del_dev_attrib($device, 'ifSpeed:'.$ifName); - log_event("$ifName Port speed cleared manually", $device, 'interface', $port_id); + log_event("$ifName Port speed cleared manually", $device, 'interface', 3, $port_id); } else { set_dev_attrib($device, 'ifSpeed:'.$ifName, 1); - log_event("$ifName Port speed set manually: $speed", $device, 'interface', $port_id); + log_event("$ifName Port speed set manually: $speed", $device, 'interface', 3, $port_id); $port_tune = get_dev_attrib($device, 'ifName_tune:'.$ifName); $device_tune = get_dev_attrib($device, 'override_rrdtool_tune'); if ($port_tune == "true" || diff --git a/includes/discovery/functions.inc.php b/includes/discovery/functions.inc.php index c168666104..c724af96ad 100644 --- a/includes/discovery/functions.inc.php +++ b/includes/discovery/functions.inc.php @@ -460,7 +460,7 @@ function check_valid_sensors($device, $class, $valid, $poller_type = 'snmp') //end check_valid_sensors() -function discover_juniAtmVp(&$valid, $port_id, $vp_id, $vp_descr) +function discover_juniAtmVp(&$valid, $device, $port_id, $vp_id, $vp_descr) { d_echo("Discover Juniper ATM VP: $port_id, $vp_id, $vp_descr\n"); @@ -469,7 +469,7 @@ function discover_juniAtmVp(&$valid, $port_id, $vp_id, $vp_descr) d_echo("( $inserted inserted )\n"); // FIXME vv no $device! - log_event('Juniper ATM VP Added: port ' . mres($port_id) . ' vp ' . mres($vp_id) . ' descr' . mres($vp_descr), 'juniAtmVp', 3, $inserted); + log_event('Juniper ATM VP Added: port ' . mres($port_id) . ' vp ' . mres($vp_id) . ' descr' . mres($vp_descr), $device, 'juniAtmVp', 3, $inserted); } else { echo '.'; } diff --git a/sql-schema/163.sql b/sql-schema/163.sql index 4dd03ffccf..e5eb562261 100644 --- a/sql-schema/163.sql +++ b/sql-schema/163.sql @@ -1 +1,2 @@ +ALTER TABLE `eventlog` CHANGE `datetime` `datetime` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:01'; ALTER TABLE `eventlog` ADD COLUMN `severity` INT(1) NULL DEFAULT 2 AFTER `reference`; diff --git a/sql-schema/164.sql b/sql-schema/164.sql new file mode 100644 index 0000000000..b51e493d39 --- /dev/null +++ b/sql-schema/164.sql @@ -0,0 +1 @@ +ALTER TABLE `eventlog` CHANGE `datetime` `datetime` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:01';