fix vmware adding one vm when there actually was none

git-svn-id: http://www.observium.org/svn/observer/trunk@3119 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2012-05-02 23:01:57 +00:00
parent 2f9ed9c987
commit b08c1f0a08
2 changed files with 61 additions and 58 deletions
+1 -1
View File
@@ -305,7 +305,7 @@ function sensor_limit($class, $current)
$limit = $current * 1.50; $limit = $current * 1.50;
break; break;
case 'fanspeed': case 'fanspeed':
$limit = $current * 1.30; $limit = $current * 1.80;
break; break;
case 'power': case 'power':
$limit = $current * 1.50; $limit = $current * 1.50;
+9 -6
View File
@@ -28,7 +28,9 @@ if (($device['os'] == "vmware") || ($device['os'] == "linux"))
* ... * ...
*/ */
$oids = snmp_walk($device, "VMWARE-VMINFO-MIB::vmwVmVMID", "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB", "+" . $config["install_dir"] . "/mibs/vmware"); $oids = snmp_walk($device, "VMWARE-VMINFO-MIB::vmwVmVMID", "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB", "+" . $config["install_dir"] . "/mibs/vmware:" . $config["install_dir"] . "/mibs");
if ($oids != "")
{
$oids = explode("\n", $oids); $oids = explode("\n", $oids);
foreach ($oids as $oid) foreach ($oids as $oid)
@@ -50,11 +52,11 @@ if (($device['os'] == "vmware") || ($device['os'] == "linux"))
* VMWARE-VMINFO-MIB::vmwVmCpus.416 = INTEGER: 2 * VMWARE-VMINFO-MIB::vmwVmCpus.416 = INTEGER: 2
*/ */
$vmwVmDisplayName = snmp_get($device, "VMWARE-VMINFO-MIB::vmwVmDisplayName." . $oid, "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB", "+" . $config["install_dir"] . "/mibs/vmware"); $vmwVmDisplayName = snmp_get($device, "VMWARE-VMINFO-MIB::vmwVmDisplayName." . $oid, "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB", "+" . $config["install_dir"] . "/mibs/vmware:" . $config["install_dir"] . "/mibs");
$vmwVmGuestOS = snmp_get($device, "VMWARE-VMINFO-MIB::vmwVmGuestOS." . $oid, "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB", "+" . $config["install_dir"] . "/mibs/vmware"); $vmwVmGuestOS = snmp_get($device, "VMWARE-VMINFO-MIB::vmwVmGuestOS." . $oid, "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB", "+" . $config["install_dir"] . "/mibs/vmware:" . $config["install_dir"] . "/mibs");
$vmwVmMemSize = snmp_get($device, "VMWARE-VMINFO-MIB::vmwVmMemSize." . $oid, "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB", "+" . $config["install_dir"] . "/mibs/vmware"); $vmwVmMemSize = snmp_get($device, "VMWARE-VMINFO-MIB::vmwVmMemSize." . $oid, "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB", "+" . $config["install_dir"] . "/mibs/vmware:" . $config["install_dir"] . "/mibs");
$vmwVmState = snmp_get($device, "VMWARE-VMINFO-MIB::vmwVmState." . $oid, "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB", "+" . $config["install_dir"] . "/mibs/vmware"); $vmwVmState = snmp_get($device, "VMWARE-VMINFO-MIB::vmwVmState." . $oid, "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB", "+" . $config["install_dir"] . "/mibs/vmware:" . $config["install_dir"] . "/mibs");
$vmwVmCpus = snmp_get($device, "VMWARE-VMINFO-MIB::vmwVmCpus." . $oid, "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB", "+" . $config["install_dir"] . "/mibs/vmware"); $vmwVmCpus = snmp_get($device, "VMWARE-VMINFO-MIB::vmwVmCpus." . $oid, "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB", "+" . $config["install_dir"] . "/mibs/vmware:" . $config["install_dir"] . "/mibs");
/* /*
* VMware does not return an INTEGER but a STRING of the vmwVmMemSize. This bug * VMware does not return an INTEGER but a STRING of the vmwVmMemSize. This bug
@@ -86,6 +88,7 @@ if (($device['os'] == "vmware") || ($device['os'] == "linux"))
$vmw_vmlist[] = $oid; $vmw_vmlist[] = $oid;
} }
}
/* /*
* Get a list of all the known Virtual Machines for this host. * Get a list of all the known Virtual Machines for this host.