mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
Lots of additions.
git-svn-id: http://www.observium.org/svn/observer/trunk@108 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
+9
-1
@@ -192,7 +192,14 @@ while ($device = mysql_fetch_array($device_query)) {
|
||||
|
||||
|
||||
if ($uptime) {
|
||||
echo("Uptime : $uptime\n");
|
||||
|
||||
|
||||
$old_uptime = mysql_result(mysql_query("SELECT `attrib_value` FROM `devices_attribs` WHERE `device_id` = '" . $device['device_id'] . "' AND `attrib_type` = 'uptime'"), 0);
|
||||
|
||||
if( $uptime < $old_uptime ) {
|
||||
mail($notify_email, "Rebooted: " . $device['hostname'], "Device " . $device['hostname'] . " rebooted at " . date('l dS F Y h:i:s A'));
|
||||
}
|
||||
|
||||
|
||||
$uptimerrd = "rrd/" . $device['hostname'] . "-uptime.rrd";
|
||||
if(!is_file($uptimerrd)) {
|
||||
@@ -209,6 +216,7 @@ while ($device = mysql_fetch_array($device_query)) {
|
||||
if(mysql_affected_rows() == '0') {
|
||||
$insert_uptime_attrib = mysql_query("INSERT INTO devices_attribs (`device_id`, `attrib_type`, `attrib_value`) VALUES ('" . $device['device_id'] . "', 'uptime', '$uptime')");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user