Archive for October, 2010

Determining the MySQL Enterprise Monitor (MEM) Version from the Command Line

Friday, October 1st, 2010

Surprisingly, obtaining the version of the MySQL Enterprise Monitor from the command line is not as obvious as one woud think. Generally, with most MySQL programs, you can use the –version option passed to the program to obtain this information (such as you can with the mysqld, the MEM agent, and MySQL proxy).

I realize this is not too common of a problem, but hopefully this will help someone out there.

There is a version.sh (Linux) and version.bat (Windows) included in /opt/mysql/enterprise/monitor/apache-tomcat/bin, which will output everything but the MEM version:

root@chris-linux:/opt/mysql/enterprise/monitor/apache-tomcat/bin# ./version.sh
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.

I’ve filed a feature request to hopefully get this added to version.sh and version.bat, or perhaps to simply get a version.txt file included.

But in the meantime, should you want/need this functionality, you can obtain it using any of the following commands:

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 of the above would output something similar to the following:

MySQL Enterprise Monitor (Version 2.1.0.1096 : build_1096)

Additionally, there’s a somewhat more complex alternative, which strictly shows the version number is this (and obtains it from the Dashboard as opposed to a file which you may or may not (or not want others to) 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

Period Panties by Period Panteez Menstrual Underwear Menstruation PMS Panty