diff --git a/html/includes/dev-overview-data.inc.php b/html/includes/dev-overview-data.inc.php index 7028e816b7..b83b8c311f 100644 --- a/html/includes/dev-overview-data.inc.php +++ b/html/includes/dev-overview-data.inc.php @@ -57,7 +57,7 @@ if ($device['location']) Location ' . $device['location']. ' '); - if (get_dev_attrib($device,'override_sysLocation_bool')) + if (get_dev_attrib($device,'override_sysLocation_bool') && !empty($device['real_location'])) { echo(' SNMP Location diff --git a/includes/common.php b/includes/common.php index d36a0abfdf..dac3d5611c 100644 --- a/includes/common.php +++ b/includes/common.php @@ -182,7 +182,7 @@ function getifdescrbyid($id) function getidbyname($domain) { - return dbFetchCell("SELECT `device_id` FROM `devices` WHERE `hostname` = ?", mres($domain)); + return dbFetchCell("SELECT `device_id` FROM `devices` WHERE `hostname` = ?", array($domain)); } function gethostosbyid($id) diff --git a/includes/polling/os/vmware.inc.php b/includes/polling/os/vmware.inc.php index f693e832b9..57a9d16f5e 100644 --- a/includes/polling/os/vmware.inc.php +++ b/includes/polling/os/vmware.inc.php @@ -15,20 +15,6 @@ $data = snmp_get_multi($device, "VMWARE-SYSTEM-MIB::vmwProdName.0 VMWARE-SYSTE $version = preg_replace("/^VMware /", "", $data[0]["vmwProdName"]) . " " . $data[0]["vmwProdVersion"]; $features = "build-" . $data[0]["vmwProdBuild"]; -/* - * VMware ESXi returns "not set" instead of a NULL value. - */ - -if ($sysLocation == "not set") -{ - $sysLocation = ""; -} - -if ($sysContact == "not set") -{ - $sysContact = ""; -} - /* * CONSOLE: Start the VMware discovery process. */ diff --git a/includes/polling/system.inc.php b/includes/polling/system.inc.php index 21a16bd789..778b1ad672 100755 --- a/includes/polling/system.inc.php +++ b/includes/polling/system.inc.php @@ -75,6 +75,16 @@ $poll_device['sysLocation'] = str_replace("\"","", $poll_device['sysLocation']); $poll_device['sysContact'] = str_replace("\"","", $poll_device['sysContact']); + if ($poll_device['sysLocation'] == "not set") + { + $poll_device['sysLocation'] = ""; + } + + if ($poll_device['sysContact'] == "not set") + { + $poll_device['sysContact'] = ""; + } + if ($poll_device['sysContact'] && $poll_device['sysContact'] != $device['sysContact']) { $update_array['sysContact'] = $poll_device['sysContact'];