allow VMWare freeform OS description and survive VM sleep OS switches, patch by Sander Steffann, fixes OBSERVIUM-22

git-svn-id: http://www.observium.org/svn/observer/trunk@3017 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2012-04-10 14:58:06 +00:00
parent bb7d1e4263
commit 4e0c3fd679
2 changed files with 17 additions and 2 deletions

View File

@@ -23,9 +23,15 @@ if ($vm['vmwVmGuestOS'] == "E: tools not installed")
else if ($vm['vmwVmGuestOS'] == "") else if ($vm['vmwVmGuestOS'] == "")
{ {
echo('<td class="box-desc"><i>(Unknown)</i></td>'); echo('<td class="box-desc"><i>(Unknown)</i></td>');
} else { }
elseif (isset($config['vmware_guestid'][$vm['vmwVmGuestOS']]))
{
echo('<td class="list">' . $config['vmware_guestid'][$vm['vmwVmGuestOS']] . "</td>"); echo('<td class="list">' . $config['vmware_guestid'][$vm['vmwVmGuestOS']] . "</td>");
} }
else
{
echo('<td class="list">' . $vm['vmwVmGuestOS'] . "</td>");
}
if ($vm['vmwVmMemSize'] >= 1024) if ($vm['vmwVmMemSize'] >= 1024)
{ {

View File

@@ -59,7 +59,16 @@ foreach ($db_info_list as $db_info)
} }
/* /*
* Proceess all the VMware Virtual Machine properties. * If VMware Tools is not running then don't overwrite the GuesOS with the error
* message, but just leave it as it currently is.
*/
if (stristr($vm_info["vmwVmGuestOS"], 'tools not running') !== FALSE)
{
$vm_info["vmwVmGuestOS"] = $db_info["vmwVmGuestOS"];
}
/*
* Process all the VMware Virtual Machine properties.
*/ */
foreach ($vm_info as $property => $value) foreach ($vm_info as $property => $value)