fix windows uptime

git-svn-id: http://www.observium.org/svn/observer/trunk@985 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-03-03 09:15:37 +00:00
parent d45cae6e3a
commit 51e38b6a78
2 changed files with 3 additions and 8 deletions

View File

@@ -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 \

View File

@@ -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
{