From 4e0c3fd6790ff9e188e447249796f16a7e53c750 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Tue, 10 Apr 2012 14:58:06 +0000 Subject: [PATCH] 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 --- html/includes/print-vm.inc.php | 8 +++++++- includes/polling/os/vmware.inc.php | 11 ++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/html/includes/print-vm.inc.php b/html/includes/print-vm.inc.php index 16720aa46..3ecedd4e0 100644 --- a/html/includes/print-vm.inc.php +++ b/html/includes/print-vm.inc.php @@ -23,9 +23,15 @@ if ($vm['vmwVmGuestOS'] == "E: tools not installed") else if ($vm['vmwVmGuestOS'] == "") { echo('(Unknown)'); -} else { +} +elseif (isset($config['vmware_guestid'][$vm['vmwVmGuestOS']])) +{ echo('' . $config['vmware_guestid'][$vm['vmwVmGuestOS']] . ""); } +else +{ + echo('' . $vm['vmwVmGuestOS'] . ""); +} if ($vm['vmwVmMemSize'] >= 1024) { diff --git a/includes/polling/os/vmware.inc.php b/includes/polling/os/vmware.inc.php index 4c573dd73..fe2dc43f8 100644 --- a/includes/polling/os/vmware.inc.php +++ b/includes/polling/os/vmware.inc.php @@ -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)