mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix windows uptime
git-svn-id: http://www.observium.org/svn/observer/trunk@985 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -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 \
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user