From 204af910cd62e58a89682583bd17978a368c387b Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Wed, 12 Mar 2008 16:35:00 +0000 Subject: [PATCH] uptime fixes git-svn-id: http://www.observium.org/svn/observer/trunk@143 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/functions.php | 1 + poll-device.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index ec66805c32..75f194ed53 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -13,6 +13,7 @@ include("billing-functions.php"); function rrdtool_update($rrdfile, $rrdupdate) { global $rrdtool; return `$rrdtool update $rrdfile $rrdupdate`; + } function getHostOS($hostname, $community, $snmpver) { diff --git a/poll-device.php b/poll-device.php index c48ef595c7..c91db482a3 100755 --- a/poll-device.php +++ b/poll-device.php @@ -253,10 +253,10 @@ while ($device = mysql_fetch_array($device_query)) { mail($notify_email, "Device Rebooted: " . $device['hostname'], "Device Rebooted :" . $device['hostname'] . " at " . date('l dS F Y h:i:s A'), $config['email_headers']); } - $uptime_rrd = $rrd_dir . "/" . $device['hostname'] . "/uptime.rrd"; + $uptimerrd = $rrd_dir . "/" . $device['hostname'] . "/uptime.rrd"; - $old_uptime_rrd = "rrd/" . $device['hostname'] . "-uptime.rrd"; - if(is_file($old_uptime_rrd) && !is_file($uptimerrd)) { rename($old_uptime_rrd, $uptime_rrd); echo("Moving $old_uptime_rrd to $uptime_rrd"); } + $old_uptimerrd = "rrd/" . $device['hostname'] . "-uptime.rrd"; + if(is_file($old_uptimerrd) && !is_file($uptimerrd)) { rename($old_uptimerrd, $uptimerrd); echo("Moving $old_uptimerrd to $uptimerrd"); } if(!is_file($uptimerrd)) { $woo = `rrdtool create $uptimerrd \