From 087d588102e11405196c4eb16aea3eba35084b70 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Thu, 5 Oct 2023 19:49:26 -0500 Subject: [PATCH] Vmware vminfo modernize (#15008) * Vmware vminfo Remove legacy file and migrate to OS discovery * tighter * ios_stp-vlans working correctly now * Make vmwVmGuestOS nullable * Discover os info too * VM Info module * Apply fixes from StyleCI * Fix log severity * Fix log severity (more) * VM Info module * Poll with ESXi too because it is lightweight add test data * poller data now too --------- Co-authored-by: StyleCI Bot --- .../Interfaces/Discovery/VminfoDiscovery.php | 39 +++ LibreNMS/Interfaces/Polling/VminfoPolling.php | 40 +++ LibreNMS/Modules/Os.php | 14 +- LibreNMS/Modules/Vminfo.php | 119 +++++++ LibreNMS/OS.php | 9 +- LibreNMS/OS/Beagleboard.php | 3 +- LibreNMS/OS/Linux.php | 54 ++++ LibreNMS/OS/Traits/VminfoLibvirt.php | 166 ++++++++++ LibreNMS/OS/Traits/VminfoVmware.php | 67 ++++ LibreNMS/OS/VmwareEsxi.php | 46 +++ app/Models/Vminfo.php | 17 +- app/Observers/VminfoObserver.php | 67 ++++ app/Providers/AppServiceProvider.php | 1 + ...hange_vminfo_vmw_vm_guest_o_s_nullable.php | 32 ++ doc/Support/Discovery Support.md | 7 +- doc/Support/Poller Support.md | 1 + includes/definitions/aix.yaml | 2 - includes/definitions/beagleboard.yaml | 3 +- includes/definitions/coriant.yaml | 2 - includes/definitions/infinera-groove.yaml | 2 - includes/definitions/linux.yaml | 3 +- includes/definitions/proxmox.yaml | 2 - includes/definitions/rutos.yaml | 2 - includes/definitions/vmware-esxi.yaml | 2 +- includes/definitions/waas.yaml | 1 - includes/discovery/libvirt-vminfo.inc.php | 166 ---------- includes/discovery/vminfo.inc.php | 3 + includes/discovery/vmware-vminfo.inc.php | 85 ----- includes/polling/os/vmware-esxi.inc.php | 78 ----- lang/en/settings.php | 10 +- lang/fr/settings.php | 10 +- lang/it/settings.php | 10 +- lang/uk/settings.php | 10 +- misc/config_definitions.json | 16 +- misc/db_schema.yaml | 2 +- misc/os_schema.json | 10 +- phpstan-baseline-deprecated.neon | 40 --- tests/data/vmware-esxi.json | 295 ++++++++++++++++++ 38 files changed, 990 insertions(+), 446 deletions(-) create mode 100644 LibreNMS/Interfaces/Discovery/VminfoDiscovery.php create mode 100644 LibreNMS/Interfaces/Polling/VminfoPolling.php create mode 100644 LibreNMS/Modules/Vminfo.php create mode 100644 LibreNMS/OS/Linux.php create mode 100644 LibreNMS/OS/Traits/VminfoLibvirt.php create mode 100644 LibreNMS/OS/Traits/VminfoVmware.php create mode 100644 LibreNMS/OS/VmwareEsxi.php create mode 100644 app/Observers/VminfoObserver.php create mode 100644 database/migrations/2023_04_26_185850_change_vminfo_vmw_vm_guest_o_s_nullable.php delete mode 100644 includes/discovery/libvirt-vminfo.inc.php create mode 100644 includes/discovery/vminfo.inc.php delete mode 100644 includes/discovery/vmware-vminfo.inc.php delete mode 100644 includes/polling/os/vmware-esxi.inc.php diff --git a/LibreNMS/Interfaces/Discovery/VminfoDiscovery.php b/LibreNMS/Interfaces/Discovery/VminfoDiscovery.php new file mode 100644 index 0000000000..c7aad1142f --- /dev/null +++ b/LibreNMS/Interfaces/Discovery/VminfoDiscovery.php @@ -0,0 +1,39 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2023 Tony Murray + * @author Tony Murray + */ + +namespace LibreNMS\Interfaces\Discovery; + +use App\Models\Vminfo; +use Illuminate\Support\Collection; + +interface VminfoDiscovery +{ + /** + * Discover all the VMs and return a collection of Vminfo models + * + * @return Collection + */ + public function discoverVminfo(): Collection; +} diff --git a/LibreNMS/Interfaces/Polling/VminfoPolling.php b/LibreNMS/Interfaces/Polling/VminfoPolling.php new file mode 100644 index 0000000000..4a8c74a076 --- /dev/null +++ b/LibreNMS/Interfaces/Polling/VminfoPolling.php @@ -0,0 +1,40 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2023 Tony Murray + * @author Tony Murray + */ + +namespace LibreNMS\Interfaces\Polling; + +use App\Models\Vminfo; +use Illuminate\Support\Collection; + +interface VminfoPolling +{ + /** + * Poll the given VMs + * + * @param Collection $vms + * @return Collection + */ + public function pollVminfo(Collection $vms): Collection; +} diff --git a/LibreNMS/Modules/Os.php b/LibreNMS/Modules/Os.php index 844df9b8f3..cb46e4ce59 100644 --- a/LibreNMS/Modules/Os.php +++ b/LibreNMS/Modules/Os.php @@ -26,7 +26,9 @@ namespace LibreNMS\Modules; use App\Models\Device; +use App\Models\Eventlog; use App\Models\Location; +use LibreNMS\Enum\Severity; use LibreNMS\Interfaces\Data\DataStorageInterface; use LibreNMS\Interfaces\Module; use LibreNMS\Interfaces\Polling\OSPolling; @@ -77,23 +79,17 @@ class Os implements Module if ($os instanceof OSPolling) { $os->pollOS($datastore); } else { - // legacy poller files - global $graphs, $device; - - if (empty($device)) { - $device = $os->getDeviceArray(); - } - + $device = $os->getDeviceArray(); $location = null; if (is_file(base_path('/includes/polling/os/' . $device['os'] . '.inc.php'))) { // OS Specific + Eventlog::log("Warning: OS {$device['os']} using deprecated polling method", $deviceModel, 'poller', Severity::Error); include base_path('/includes/polling/os/' . $device['os'] . '.inc.php'); } elseif (! empty($device['os_group']) && is_file(base_path('/includes/polling/os/' . $device['os_group'] . '.inc.php'))) { // OS Group Specific + Eventlog::log("Warning: OS {$device['os']} using deprecated polling method", $deviceModel, 'poller', Severity::Error); include base_path('/includes/polling/os/' . $device['os_group'] . '.inc.php'); - } else { - echo "Generic :(\n"; } // handle legacy variables, sometimes they are false diff --git a/LibreNMS/Modules/Vminfo.php b/LibreNMS/Modules/Vminfo.php new file mode 100644 index 0000000000..f6c6fee83f --- /dev/null +++ b/LibreNMS/Modules/Vminfo.php @@ -0,0 +1,119 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2023 Tony Murray + * @author Tony Murray + */ + +namespace LibreNMS\Modules; + +use App\Models\Device; +use App\Observers\ModuleModelObserver; +use LibreNMS\Config; +use LibreNMS\DB\SyncsModels; +use LibreNMS\Interfaces\Data\DataStorageInterface; +use LibreNMS\Interfaces\Discovery\VminfoDiscovery; +use LibreNMS\Interfaces\Polling\VminfoPolling; +use LibreNMS\OS; +use LibreNMS\Polling\ModuleStatus; + +class Vminfo implements \LibreNMS\Interfaces\Module +{ + use SyncsModels; + + /** + * @inheritDoc + */ + public function dependencies(): array + { + return []; + } + + public function shouldDiscover(OS $os, ModuleStatus $status): bool + { + // libvirt does not use snmp, only ssh tunnels + if (! Config::get('enable_libvirt') && $os->getDevice()->snmp_disable) { + return false; + } + + return $status->isEnabled() && $os->getDevice()->status && $os instanceof VminfoDiscovery; + } + + /** + * @inheritDoc + */ + public function discover(OS $os): void + { + if ($os instanceof VminfoDiscovery) { + $vms = $os->discoverVminfo(); + + ModuleModelObserver::observe(\App\Models\Vminfo::class); + $this->syncModels($os->getDevice(), 'vminfo', $vms); + } + echo PHP_EOL; + } + + public function shouldPoll(OS $os, ModuleStatus $status): bool + { + return $status->isEnabled() && ! $os->getDevice()->snmp_disable && $os->getDevice()->status && $os instanceof VminfoPolling; + } + + /** + * @inheritDoc + */ + public function poll(OS $os, DataStorageInterface $datastore): void + { + if ($os->getDevice()->vminfo->isEmpty()) { + return; + } + + if ($os instanceof VminfoPolling) { + $vms = $os->pollVminfo($os->getDevice()->vminfo); + + ModuleModelObserver::observe(\App\Models\Vminfo::class); + $this->syncModels($os->getDevice(), 'vminfo', $vms); + + return; + } + + // just run discovery again + $this->discover($os); + } + + /** + * @inheritDoc + */ + public function cleanup(Device $device): void + { + $device->vminfo()->delete(); + } + + /** + * @inheritDoc + */ + public function dump(Device $device) + { + return [ + 'vminfo' => $device->vminfo()->orderBy('vmwVmVMID') + ->get()->map->makeHidden(['id', 'device_id']), + ]; + } +} diff --git a/LibreNMS/OS.php b/LibreNMS/OS.php index bea42b2a21..53c63e10d6 100644 --- a/LibreNMS/OS.php +++ b/LibreNMS/OS.php @@ -94,10 +94,8 @@ class OS implements /** * OS constructor. Not allowed to be created directly. Use OS::make() - * - * @param array $device */ - protected function __construct(&$device) + protected function __construct(array &$device) { $this->device = &$device; $this->graphs = []; @@ -231,11 +229,8 @@ class OS implements * OS Factory, returns an instance of the OS for this device * If no specific OS is found, Try the OS group. * Otherwise, returns Generic - * - * @param array $device device array, must have os set - * @return OS */ - public static function make(&$device) + public static function make(array &$device): OS { if (isset($device['os'])) { // load os definition and populate os_group diff --git a/LibreNMS/OS/Beagleboard.php b/LibreNMS/OS/Beagleboard.php index 36c95e5a19..4e2d9e39b5 100644 --- a/LibreNMS/OS/Beagleboard.php +++ b/LibreNMS/OS/Beagleboard.php @@ -25,9 +25,8 @@ namespace LibreNMS\OS; use App\Models\Device; use LibreNMS\Interfaces\Discovery\OSDiscovery; -use LibreNMS\OS; -class Beagleboard extends OS implements OSDiscovery +class Beagleboard extends Linux implements OSDiscovery { /** * Retrieve basic information about the OS / device diff --git a/LibreNMS/OS/Linux.php b/LibreNMS/OS/Linux.php new file mode 100644 index 0000000000..cd726c098d --- /dev/null +++ b/LibreNMS/OS/Linux.php @@ -0,0 +1,54 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2023 Tony Murray + * @author Tony Murray + */ + +namespace LibreNMS\OS; + +use Illuminate\Support\Collection; +use LibreNMS\Interfaces\Discovery\VminfoDiscovery; +use LibreNMS\OS\Traits\VminfoLibvirt; +use LibreNMS\OS\Traits\VminfoVmware; + +class Linux extends Shared\Unix implements VminfoDiscovery +{ + // NOTE: Only Linux specific stuff should go here, most things should be in Unix + + use VminfoLibvirt, VminfoVmware { + VminfoLibvirt::discoverVminfo as discoverLibvirtVminfo; + VminfoVmware::discoverVmInfo as discoverVmwareVminfo; + } + + public function discoverVmInfo(): Collection + { + $vms = $this->discoverLibvirtVminfo(); + + if ($vms->isNotEmpty()) { + return $vms; + } + + echo PHP_EOL; + + return $this->discoverVmwareVminfo(); + } +} diff --git a/LibreNMS/OS/Traits/VminfoLibvirt.php b/LibreNMS/OS/Traits/VminfoLibvirt.php new file mode 100644 index 0000000000..7d73c8fcc3 --- /dev/null +++ b/LibreNMS/OS/Traits/VminfoLibvirt.php @@ -0,0 +1,166 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2023 Tony Murray + * @author Tony Murray + */ + +namespace LibreNMS\OS\Traits; + +use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Log; +use Illuminate\Support\Str; +use LibreNMS\Config; +use LibreNMS\Enum\PowerState; + +trait VminfoLibvirt +{ + public function discoverVminfo(): Collection + { + echo 'LibVirt VM: '; + + if (! Config::get('enable_libvirt')) { + echo 'not configured'; + } + + $vms = new Collection; + + $ssh_ok = 0; + + $userHostname = $this->getDevice()->hostname; + if (Config::has('libvirt_username')) { + $userHostname = Config::get('libvirt_username') . '@' . $userHostname; + } + + foreach (Config::get('libvirt_protocols') as $method) { + if (Str::contains($method, 'qemu')) { + $uri = $method . '://' . $userHostname . '/system'; + } else { + $uri = $method . '://' . $userHostname; + } + + if (Str::contains($method, 'ssh') && ! $ssh_ok) { + // Check if we are using SSH if we can log in without password - without blocking the discovery + // Also automatically add the host key so discovery doesn't block on the yes/no question, and run echo so we don't get stuck in a remote shell ;-) + exec('ssh -o "StrictHostKeyChecking no" -o "PreferredAuthentications publickey" -o "IdentitiesOnly yes" ' . $userHostname . ' echo -e', $out, $ret); + if ($ret != 255) { + $ssh_ok = 1; + } + } + + if ($ssh_ok || ! Str::contains($method, 'ssh')) { + // Fetch virtual machine list + unset($domlist); + exec(Config::get('virsh') . ' -rc ' . $uri . ' list', $domlist); + + foreach ($domlist as $dom) { + [$dom_id] = explode(' ', trim($dom), 2); + + if (is_numeric($dom_id)) { + // Fetch the Virtual Machine information. + unset($vm_info_array); + exec(Config::get('virsh') . ' -rc ' . $uri . ' dumpxml ' . $dom_id, $vm_info_array); + + // Example xml: + // + // moo.example.com + // 48cf6378-6fd5-4610-0611-63dd4b31cfd6 + // 1048576 + // 1048576 + // 8 + // + // hvm + // + // + // + // + // (...) + // See spec at https://libvirt.org/formatdomain.html + + // Convert array to string + $vm_info_xml = implode($vm_info_array); + + $xml = simplexml_load_string(' ' . $vm_info_xml); + Log::debug($xml); + + // libvirt does not supply this + exec(Config::get('virsh') . ' -rc ' . $uri . ' domstate ' . $dom_id, $vm_state); + $vmwVmState = PowerState::STATES[strtolower($vm_state[0])] ?? PowerState::UNKNOWN; + + $vmwVmMemSize = $xml->memory; + // Convert memory size to MiB + switch ($xml->memory['unit']) { + case 'T': + case 'TiB': + $vmwVmMemSize = $xml->memory * 1048576; + break; + case 'TB': + $vmwVmMemSize = $xml->memory * 1000000; + break; + case 'G': + case 'GiB': + $vmwVmMemSize = $xml->memory * 1024; + break; + case 'GB': + $vmwVmMemSize = $xml->memory * 1000; + break; + case 'M': + case 'MiB': + break; + case 'MB': + $vmwVmMemSize = $xml->memory * 1000000 / 1048576; + break; + case 'KB': + $vmwVmMemSize = $xml->memory / 1000; + break; + case 'b': + case 'bytes': + $vmwVmMemSize = $xml->memory / 1048576; + break; + default: + // KiB or k or no value + $vmwVmMemSize = $xml->memory / 1024; + break; + } + + // Save the discovered Virtual Machine. + $vms->push(new \App\Models\Vminfo([ + 'vmtype' => 'libvirt', + 'vmwVmVMID' => $dom_id, + 'vmwVmState' => $vmwVmState, + 'vmwVmGuestOS' => '', + 'vmwVmDisplayName' => $xml->name, + 'vmwVmMemSize' => $vmwVmMemSize, + 'vmwVmCpus' => $xml->vcpu['current'] ?? $xml->vcpu, + ])); + } + } + } + + // If we found VMs, don't cycle the other protocols anymore. + if ($vms->isNotEmpty()) { + break; + } + } + + return $vms; + } +} diff --git a/LibreNMS/OS/Traits/VminfoVmware.php b/LibreNMS/OS/Traits/VminfoVmware.php new file mode 100644 index 0000000000..afc0c5a83a --- /dev/null +++ b/LibreNMS/OS/Traits/VminfoVmware.php @@ -0,0 +1,67 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2023 Tony Murray + * @author Tony Murray + */ + +namespace LibreNMS\OS\Traits; + +use App\Models\Vminfo; +use Illuminate\Support\Collection; +use LibreNMS\Enum\PowerState; + +trait VminfoVmware +{ + public function discoverVmInfo(): Collection + { + echo 'VMware VM: '; + + /* + * Fetch the Virtual Machine information. + * + * VMWARE-VMINFO-MIB::vmwVmDisplayName.224 = STRING: My First VM + * VMWARE-VMINFO-MIB::vmwVmGuestOS.224 = STRING: windows7Server64Guest + * VMWARE-VMINFO-MIB::vmwVmMemSize.224 = INTEGER: 8192 megabytes + * VMWARE-VMINFO-MIB::vmwVmState.224 = STRING: poweredOn + * VMWARE-VMINFO-MIB::vmwVmVMID.224 = INTEGER: 224 + * VMWARE-VMINFO-MIB::vmwVmCpus.224 = INTEGER: 2 + */ + + $vm_info = \SnmpQuery::hideMib()->walk('VMWARE-VMINFO-MIB::vmwVmTable'); + + return $vm_info->mapTable(function ($data, $vmwVmVMID) { + $data['vm_type'] = 'vmware'; + $data['vmwVmVMID'] = $vmwVmVMID; + $data['vmwVmState'] = PowerState::STATES[$data['vmwVmState']] ?? PowerState::UNKNOWN; + + /* + * If VMware Tools is not running then don't overwrite the GuestOS with the error + * message, but just leave it as it currently is. + */ + if (str_contains($data['vmwVmGuestOS'], 'tools not ')) { + unset($data['vmwVmGuestOS']); + } + + return new Vminfo($data); + }); + } +} diff --git a/LibreNMS/OS/VmwareEsxi.php b/LibreNMS/OS/VmwareEsxi.php new file mode 100644 index 0000000000..fb3e0d75bf --- /dev/null +++ b/LibreNMS/OS/VmwareEsxi.php @@ -0,0 +1,46 @@ +. + * + * @link https://www.librenms.org + * + * @copyright 2023 Tony Murray + * @author Tony Murray + */ + +namespace LibreNMS\OS; + +use Illuminate\Support\Collection; +use LibreNMS\Interfaces\Discovery\VminfoDiscovery; +use LibreNMS\Interfaces\Polling\VminfoPolling; +use LibreNMS\OS\Traits\VminfoVmware; + +class VmwareEsxi extends \LibreNMS\OS implements VminfoDiscovery, VminfoPolling +{ + use VminfoVmware; + + public function pollVminfo(Collection $vms): Collection + { + // no VMs, assume there aren't any + if ($vms->isEmpty()) { + return $vms; + } + + return $this->discoverVmInfo(); // just do the same thing as discovery. + } +} diff --git a/app/Models/Vminfo.php b/app/Models/Vminfo.php index 057bc3896a..ade4f5c721 100644 --- a/app/Models/Vminfo.php +++ b/app/Models/Vminfo.php @@ -7,16 +7,26 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Support\Str; +use LibreNMS\Interfaces\Models\Keyable; use LibreNMS\Util\Html; use LibreNMS\Util\Number; use LibreNMS\Util\Rewrite; -class Vminfo extends DeviceRelatedModel +class Vminfo extends DeviceRelatedModel implements Keyable { use HasFactory; protected $table = 'vminfo'; public $timestamps = false; + protected $fillable = [ + 'vm_type', + 'vmwVmVMID', + 'vmwVmDisplayName', + 'vmwVmGuestOS', + 'vmwVmMemSize', + 'vmwVmCpus', + 'vmwVmState', + ]; public function getStateLabelAttribute(): array { @@ -56,4 +66,9 @@ class Vminfo extends DeviceRelatedModel { return $this->hasOne(\App\Models\Device::class, 'hostname', 'vmwVmDisplayName'); } + + public function getCompositeKey() + { + return $this->vm_type . $this->vmwVmVMID; + } } diff --git a/app/Observers/VminfoObserver.php b/app/Observers/VminfoObserver.php new file mode 100644 index 0000000000..cde7469b19 --- /dev/null +++ b/app/Observers/VminfoObserver.php @@ -0,0 +1,67 @@ +vmwVmDisplayName . " ($vminfo->vmwVmMemSize GB / $vminfo->vmwVmCpus vCPU)", $vminfo->device_id, 'vm', Severity::Notice, $vminfo->vmwVmVMID); + } + + /** + * Handle the Vminfo "updated" event. + * + * @param \App\Models\Vminfo $vminfo + * @return void + */ + public function updating(Vminfo $vminfo) + { + foreach ($vminfo->getDirty() as $field => $value) { + Eventlog::log($vminfo->vmwVmDisplayName . ' (' . preg_replace('/^vmwVm/', '', $field) . ') -> ' . $value, $vminfo->device_id, 'vm'); + } + } + + /** + * Handle the Vminfo "deleted" event. + * + * @param \App\Models\Vminfo $vminfo + * @return void + */ + public function deleted(Vminfo $vminfo) + { + Eventlog::log('Virtual Machine removed: ' . $vminfo->vmwVmDisplayName, $vminfo->device_id, 'vm', Severity::Warning, $vminfo->vmwVmVMID); + } + + /** + * Handle the Vminfo "restored" event. + * + * @param \App\Models\Vminfo $vminfo + * @return void + */ + public function restored(Vminfo $vminfo) + { + // + } + + /** + * Handle the Vminfo "force deleted" event. + * + * @param \App\Models\Vminfo $vminfo + * @return void + */ + public function forceDeleted(Vminfo $vminfo) + { + // + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 88fd4d5cb3..f08a20cb05 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -142,6 +142,7 @@ class AppServiceProvider extends ServiceProvider \App\Models\Service::observe(\App\Observers\ServiceObserver::class); \App\Models\Stp::observe(\App\Observers\StpObserver::class); \App\Models\User::observe(\App\Observers\UserObserver::class); + \App\Models\Vminfo::observe(\App\Observers\VminfoObserver::class); } private function bootCustomValidators() diff --git a/database/migrations/2023_04_26_185850_change_vminfo_vmw_vm_guest_o_s_nullable.php b/database/migrations/2023_04_26_185850_change_vminfo_vmw_vm_guest_o_s_nullable.php new file mode 100644 index 0000000000..1f9f6b80c2 --- /dev/null +++ b/database/migrations/2023_04_26_185850_change_vminfo_vmw_vm_guest_o_s_nullable.php @@ -0,0 +1,32 @@ +string('vmwVmGuestOS', 128)->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('vminfo', function (Blueprint $table) { + $table->string('vmwVmGuestOS', 128)->nullable(false)->change(); + }); + } +}; diff --git a/doc/Support/Discovery Support.md b/doc/Support/Discovery Support.md index a5b9faa58d..1d754988ee 100644 --- a/doc/Support/Discovery Support.md +++ b/doc/Support/Discovery Support.md @@ -96,8 +96,7 @@ Modules. lnms config:set discovery_modules.junose-atm-vp false lnms config:set discovery_modules.bgp-peers true lnms config:set discovery_modules.vlans true - lnms config:set discovery_modules.vmware-vminfo false - lnms config:set discovery_modules.libvirt-vminfo false + lnms config:set discovery_modules.vminfo false lnms config:set discovery_modules.printer-supplies false lnms config:set discovery_modules.ucd-diskio true lnms config:set discovery_modules.applications false @@ -185,9 +184,7 @@ device, with history data. `slas`: SLA detection and support. -`vmware-vminfo`: Detection of vmware guests on an ESXi host - -`libvirt-vminfo`: Detection of libvirt guests. +`vminfo`: Detection of vm guests for VMware ESXi and libvert `printer-supplies`: Toner levels support. diff --git a/doc/Support/Poller Support.md b/doc/Support/Poller Support.md index 153e13d2b7..2cf9c1dcb5 100644 --- a/doc/Support/Poller Support.md +++ b/doc/Support/Poller Support.md @@ -85,6 +85,7 @@ disable it for one device then you can do this within the WebUI Device lnms config:set poller_modules.applications true lnms config:set poller_modules.availability true lnms config:set poller_modules.stp true + lnms config:set poller_modules.vminfo false lnms config:set poller_modules.ntp true lnms config:set poller_modules.services true lnms config:set poller_modules.loadbalancers false diff --git a/includes/definitions/aix.yaml b/includes/definitions/aix.yaml index 266a5d83d8..ef3a8e2a9f 100644 --- a/includes/definitions/aix.yaml +++ b/includes/definitions/aix.yaml @@ -16,8 +16,6 @@ discovery_modules: applications: false bgp-peers: false stp: false - vmware-vminfo: false - libvirt-vminfo: false wireless: false processor_stacked: true discovery: diff --git a/includes/definitions/beagleboard.yaml b/includes/definitions/beagleboard.yaml index b108a85dda..4bb7a6a025 100644 --- a/includes/definitions/beagleboard.yaml +++ b/includes/definitions/beagleboard.yaml @@ -17,8 +17,7 @@ discovery_modules: applications: true bgp-peers: false stp: false - vmware-vminfo: true - libvirt-vminfo: true + vminfo: true processor_stacked: true discovery: - diff --git a/includes/definitions/coriant.yaml b/includes/definitions/coriant.yaml index 4295c044fe..6e99fe9e42 100644 --- a/includes/definitions/coriant.yaml +++ b/includes/definitions/coriant.yaml @@ -25,8 +25,6 @@ poller_modules: ipmi: false bgp-peers: false services: false - libvirt-vminfo: false - vmware-vminfo: false vlans: false arp-table: false mef: true diff --git a/includes/definitions/infinera-groove.yaml b/includes/definitions/infinera-groove.yaml index e60eadebd8..d2f56df1d3 100644 --- a/includes/definitions/infinera-groove.yaml +++ b/includes/definitions/infinera-groove.yaml @@ -36,8 +36,6 @@ poller_modules: ipmi: false bgp-peers: false services: false - libvirt-vminfo: false - vmware-vminfo: false vlans: false arp-table: false mef: false diff --git a/includes/definitions/linux.yaml b/includes/definitions/linux.yaml index 3317d18380..fc5d4eb1c2 100644 --- a/includes/definitions/linux.yaml +++ b/includes/definitions/linux.yaml @@ -16,8 +16,7 @@ discovery_modules: applications: true bgp-peers: false stp: false - vmware-vminfo: true - libvirt-vminfo: true + vminfo: true processor_stacked: true discovery: - diff --git a/includes/definitions/proxmox.yaml b/includes/definitions/proxmox.yaml index ba78fa6678..2a782a69c2 100644 --- a/includes/definitions/proxmox.yaml +++ b/includes/definitions/proxmox.yaml @@ -17,8 +17,6 @@ discovery_modules: applications: true bgp-peers: false stp: false - vmware-vminfo: false - libvirt-vminfo: false processor_stacked: true discovery: - diff --git a/includes/definitions/rutos.yaml b/includes/definitions/rutos.yaml index 512300cd4b..daddcf30a1 100644 --- a/includes/definitions/rutos.yaml +++ b/includes/definitions/rutos.yaml @@ -17,8 +17,6 @@ discovery_modules: applications: false bgp-peers: false stp: false - vmware-vminfo: false - libvirt-vminfo: false processor_stacked: true discovery: - diff --git a/includes/definitions/vmware-esxi.yaml b/includes/definitions/vmware-esxi.yaml index 9e1a93bdf1..e78fbd07c4 100644 --- a/includes/definitions/vmware-esxi.yaml +++ b/includes/definitions/vmware-esxi.yaml @@ -9,7 +9,7 @@ ifXmcbc: true over: - { graph: device_bits, text: 'Device Traffic' } discovery_modules: - vmware-vminfo: true + vminfo: true discovery: - sysObjectID: .1.3.6.1.4.1.6876.4.1 diff --git a/includes/definitions/waas.yaml b/includes/definitions/waas.yaml index b1670ea456..08218e0b75 100644 --- a/includes/definitions/waas.yaml +++ b/includes/definitions/waas.yaml @@ -33,7 +33,6 @@ discovery_modules: slas: false cisco-vrf-lite: false vrf: false - libvirt-vminfo: false ntp: false stp: false printer-supplies: false diff --git a/includes/discovery/libvirt-vminfo.inc.php b/includes/discovery/libvirt-vminfo.inc.php deleted file mode 100644 index 04cc9d6723..0000000000 --- a/includes/discovery/libvirt-vminfo.inc.php +++ /dev/null @@ -1,166 +0,0 @@ - - // moo.example.com - // 48cf6378-6fd5-4610-0611-63dd4b31cfd6 - // 1048576 - // 1048576 - // 8 - // - // hvm - // - // - // - // - // (...) - // See spec at https://libvirt.org/formatdomain.html - - // Convert array to string - unset($vm_info_xml); - foreach ($vm_info_array as $line) { - $vm_info_xml .= $line; - } - - $xml = simplexml_load_string(' ' . $vm_info_xml); - d_echo($xml); - - $vmwVmDisplayName = $xml->name; - $vmwVmGuestOS = ''; - // libvirt does not supply this - exec(Config::get('virsh') . ' -rc ' . $uri . ' domstate ' . $dom_id, $vm_state); - $vmwVmState = PowerState::STATES[strtolower($vm_state[0])] ?? PowerState::UNKNOWN; - unset($vm_state); - - $vmwVmCpus = $xml->vcpu['current']; - if (! isset($vmwVmCpus)) { - $vmwVmCpus = $xml->vcpu; - } - $vmwVmMemSize = $xml->memory; - // Convert memory size to MiB - switch ($vmwVmMemSize['unit']) { - case 'T': - case 'TiB': - $vmwVmMemSize = $vmwVmMemSize * 1048576; - break; - case 'TB': - $vmwVmMemSize = $vmwVmMemSize * 1000000; - break; - case 'G': - case 'GiB': - $vmwVmMemSize = $vmwVmMemSize * 1024; - break; - case 'GB': - $vmwVmMemSize = $vmwVmMemSize * 1000; - break; - case 'M': - case 'MiB': - break; - case 'MB': - $vmwVmMemSize = $vmwVmMemSize * 1000000 / 1048576; - break; - case 'KB': - $vmwVmMemSize = $vmwVmMemSize / 1000; - break; - case 'b': - case 'bytes': - $vmwVmMemSize = $vmwVmMemSize / 1048576; - break; - default: - // KiB or k or no value - $vmwVmMemSize = $vmwVmMemSize / 1024; - break; - } - - // Check whether the Virtual Machine is already known for this host. - $result = dbFetchRow("SELECT * FROM `vminfo` WHERE `device_id` = ? AND `vmwVmVMID` = ? AND `vm_type` = 'libvirt'", [$device['device_id'], $dom_id]); - if (empty($result)) { - $inserted_id = dbInsert(['device_id' => $device['device_id'], 'vm_type' => 'libvirt', 'vmwVmVMID' => $dom_id, 'vmwVmDisplayName' => $vmwVmDisplayName, 'vmwVmGuestOS' => $vmwVmGuestOS, 'vmwVmMemSize' => $vmwVmMemSize, 'vmwVmCpus' => $vmwVmCpus, 'vmwVmState' => $vmwVmState], 'vminfo'); - echo '+'; - log_event("Virtual Machine added: $vmwVmDisplayName ($vmwVmMemSize MB)", $device, 'vm', 3, $inserted_id); - } else { - if ($result['vmwVmState'] != $vmwVmState - || $result['vmwVmDisplayName'] != $vmwVmDisplayName - || $result['vmwVmCpus'] != $vmwVmCpus - || $result['vmwVmGuestOS'] != $vmwVmGuestOS - || $result['vmwVmMemSize'] != $vmwVmMemSize - ) { - dbUpdate(['vmwVmState' => $vmwVmState, 'vmwVmGuestOS' => $vmwVmGuestOS, 'vmwVmDisplayName' => $vmwVmDisplayName, 'vmwVmMemSize' => $vmwVmMemSize, 'vmwVmCpus' => $vmwVmCpus], 'vminfo', "device_id=? AND vm_type='libvirt' AND vmwVmVMID=?", [$device['device_id'], $dom_id]); - echo 'U'; - // FIXME eventlog - } else { - echo '.'; - } - } - - // Save the discovered Virtual Machine. - $libvirt_vmlist[] = $dom_id; - }//end if - }//end foreach - }//end if - - // If we found VMs, don't cycle the other protocols anymore. - if (count($libvirt_vmlist)) { - break; - } - }//end foreach - - // Get a list of all the known Virtual Machines for this host. - $sql = "SELECT id, vmwVmVMID, vmwVmDisplayName FROM vminfo WHERE device_id = '" . $device['device_id'] . "' AND vm_type='libvirt'"; - - foreach (dbFetchRows($sql) as $db_vm) { - // Delete the Virtual Machines that are removed from the host. - if (! in_array($db_vm['vmwVmVMID'], $libvirt_vmlist)) { - dbDelete('vminfo', '`id` = ?', [$db_vm['id']]); - echo '-'; - log_event('Virtual Machine removed: ' . $db_vm['vmwVmDisplayName'], $device, 'vm', 4, $db_vm['id']); - } - } - - echo "\n"; -}//end if diff --git a/includes/discovery/vminfo.inc.php b/includes/discovery/vminfo.inc.php new file mode 100644 index 0000000000..3dff1a7908 --- /dev/null +++ b/includes/discovery/vminfo.inc.php @@ -0,0 +1,3 @@ +discover($os); diff --git a/includes/discovery/vmware-vminfo.inc.php b/includes/discovery/vmware-vminfo.inc.php deleted file mode 100644 index 4ccc123df3..0000000000 --- a/includes/discovery/vmware-vminfo.inc.php +++ /dev/null @@ -1,85 +0,0 @@ - $entry) { - $vmwVmDisplayName = $entry['vmwVmDisplayName']; - $vmwVmGuestOS = $entry['vmwVmGuestOS']; - $vmwVmMemSize = $entry['vmwVmMemSize']; - $vmwVmState = PowerState::STATES[strtolower($entry['vmwVmState'])] ?? PowerState::UNKNOWN; - $vmwVmCpus = $entry['vmwVmCpus']; - - /* - * VMware does not return an INTEGER but a STRING of the vmwVmMemSize. This bug - * might be resolved by VMware in the future making this code obsolete. - */ - if (preg_match('/^([0-9]+) .*$/', $vmwVmMemSize, $matches)) { - $vmwVmMemSize = $matches[1]; - } - - /* - * Check whether the Virtual Machine is already known for this host. - */ - if (dbFetchCell("SELECT COUNT(id) FROM `vminfo` WHERE `device_id` = ? AND `vmwVmVMID` = ? AND vm_type='vmware'", [$device['device_id'], $index]) == 0) { - $vmid = dbInsert(['device_id' => $device['device_id'], 'vm_type' => 'vmware', 'vmwVmVMID' => $index, 'vmwVmDisplayName' => $vmwVmDisplayName, 'vmwVmGuestOS' => $vmwVmGuestOS, 'vmwVmMemSize' => $vmwVmMemSize, 'vmwVmCpus' => $vmwVmCpus, 'vmwVmState' => $vmwVmState], 'vminfo'); - log_event($vmwVmDisplayName . " ($vmwVmMemSize GB / $vmwVmCpus vCPU) Discovered", $device, 'system', 3, $vmid); - echo '+'; - // FIXME eventlog - } else { - echo '.'; - } - - /* - * Save the discovered Virtual Machine. - */ - - $vmw_vmlist[] = $index; - } - - /* - * Get a list of all the known Virtual Machines for this host. - */ - - $sql = "SELECT id, vmwVmVMID, vmwVmDisplayName FROM vminfo WHERE device_id = '" . $device['device_id'] . "' AND vm_type='vmware'"; - - foreach (dbFetchRows($sql) as $db_vm) { - /* - * Delete the Virtual Machines that are removed from the host. - */ - - if (! in_array($db_vm['vmwVmVMID'], $vmw_vmlist)) { - dbDelete('vminfo', '`id` = ?', [$db_vm['id']]); - log_event($db_vm['vmwVmDisplayName'] . ' Removed', $device, 'system', 4, $db_vm['vmwVmVMID']); - echo '-'; - // FIXME eventlog - } - } - - /* - * Finished discovering VMware information. - */ - - echo "\n"; -}//end if diff --git a/includes/polling/os/vmware-esxi.inc.php b/includes/polling/os/vmware-esxi.inc.php deleted file mode 100644 index 470ae61c50..0000000000 --- a/includes/polling/os/vmware-esxi.inc.php +++ /dev/null @@ -1,78 +0,0 @@ - $value) { - /* - * Check the property for any modifications. - */ - - if ($vm_info[$property] != $db_info[$property]) { - // FIXME - this should loop building a query and then run the query after the loop (bad geert!) - dbUpdate([$property => $vm_info[$property]], 'vminfo', '`id` = ?', [$db_info['id']]); - if ($db_info['vmwVmDisplayName'] != null) { - log_event($db_info['vmwVmDisplayName'] . ' (' . preg_replace('/^vmwVm/', '', $property) . ') -> ' . $vm_info[$property], $device, null, 3); - } - } - } -}//end foreach - -/* - * Finished discovering VMware information. - */ - -echo "\n"; diff --git a/lang/en/settings.php b/lang/en/settings.php index a9b8a2fd5a..87b60e6aed 100644 --- a/lang/en/settings.php +++ b/lang/en/settings.php @@ -547,9 +547,6 @@ return [ 'junose-atm-vp' => [ 'description' => 'Junose ATM VP', ], - 'libvirt-vminfo' => [ - 'description' => 'Libvirt VMInfo', - ], 'loadbalancers' => [ 'description' => 'Loadbalancers', ], @@ -602,8 +599,8 @@ return [ 'vlans' => [ 'description' => 'VLans', ], - 'vmware-vminfo' => [ - 'description' => 'VMWare VMInfo', + 'vminfo' => [ + 'description' => 'Hypervisor VM Info', ], 'vrf' => [ 'description' => 'VRF', @@ -1197,6 +1194,9 @@ return [ 'stp' => [ 'description' => 'STP', ], + 'vminfo' => [ + 'description' => 'Hypervisor VM Info', + ], 'ntp' => [ 'description' => 'NTP', ], diff --git a/lang/fr/settings.php b/lang/fr/settings.php index 3c3eba064c..79c5aa7a0b 100644 --- a/lang/fr/settings.php +++ b/lang/fr/settings.php @@ -432,9 +432,6 @@ return [ 'junose-atm-vp' => [ 'description' => 'Junose ATM VP', ], - 'libvirt-vminfo' => [ - 'description' => 'Libvirt VMInfo', - ], 'loadbalancers' => [ 'description' => 'Loadbalancers', ], @@ -489,8 +486,8 @@ return [ 'vlans' => [ 'description' => 'VLans', ], - 'vmware-vminfo' => [ - 'description' => 'VMWare VMInfo', + 'vminfo' => [ + 'description' => 'Hypervisor VM Info', ], 'vrf' => [ 'description' => 'VRF', @@ -901,6 +898,9 @@ return [ 'stp' => [ 'description' => 'STP', ], + 'vminfo' => [ + 'description' => 'Hypervisor VM Info', + ], 'ntp' => [ 'description' => 'NTP', ], diff --git a/lang/it/settings.php b/lang/it/settings.php index 4b6d316f29..6b75d6c3a9 100644 --- a/lang/it/settings.php +++ b/lang/it/settings.php @@ -533,9 +533,6 @@ return [ 'junose-atm-vp' => [ 'description' => 'Junose ATM VP', ], - 'libvirt-vminfo' => [ - 'description' => 'Libvirt VMInfo', - ], 'loadbalancers' => [ 'description' => 'Loadbalancers', ], @@ -591,8 +588,8 @@ return [ 'vlans' => [ 'description' => 'VLans', ], - 'vmware-vminfo' => [ - 'description' => 'VMWare VMInfo', + 'vminfo' => [ + 'description' => 'Hypervisor VM Info', ], 'vrf' => [ 'description' => 'VRF', @@ -1167,6 +1164,9 @@ return [ 'stp' => [ 'description' => 'STP', ], + 'vminfo' => [ + 'description' => 'Hypervisor VM Info', + ], 'ntp' => [ 'description' => 'NTP', ], diff --git a/lang/uk/settings.php b/lang/uk/settings.php index c557c328ae..f21fb8d866 100644 --- a/lang/uk/settings.php +++ b/lang/uk/settings.php @@ -524,9 +524,6 @@ return [ 'junose-atm-vp' => [ 'description' => 'Junose ATM VP', ], - 'libvirt-vminfo' => [ - 'description' => 'Libvirt VMInfo', - ], 'loadbalancers' => [ 'description' => 'Loadbalancers', ], @@ -582,8 +579,8 @@ return [ 'vlans' => [ 'description' => 'VLans', ], - 'vmware-vminfo' => [ - 'description' => 'VMWare VMInfo', + 'vminfo' => [ + 'description' => 'Hypervisor VM Info', ], 'vrf' => [ 'description' => 'VRF', @@ -1158,6 +1155,9 @@ return [ 'stp' => [ 'description' => 'STP', ], + 'vminfo' => [ + 'description' => 'Hypervisor VM Info', + ], 'ntp' => [ 'description' => 'NTP', ], diff --git a/misc/config_definitions.json b/misc/config_definitions.json index 709d84e069..5e5d8c9b50 100644 --- a/misc/config_definitions.json +++ b/misc/config_definitions.json @@ -1297,20 +1297,13 @@ "default": true, "type": "boolean" }, - "discovery_modules.vmware-vminfo": { + "discovery_modules.vminfo": { "order": 350, "group": "discovery", "section": "discovery_modules", "default": false, "type": "boolean" }, - "discovery_modules.libvirt-vminfo": { - "order": 170, - "group": "discovery", - "section": "discovery_modules", - "default": false, - "type": "boolean" - }, "discovery_modules.printer-supplies": { "order": 320, "group": "discovery", @@ -4843,6 +4836,13 @@ "default": true, "type": "boolean" }, + "poller_modules.vminfo": { + "order": 410, + "group": "poller", + "section": "poller_modules", + "default": false, + "type": "boolean" + }, "poller_modules.wifi": { "order": 430, "group": "poller", diff --git a/misc/db_schema.yaml b/misc/db_schema.yaml index 0bf081f7ba..d0e44c6f7f 100644 --- a/misc/db_schema.yaml +++ b/misc/db_schema.yaml @@ -2169,7 +2169,7 @@ vminfo: - { Field: vm_type, Type: varchar(16), 'Null': false, Extra: '', Default: vmware } - { Field: vmwVmVMID, Type: int, 'Null': false, Extra: '' } - { Field: vmwVmDisplayName, Type: varchar(128), 'Null': false, Extra: '' } - - { Field: vmwVmGuestOS, Type: varchar(128), 'Null': false, Extra: '' } + - { Field: vmwVmGuestOS, Type: varchar(128), 'Null': true, Extra: '' } - { Field: vmwVmMemSize, Type: int, 'Null': false, Extra: '' } - { Field: vmwVmCpus, Type: int, 'Null': false, Extra: '' } - { Field: vmwVmState, Type: 'smallint unsigned', 'Null': false, Extra: '' } diff --git a/misc/os_schema.json b/misc/os_schema.json index 6fcebd968d..4c2a06797a 100644 --- a/misc/os_schema.json +++ b/misc/os_schema.json @@ -180,10 +180,7 @@ "cisco-vpdn": { "type": "boolean" }, - "libvirt-vminfo": { - "type": "boolean" - }, - "vmware-vminfo": { + "vminfo": { "type": "boolean" }, "vlans": { @@ -345,10 +342,7 @@ "junose-atm-vp": { "type": "boolean" }, - "vmware-vminfo": { - "type": "boolean" - }, - "libvirt-vminfo": { + "vminfo": { "type": "boolean" }, "mpls": { diff --git a/phpstan-baseline-deprecated.neon b/phpstan-baseline-deprecated.neon index 1efb685947..a4313e42da 100644 --- a/phpstan-baseline-deprecated.neon +++ b/phpstan-baseline-deprecated.neon @@ -1064,46 +1064,6 @@ parameters: count: 1 path: includes/discovery/junose-atm-vp.inc.php - - - message: """ - #^Call to deprecated function dbDelete\\(\\)\\: - Please use Eloquent instead; https\\://laravel\\.com/docs/eloquent\\#deleting\\-models$# - """ - count: 1 - path: includes/discovery/libvirt-vminfo.inc.php - - - - message: """ - #^Call to deprecated function dbFetchRow\\(\\)\\: - Please use Eloquent instead; https\\://laravel\\.com/docs/eloquent$# - """ - count: 1 - path: includes/discovery/libvirt-vminfo.inc.php - - - - message: """ - #^Call to deprecated function dbFetchRows\\(\\)\\: - Please use Eloquent instead; https\\://laravel\\.com/docs/eloquent$# - """ - count: 1 - path: includes/discovery/libvirt-vminfo.inc.php - - - - message: """ - #^Call to deprecated function dbInsert\\(\\)\\: - Please use Eloquent instead; https\\://laravel\\.com/docs/eloquent\\#inserting\\-and\\-updating\\-models$# - """ - count: 1 - path: includes/discovery/libvirt-vminfo.inc.php - - - - message: """ - #^Call to deprecated function dbUpdate\\(\\)\\: - Please use Eloquent instead; https\\://laravel\\.com/docs/eloquent\\#inserting\\-and\\-updating\\-models$# - """ - count: 1 - path: includes/discovery/libvirt-vminfo.inc.php - - message: """ #^Call to deprecated function dbDelete\\(\\)\\: diff --git a/tests/data/vmware-esxi.json b/tests/data/vmware-esxi.json index 1db1dd608e..a0196dc0c1 100644 --- a/tests/data/vmware-esxi.json +++ b/tests/data/vmware-esxi.json @@ -1781,5 +1781,300 @@ } ] } + }, + "vminfo": { + "discovery": { + "vminfo": [ + { + "vm_type": "vmware", + "vmwVmVMID": 708, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "", + "vmwVmMemSize": 2048, + "vmwVmCpus": 2, + "vmwVmState": 0 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 775, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "", + "vmwVmMemSize": 2048, + "vmwVmCpus": 2, + "vmwVmState": 0 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 1644, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "", + "vmwVmMemSize": 6144, + "vmwVmCpus": 4, + "vmwVmState": 0 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 7092, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.19.0-10-amd64 Debian GNU/Linux 10 (buster)", + "vmwVmMemSize": 4096, + "vmwVmCpus": 2, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 7095, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.19.0-10-amd64 Debian GNU/Linux 10 (buster)", + "vmwVmMemSize": 4096, + "vmwVmCpus": 2, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 7310, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.9.0-11-amd64 Debian GNU/Linux 9.13 (stretch)", + "vmwVmMemSize": 4096, + "vmwVmCpus": 2, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 7642, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.19.0-10-amd64 Debian GNU/Linux 10 (buster)", + "vmwVmMemSize": 16384, + "vmwVmCpus": 4, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 7879, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "", + "vmwVmMemSize": 2048, + "vmwVmCpus": 1, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 7880, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.15.0-112-generic Ubuntu 18.04.5 LTS", + "vmwVmMemSize": 4096, + "vmwVmCpus": 2, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 7913, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 3.16.0-10-amd64 Debian GNU/Linux 8.11 (jessie)", + "vmwVmMemSize": 4096, + "vmwVmCpus": 2, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8190, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.9.0-13-amd64 Debian GNU/Linux 9.13 (stretch)", + "vmwVmMemSize": 4096, + "vmwVmCpus": 2, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8348, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.15.0-70-generic Ubuntu 18.04.3 LTS", + "vmwVmMemSize": 4096, + "vmwVmCpus": 4, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8371, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 3.16.0-11-amd64 Debian GNU/Linux 8.11 (jessie)", + "vmwVmMemSize": 4096, + "vmwVmCpus": 2, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8386, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.15.0-101-generic Ubuntu 18.04.4 LTS", + "vmwVmMemSize": 4096, + "vmwVmCpus": 4, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8431, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.4.0-121-generic Ubuntu 16.04.4 LTS", + "vmwVmMemSize": 2048, + "vmwVmCpus": 1, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8432, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.19.0-9-amd64 Debian GNU/Linux 10 (buster)", + "vmwVmMemSize": 2048, + "vmwVmCpus": 1, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8453, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.19.0-6-amd64 Debian GNU/Linux 10 (buster)", + "vmwVmMemSize": 4096, + "vmwVmCpus": 4, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8464, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 3.16.0-10-amd64 Debian GNU/Linux 8.11 (jessie)", + "vmwVmMemSize": 4096, + "vmwVmCpus": 2, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8465, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.19.0-12-amd64 Debian GNU/Linux 10 (buster)", + "vmwVmMemSize": 4096, + "vmwVmCpus": 1, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8484, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "", + "vmwVmMemSize": 3072, + "vmwVmCpus": 4, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8487, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.9.0-13-amd64 Debian GNU/Linux 9.13 (stretch)", + "vmwVmMemSize": 4096, + "vmwVmCpus": 2, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8491, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.19.0-9-amd64 Debian GNU/Linux 10 (buster)", + "vmwVmMemSize": 2048, + "vmwVmCpus": 2, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8498, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "FreeBSD 12.1-RELEASE-p7-HBSD", + "vmwVmMemSize": 2048, + "vmwVmCpus": 2, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8499, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.19.0-8-amd64 Debian GNU/Linux 10 (buster)", + "vmwVmMemSize": 1024, + "vmwVmCpus": 1, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8502, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "FreeBSD 11.3-RELEASE-p5", + "vmwVmMemSize": 2048, + "vmwVmCpus": 4, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8504, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 3.16.0-4-amd64 Debian GNU/Linux 8.11 (jessie)", + "vmwVmMemSize": 4096, + "vmwVmCpus": 2, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8506, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 2.6.32-74-server Ubuntu 10.04.4 LTS", + "vmwVmMemSize": 2048, + "vmwVmCpus": 2, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8507, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "FreeBSD 12.1-RELEASE-p2", + "vmwVmMemSize": 4096, + "vmwVmCpus": 4, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8508, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Windows Server 2019, 64-bit (Build 17763)", + "vmwVmMemSize": 8192, + "vmwVmCpus": 4, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8510, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 5.4.0-52-generic Ubuntu 20.04.1 LTS", + "vmwVmMemSize": 4096, + "vmwVmCpus": 4, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8511, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.19.4-amd64-vyos Debian GNU/Linux 8.11 (jessie)", + "vmwVmMemSize": 2048, + "vmwVmCpus": 4, + "vmwVmState": 1 + }, + { + "vm_type": "vmware", + "vmwVmVMID": 8512, + "vmwVmDisplayName": "", + "vmwVmGuestOS": "Linux 4.4.0-193-generic Ubuntu 16.04.7 LTS", + "vmwVmMemSize": 1024, + "vmwVmCpus": 1, + "vmwVmState": 1 + } + ] + }, + "poller": "matches discovery" } }