MySQL database is a widely used database in the open source community. AppDiagnos MySQL collects the performance counters through an agent. The MySQL monitor provides insights under different heads like queries, threads, Innodb along with key summary findings like bytes sent, bytes received, key reads and key writes to name a few.
The MySQL monitor works by gathering information from the status variables. The monitor requires installation of MySQL 5.0 or above, with proper connection string, user name and password. The monitor requires JRE 1.7 or above in addition to MySQL.
MySQL monitor Pre-Requisites:
Java Class Path is set.
To set the java class path:
Open bash profile using vi ~/.bash_profile command.
Set JAVA_HOME as follows
E.x. If your path is set to /usr/java/jdk1.5.0_07/bin/java,
Set it as follows: export JAVA_HOME=/usr/java/jdk1.5.0_07/bin/java
Set PATH as follows: export PATH=$PATH:/usr/java/jdk1.5.0_07/bin
Replace /usr/java/jdk1.5.0_07 as per your location of java folder
Save and close the file.
Steps to add MySQL Monitoring Agent in Linux Environment:
Open AppDiagnos APM Portal URL in a browser.
Start Up with valid credentials.
Click on OPS View tab.
Click on Database.
Click on the ( + ) Add button
In Add Window, Click on Database button.
In Add Database Window ,Enter Database Name, Description, Select Database Type and Version.
Click on SAVE button.
The Monitor Download Window will appear.
Click on the Monitor button to Download the Database Monitor Agent.
Go to linux terminal, where you want to install the agent. Untar the downloaded setup to a location. tar -xzmvf appdiagnos_mysql_agent_2.0.42.tar.gz
Open MYSQL.properties file, and enter the relevant password if needed.
Enter the following commands and hit enter.
cp $JAVA_HOME/jre/lib/security/cacerts cacerts_appdiagnos_agent
keytool -import -alias apm.appdiagnos.com -keystore cacerts_appdiagnos_agent -storepass changeit -file apm.appdiagnos.com.crt –noprompt
java-Djavax.net.ssl.trustStore=cacerts_appdiagnos_agent-Djavax.net.ssl.trustStorePassword=changeit-jarappdiagnos_mysql_agent_2.0.42.jar>logs/appdiagnos_mysql_agent_2.0.42_$(date +%Y-%m-%d_%H%M).log &
NOTE:- Ensure on successful Installation of MYSQL Agent , The Monitor Icon appears in green color in the APM portal.
Configure Metrics – MYSQL Monitor Agent
Locate the card that has the database name you want to configure, click the settings icon (configure metrics) on the left hand side.
In the Configure Metrics page, Select the Category.
Upon Category selection, Select/Edit the required Metrics to monitor as per need.
Click SAVE button.
On the respective Database Monitor Graph Page, the newly added metrics graph will appear.
By clicking Slow Query Radio Button, Slow query information will appear.