mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fixed detection of vmware guests
This commit is contained in:
@ -23,40 +23,44 @@ if (($device['os'] == "vmware") || ($device['os'] == "linux"))
|
|||||||
/*
|
/*
|
||||||
* Fetch the list is Virtual Machines.
|
* Fetch the list is Virtual Machines.
|
||||||
*
|
*
|
||||||
* VMWARE-VMINFO-MIB::vmwVmVMID.224 = INTEGER: 224
|
* vmwVmVMID.224 = INTEGER: 224
|
||||||
* VMWARE-VMINFO-MIB::vmwVmVMID.416 = INTEGER: 416
|
* vmwVmVMID.416 = INTEGER: 416
|
||||||
* ...
|
* ...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$oids = snmp_walk($device, "VMWARE-VMINFO-MIB::vmwVmVMID", "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB", "+" . $config["install_dir"] . "/mibs/vmware:" . $config["install_dir"] . "/mibs");
|
$oids = trim(snmp_walk($device, "vmwVmUUID", "-Osq", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB", "+" . $config["install_dir"] . "/mibs/vmware:" . $config["install_dir"] . "/mibs"));
|
||||||
|
$oids = str_replace("vmwVmUUID.", "", $oids);
|
||||||
if ($oids != "")
|
if ($oids != "")
|
||||||
{
|
{
|
||||||
$oids = explode("\n", $oids);
|
$oids = explode("\n", $oids);
|
||||||
|
|
||||||
foreach ($oids as $oid)
|
foreach ($oids as $data)
|
||||||
{
|
{
|
||||||
|
$data = trim($data);
|
||||||
|
list($oid,) = explode(" ", $data);
|
||||||
/*
|
/*
|
||||||
* Fetch the Virtual Machine information.
|
* Fetch the Virtual Machine information.
|
||||||
*
|
*
|
||||||
* VMWARE-VMINFO-MIB::vmwVmDisplayName.224 = STRING: My First VM
|
* vmwVmDisplayName.224 = STRING: My First VM
|
||||||
* VMWARE-VMINFO-MIB::vmwVmDisplayName.416 = STRING: My Second VM
|
* vmwVmDisplayName.416 = STRING: My Second VM
|
||||||
* VMWARE-VMINFO-MIB::vmwVmGuestOS.224 = STRING: windows7Server64Guest
|
* vmwVmGuestOS.224 = STRING: windows7Server64Guest
|
||||||
* VMWARE-VMINFO-MIB::vmwVmGuestOS.416 = STRING: winLonghornGuest
|
* vmwVmGuestOS.416 = STRING: winLonghornGuest
|
||||||
* VMWARE-VMINFO-MIB::vmwVmMemSize.224 = INTEGER: 8192 megabytes
|
* vmwVmMemSize.224 = INTEGER: 8192 megabytes
|
||||||
* VMWARE-VMINFO-MIB::vmwVmMemSize.416 = INTEGER: 8192 megabytes
|
* vmwVmMemSize.416 = INTEGER: 8192 megabytes
|
||||||
* VMWARE-VMINFO-MIB::vmwVmState.224 = STRING: poweredOn
|
* vmwVmState.224 = STRING: poweredOn
|
||||||
* VMWARE-VMINFO-MIB::vmwVmState.416 = STRING: poweredOn
|
* vmwVmState.416 = STRING: poweredOn
|
||||||
* VMWARE-VMINFO-MIB::vmwVmVMID.224 = INTEGER: 224
|
* vmwVmVMID.224 = INTEGER: 224
|
||||||
* VMWARE-VMINFO-MIB::vmwVmVMID.416 = INTEGER: 416
|
* vmwVmVMID.416 = INTEGER: 416
|
||||||
* VMWARE-VMINFO-MIB::vmwVmCpus.224 = INTEGER: 2
|
* vmwVmCpus.224 = INTEGER: 2
|
||||||
* VMWARE-VMINFO-MIB::vmwVmCpus.416 = INTEGER: 2
|
* 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:" . $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:" . $config["install_dir"] . "/mibs");
|
$vmwVmDisplayName = snmp_get($device, "vmwVmDisplayName." . $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:" . $config["install_dir"] . "/mibs");
|
$vmwVmGuestOS = snmp_get($device, "vmwVmGuestOS." . $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:" . $config["install_dir"] . "/mibs");
|
$vmwVmMemSize = snmp_get($device, "vmwVmMemSize." . $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:" . $config["install_dir"] . "/mibs");
|
$vmwVmState = snmp_get($device, "vmwVmState." . $oid, "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB", "+" . $config["install_dir"] . "/mibs/vmware:" . $config["install_dir"] . "/mibs");
|
||||||
|
$vmwVmCpus = snmp_get($device, "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
|
||||||
|
Reference in New Issue
Block a user