mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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'];
|
||||
|
||||
Reference in New Issue
Block a user