Bug #57084 Be able to determine MEM Monitor Version from Command line (or version.sh/bat)
Submitted: 29 Sep 2010 0:44 Modified: 9 Jan 2015 10:24
Reporter: Chris Calender Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor Severity:S4 (Feature request)
Version: OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: monitor version, version.bat, version.sh

[29 Sep 2010 0:44] Chris Calender
Description:
It would be nice if it were easy to obtain the version of the MySQL Enterprise Monitor from the command line, especially using the already included version.sh / version.bat.

There are a couple of work-arounds, but again, they are not intuitve and have their own drawbacks.  Further, we can obtain the version for most all other MySQL products from the command line so this, I feel, would make a nice addition.

How to repeat:
For the Enterprise Monitor, there are version.sh (Linux) and version.bat (Win) scripts that determine many versions related to MEM, all except the actual version of MEM.  So I think adding it there would be nice.

Here is the current output of version.sh:

root@chris-linux:/opt/mysql/enterprise/monitor/apache-tomcat/bin# ./version.sh --help
Using CATALINA_BASE:   /opt/mysql/enterprise/monitor/apache-tomcat
Using CATALINA_HOME:   /opt/mysql/enterprise/monitor/apache-tomcat
Using CATALINA_TMPDIR: /opt/mysql/enterprise/monitor/apache-tomcat/temp
Using JRE_HOME:       /opt/mysql/enterprise/monitor/java
Server version: Apache Tomcat/6.0.14
Server built:   Jul 20 2007 04:17:30
Server number:  6.0.14.0
OS Name:        Linux
OS Version:     2.6.24-25-generic
Architecture:   amd64
JVM Version:    1.6.0_13-b03
JVM Vendor:     Sun Microsystems Inc.

For anyone interested, the work-arounds are these:

more /opt/mysql/enterprise/monitor/configuration_report.txt | grep Version
more /opt/mysql/enterprise/monitor/configuration_report.txt | grep -i version
cat /opt/mysql/enterprise/monitor/configuration_report.txt | grep Version
cat /opt/mysql/enterprise/monitor/configuration_report.txt | grep -i version

All 4 of the above would output something similar to the following:

MySQL Enterprise Monitor (Version 2.1.0.1096 : build_1096)

And there's a somewhat more complex alternative, which strictly shows the version number (and obtains it from the Dashboard as opposed to a file which you may or may not have permissions to view it):

WGET="wget -O FID http://localhost:18080"
$WGET 2>&1 > FID.log 2>&1
grep '<td id=\"footerInfo\">' FID | cut -f2 -d'>' | cut -f1 -d'<' | cut -c1-10

After the 3rd command, you'll get the following output:

2.1.0.1096

Suggested fix:
Add MEM Version to version.sh and version.bat.
[29 Sep 2010 16:24] Andy Bang
Another option (until we have a version.txt file) is:

http://hostname:port/main?command=list_versions

which will produce output like:

<?xml version="1.0" ?> 
- <doc>
- <tomcat>
- <![CDATA[ 6.0.14.0
  ]]> 
  </tomcat>
- <mysql>
- <![CDATA[ 5.1.48-enterprise-commercial-advanced
  ]]> 
  </mysql>
- <java>
- <![CDATA[ 1.6.0_13-b03
  ]]> 
  </java>
- <app>
- <![CDATA[ 2.3.0.2025
  ]]> 
  </app>
  </doc>
[29 Sep 2010 16:24] Andy Bang
Another option (until we have a version.txt file) is:

http://hostname:port/main?command=list_versions

which will produce output like:

<?xml version="1.0" ?> 
- <doc>
- <tomcat>
- <![CDATA[ 6.0.14.0
  ]]> 
  </tomcat>
- <mysql>
- <![CDATA[ 5.1.48-enterprise-commercial-advanced
  ]]> 
  </mysql>
- <java>
- <![CDATA[ 1.6.0_13-b03
  ]]> 
  </java>
- <app>
- <![CDATA[ 2.3.0.2025
  ]]> 
  </app>
  </doc>
[29 Sep 2010 16:30] Andy Bang
Another option (until we have a version.txt file) is:

http://hostname:port/main?command=list_versions

which will produce output like:

<?xml version="1.0" ?> 
- <doc>
- <tomcat>
- <![CDATA[ 6.0.14.0
  ]]> 
  </tomcat>
- <mysql>
- <![CDATA[ 5.1.48-enterprise-commercial-advanced
  ]]> 
  </mysql>
- <java>
- <![CDATA[ 1.6.0_13-b03
  ]]> 
  </java>
- <app>
- <![CDATA[ 2.3.0.2025
  ]]> 
  </app>
  </doc>
[22 Nov 2010 22:04] Enterprise Tools JIRA Robot
Andy Bang writes: 
We decided to simply create a version.txt file, world readable (not writable, or executable), in the top level directory.
[23 Nov 2010 16:25] Carsten Segieth
just a thought / an idea for this - do we want to keep the update history here, too? Perhaps it might be useful to know the all versions from where an update was made?
[29 Nov 2010 13:52] Enterprise Tools JIRA Robot
Andy Bang writes: 
In build 2.3.1.2044.
[29 Nov 2010 13:52] Enterprise Tools JIRA Robot
Carsten Segieth writes: 
OK in full and update install 2.3.1.2044; a file version.txt now shows e.g.:

MySQL Enterprise Monitor Version 2.3.1.2044
[21 Dec 2010 18:35] Enterprise Tools JIRA Robot
Marcos Palacios writes: 
In build 2.2.4.1761.
[21 Dec 2010 18:39] Enterprise Tools JIRA Robot
Marcos Palacios writes: 
Verified fixed in Monitor build 2.2.4.1761.

However, will re-open it for a needed change. See next comment.
[21 Dec 2010 18:41] Enterprise Tools JIRA Robot
Marcos Palacios writes: 
The update install does not copy the version.txt file from the previous installation when moving files to the <monitor>/backup folder.