mirror of
https://github.com/librenms/librenms.git
synced 2024-09-23 03:18:54 +00:00
fix hrsystemuptime polling?
git-svn-id: http://www.observium.org/svn/observer/trunk@1020 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
parent
f9446fd119
commit
8ffa20e7c0
@ -80,7 +80,8 @@ while ($device = mysql_fetch_array($device_query)) {
|
||||
eventlog('Device status changed to ' . ($status == '1' ? 'Up' : 'Down'), $device['device_id']);
|
||||
}
|
||||
|
||||
if ($status == "1") {
|
||||
if ($status == "1")
|
||||
{
|
||||
$snmp_cmd = $config['snmpget'] . " -m SNMPv2-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'];
|
||||
$snmp_cmd .= " sysUpTime.0 sysLocation.0 sysContact.0 sysName.0 HOST-RESOURCES-MIB::hrSystemUptime.0";
|
||||
$snmpdata = shell_exec($snmp_cmd);
|
||||
@ -91,7 +92,7 @@ while ($device = mysql_fetch_array($device_query)) {
|
||||
$sysDescr = trim(shell_exec($config['snmpget'] . " -m SNMPv2-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " sysDescr.0"));
|
||||
$sysName = strtolower($sysName);
|
||||
|
||||
if ($hrSystemUptime)
|
||||
if ($hrSystemUptime != "No Such Object available on this agent at this OID")
|
||||
{
|
||||
#HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (63050465) 7 days, 7:08:24.65
|
||||
$hrSystemUptime = str_replace("(", "", $hrSystemUptime);
|
||||
|
Loading…
Reference in New Issue
Block a user