Files

37 lines
1.4 KiB
PHP
Raw Permalink Normal View History

2011-03-26 17:16:09 +00:00
<?php
2020-09-21 15:40:17 +02:00
echo '<tr class="list">';
echo '<td class="list">';
if (getidbyname($vm['vmwVmDisplayName'])) {
echo generate_device_link(device_by_name($vm['vmwVmDisplayName']));
2016-08-18 20:28:22 -05:00
} else {
echo $vm['vmwVmDisplayName'];
}
echo '</td>';
2016-01-02 01:32:43 +01:00
if ($vm['vmwVmState'] == 'powered off' || $vm['vmwVmState'] == 'Shut off') {
2016-01-02 02:06:19 +01:00
echo '<td class="list"><span style="min-width:40px; display:inline-block;" class="label label-default">OFF</span></td>';
} elseif ($vm['vmwVmState'] == 'powered on' || $vm['vmwVmState'] == 'Running') {
2016-01-02 02:06:19 +01:00
echo '<td class="list"><span style="min-width:40px; display:inline-block;" class="label label-success">ON</span></td>';
} elseif ($vm['vmwVmState'] == 'suspended' || $vm['vmwVmState'] == 'Paused') {
2020-01-17 11:16:14 -06:00
echo '<td class="list"><span style="min-width:40px; display:inline-block;" class="label label-warning">SUSPEND</span></td>';
2016-01-02 01:32:43 +01:00
}
2011-03-26 17:16:09 +00:00
if ($vm['vmwVmGuestOS'] == 'E: tools not installed') {
echo '<td class="box-desc">Unknown (VMware Tools not installed)</td>';
2016-08-18 20:28:22 -05:00
} elseif ($vm['vmwVmGuestOS'] == '') {
echo '<td class="box-desc"><i>(Unknown)</i></td>';
2016-08-18 20:28:22 -05:00
} else {
2019-06-14 22:27:14 -05:00
echo '<td class="list">' . \LibreNMS\Util\Rewrite::vmwareGuest($vm['vmwVmGuestOS']) . '</td>';
}
2011-03-26 17:16:09 +00:00
if ($vm['vmwVmMemSize'] >= 1024) {
2020-09-21 15:40:17 +02:00
echo '<td class=list>' . sprintf('%.2f', ($vm['vmwVmMemSize'] / 1024)) . ' GB</td>';
2016-08-18 20:28:22 -05:00
} else {
2020-09-21 15:40:17 +02:00
echo '<td class=list>' . sprintf('%.2f', $vm['vmwVmMemSize']) . ' MB</td>';
2011-03-26 17:16:09 +00:00
}
2020-09-21 15:40:17 +02:00
echo '<td class="list">' . $vm['vmwVmCpus'] . ' CPU</td>';