diff --git a/includes/polling/os/unix.inc.php b/includes/polling/os/unix.inc.php index 27ff37c270..0d4cbaa9c4 100755 --- a/includes/polling/os/unix.inc.php +++ b/includes/polling/os/unix.inc.php @@ -1,49 +1,62 @@ diff --git a/includes/polling/ucd-mib.inc.php b/includes/polling/ucd-mib.inc.php index 29a7634a4d..db1fd82089 100755 --- a/includes/polling/ucd-mib.inc.php +++ b/includes/polling/ucd-mib.inc.php @@ -128,6 +128,7 @@ $mem_cmd .= " memTotalSwap.0 memAvailSwap.0 memTotalReal.0 memAvailReal.0 memTotalFree.0 memShared.0 memBuffer.0 memCached.0"; $mem_raw = shell_exec($mem_cmd); + list($memTotalSwap, $memAvailSwap, $memTotalReal, $memAvailReal, $memTotalFree, $memShared, $memBuffer, $memCached) = explode("\n", str_replace(" kB", "", $mem_raw)); ## Check to see that the OIDs are actually populated before we make the rrd @@ -163,8 +164,7 @@ RRA:MAX:0.5:288:800"; $load_get = "laLoadInt.1 laLoadInt.2 laLoadInt.3"; - $load_cmd = $config['snmpget']. " -M ".$config['mibdir']." -m UCD-SNMP-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " " . $load_get; - $load_raw = `$load_cmd`; + $load_raw = snmp_get($device, $load_get, "-Oqv", "UCD-SNMP-MIB"); list ($load1, $load5, $load10) = explode ("\n", $load_raw); ## Check to see that the OIDs are actually populated before we make the rrd @@ -176,3 +176,4 @@ rrdtool_update($load_rrd, "N:$load1:$load5:$load10"); $graphs['ucd_load'] = "TRUE"; } +?> diff --git a/poller.php b/poller.php index b7b583c419..99e47dec88 100755 --- a/poller.php +++ b/poller.php @@ -122,7 +122,7 @@ while ($device = mysql_fetch_assoc($device_query)) $snmp_cmd .= " sysUpTime.0 sysLocation.0 sysContact.0 sysName.0"; $snmpdata = str_replace('"','',trim(shell_exec($snmp_cmd))); list($sysUptime, $sysLocation, $sysContact, $sysName) = explode("\n", $snmpdata); - $sysDescr = trim(shell_exec($config['snmpget'] . " -m SNMPv2-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " sysDescr.0")); + $sysDescr = trim(snmp_get($device, "sysDescr.0", "-Oqv", "SNMPv2-MIB")); $sysName = strtolower($sysName); $hrSystemUptime = snmp_get($device, "HOST-RESOURCES-MIB::hrSystemUptime.0", "-Oqv");