From: John Wolfe Date: Wed, 19 Aug 2020 17:01:16 +0000 (-0700) Subject: serviceDiscovery: Updating 'get-versions.sh' script X-Git-Tag: stable-11.1.5~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=193d1bc967a23d2770ee60d15ecec557103c7d47;p=thirdparty%2Fopen-vm-tools.git serviceDiscovery: Updating 'get-versions.sh' script The following changes have been made: 1. Environment variable 'ALIVE_BASE' is used to construct the path of the file where vcops version is stored. The variable is not available when running the script inside serviceDiscovery plugin process, so a hardcoded path is used. 2. Added command to retrieve tcserver version --- diff --git a/open-vm-tools/services/plugins/serviceDiscovery/get-versions.sh b/open-vm-tools/services/plugins/serviceDiscovery/get-versions.sh index 496c95eb6..b74d17153 100644 --- a/open-vm-tools/services/plugins/serviceDiscovery/get-versions.sh +++ b/open-vm-tools/services/plugins/serviceDiscovery/get-versions.sh @@ -23,7 +23,7 @@ get_version() { } get_vcops_version() { - cat $ALIVE_BASE/user/conf/lastbuildversion.txt 2>/dev/null + cat /usr/lib/vmware-vcops/user/conf/lastbuildversion.txt 2>/dev/null } get_srm_mgt_server_version() { @@ -76,10 +76,15 @@ get_db2_version() { db2level 2>/dev/null | grep "DB2 v" } +get_tcserver_version() { + command -v tcserver >/dev/null 2>&1 && { tcserver version 2>/dev/null; } +} + echo VERSIONSTART "vcops_version" "$(get_vcops_version)" VERSIONEND echo VERSIONSTART "srm_mgt_server_version" "$(get_srm_mgt_server_version)" VERSIONEND echo VERSIONSTART "vcenter_appliance_version" "$(get_vcenter_appliance_version)" VERSIONEND echo VERSIONSTART "db2_version" "$(get_db2_version)" VERSIONEND +echo VERSIONSTART "tcserver_version" "$(get_tcserver_version)" VERSIONEND get_version "/\S+/(httpd-prefork|httpd|httpd2-prefork)($|\s)" -v get_version "/usr/(bin|sbin)/apache\S*" -v