From 51e38b6a7857dd97fd1ecb100743060d8cc6cf41 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Wed, 3 Mar 2010 09:15:37 +0000 Subject: [PATCH] fix windows uptime git-svn-id: http://www.observium.org/svn/observer/trunk@985 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/polling/hr-mib.inc.php | 10 ++-------- poll-device.php | 1 + 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/includes/polling/hr-mib.inc.php b/includes/polling/hr-mib.inc.php index 790084a6a..61b63612d 100755 --- a/includes/polling/hr-mib.inc.php +++ b/includes/polling/hr-mib.inc.php @@ -5,15 +5,9 @@ $hrSystem_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/hrSystem.rrd"; $hrSystem_cmd = $config['snmpget'] ." -m HOST-RESOURCES-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port']; -$hrSystem_cmd .= " hrSystemProcesses.0 hrSystemNumUsers.0 hrSystemUptime.0 hrMemorySize.0"; +$hrSystem_cmd .= " hrSystemProcesses.0 hrSystemNumUsers.0 hrMemorySize.0"; $hrSystem = `$hrSystem_cmd`; -list ($hrSystemProcesses, $hrSystemNumUsers, $hrSystemUptime, $hrMemorySize) = explode("\n", $hrSystem); - -list($days, $hours, $mins, $secs) = explode(":", $hrSystemUptime); -list($secs, $microsecs) = explode(".", $secs); -$uptime = $secs + ($mins * 60) + ($hours * 60 * 60) + ($days * 24 * 60 * 60); - -if ($device['os'] == "windows") { $uptime /= 10; } +list ($hrSystemProcesses, $hrSystemNumUsers, $hrMemorySize) = explode("\n", $hrSystem); if (!is_file($hrSystem_rrd)) { shell_exec($config['rrdtool'] . " create $hrSystem_rrd \ diff --git a/poll-device.php b/poll-device.php index c3471842c..354bb2c80 100755 --- a/poll-device.php +++ b/poll-device.php @@ -93,6 +93,7 @@ while ($device = mysql_fetch_array($device_query)) { $mins = $mins + ($hours * 60); $secs = $secs + ($mins * 60); $uptime = $secs; + if ($device['os'] == "windows") { $uptime /= 10; } } else {