mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
- BUGFIX: getidbyname() did not pass parameters to MySQL correctly.
- Restructured sysContact and sysLocation "not set" code. - Do not display "SNMP Location" when empty or unset. git-svn-id: http://www.observium.org/svn/observer/trunk@2299 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@ -57,7 +57,7 @@ if ($device['location'])
|
|||||||
<td class="list-bold">Location</td>
|
<td class="list-bold">Location</td>
|
||||||
<td>' . $device['location']. '</td>
|
<td>' . $device['location']. '</td>
|
||||||
</tr>');
|
</tr>');
|
||||||
if (get_dev_attrib($device,'override_sysLocation_bool'))
|
if (get_dev_attrib($device,'override_sysLocation_bool') && !empty($device['real_location']))
|
||||||
{
|
{
|
||||||
echo('<tr>
|
echo('<tr>
|
||||||
<td class="list-bold">SNMP Location</td>
|
<td class="list-bold">SNMP Location</td>
|
||||||
|
@ -182,7 +182,7 @@ function getifdescrbyid($id)
|
|||||||
|
|
||||||
function getidbyname($domain)
|
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)
|
function gethostosbyid($id)
|
||||||
|
@ -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"];
|
$version = preg_replace("/^VMware /", "", $data[0]["vmwProdName"]) . " " . $data[0]["vmwProdVersion"];
|
||||||
$features = "build-" . $data[0]["vmwProdBuild"];
|
$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.
|
* CONSOLE: Start the VMware discovery process.
|
||||||
*/
|
*/
|
||||||
|
@ -75,6 +75,16 @@
|
|||||||
$poll_device['sysLocation'] = str_replace("\"","", $poll_device['sysLocation']);
|
$poll_device['sysLocation'] = str_replace("\"","", $poll_device['sysLocation']);
|
||||||
$poll_device['sysContact'] = str_replace("\"","", $poll_device['sysContact']);
|
$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'])
|
if ($poll_device['sysContact'] && $poll_device['sysContact'] != $device['sysContact'])
|
||||||
{
|
{
|
||||||
$update_array['sysContact'] = $poll_device['sysContact'];
|
$update_array['sysContact'] = $poll_device['sysContact'];
|
||||||
|
Reference in New Issue
Block a user