Convert Virtual Machine pages to Laravel (#12287)

* Convert Virtual Machine pages to Laravel

* wip

* wip

* wip

* wip

* wip

* wip

* delete

* wip

* wip

* move powerStateLabel
This commit is contained in:
Jellyfrog
2020-11-11 01:15:20 +01:00
committed by GitHub
parent ac5920f45c
commit cfd9dce620
24 changed files with 363 additions and 237 deletions

View File

@@ -2,6 +2,7 @@
use Illuminate\Support\Str;
use LibreNMS\Config;
use LibreNMS\Enum\PowerState;
// FIXME should do the deletion etc in a common file perhaps? like for the sensors
// Try to discover Libvirt Virtual Machines.
@@ -73,7 +74,7 @@ if (Config::get('enable_libvirt') && $device['os'] == 'linux') {
$vmwVmGuestOS = '';
// libvirt does not supply this
exec(Config::get('virsh') . ' -rc ' . $uri . ' domstate ' . $dom_id, $vm_state);
$vmwVmState = ucfirst($vm_state[0]);
$vmwVmState = PowerState::STATES[strtolower($vm_state[0])] ?? PowerState::UNKNOWN;
unset($vm_state);
$vmwVmCpus = $xml->vcpu['current'];