]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
serviceDiscovery: Updating 'get-versions.sh' script
authorJohn Wolfe <jwolfe@vmware.com>
Wed, 19 Aug 2020 17:01:16 +0000 (10:01 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Wed, 19 Aug 2020 17:01:16 +0000 (10:01 -0700)
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

open-vm-tools/services/plugins/serviceDiscovery/get-versions.sh

index 496c95eb61468179021ffb38e3fb1f5e22a913ea..b74d17153b44741eca60ef6772508cc97ebfa9df 100644 (file)
@@ -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