From 5b405190e114ed07eb1543c54d1ea00bbb7d90c2 Mon Sep 17 00:00:00 2001 From: Geert Hauwaerts Date: Fri, 18 Mar 2011 11:37:50 +0000 Subject: [PATCH] - Remove " in sysContact. - Fix error in ucd-mib polling. git-svn-id: http://www.observium.org/svn/observer/trunk@1920 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/polling/ucd-mib.inc.php | 8 +++++--- poller.php | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/polling/ucd-mib.inc.php b/includes/polling/ucd-mib.inc.php index b968f72c5c..cad8826b90 100755 --- a/includes/polling/ucd-mib.inc.php +++ b/includes/polling/ucd-mib.inc.php @@ -124,8 +124,10 @@ $mem_rrd_create = " --step 300 \ RRA:MAX:0.5:288:800"; $snmpdata = snmp_get_multi($device, "memTotalSwap.0 memAvailSwap.0 memTotalReal.0 memAvailReal.0 memTotalFree.0 memShared.0 memBuffer.0 memCached.0", "-OQUs", "UCD-SNMP-MIB"); -list($memTotalSwap, $memAvailSwap, $memTotalReal, $memAvailReal, $memTotalFree, $memShared, $memBuffer, $memCached) = $snmpdata[0]; -foreach (array_keys($snmpdata[0]) as $key) { $$key = $snmpdata[0][$key]; } +if (is_array($snmpdata[0])) { + list($memTotalSwap, $memAvailSwap, $memTotalReal, $memAvailReal, $memTotalFree, $memShared, $memBuffer, $memCached) = $snmpdata[0]; + foreach (array_keys($snmpdata[0]) as $key) { $$key = $snmpdata[0][$key]; } +} ## Check to see that the OIDs are actually populated before we make the rrd if (is_numeric($memTotalReal) && is_numeric($memAvailReal) && is_numeric($memTotalFree)) @@ -176,4 +178,4 @@ if (is_numeric($load1) && is_numeric($load5) && is_numeric($load10)) $graphs['ucd_load'] = "TRUE"; } -?> \ No newline at end of file +?> diff --git a/poller.php b/poller.php index c16b6a2e8e..6cbc60ab42 100755 --- a/poller.php +++ b/poller.php @@ -215,6 +215,7 @@ while ($device = mysql_fetch_assoc($device_query)) echo("Hardware: ".$hardware." Version: ".$version." Features: ".$features."\n"); $sysLocation = str_replace("\"","", $sysLocation); + $sysContact = str_replace("\"","", $sysContact); include("includes/polling/ipmi.inc.php"); include("includes/polling/temperatures.inc.php");