I have been trying out PRTG for a little bit now, and I think this product will be good for us, but we need to get MySQL sensors working to decide on if we purchase.

I need to monitor MySql slave status on a few different servers running ubuntu with ZFS. Keep in mind i am not the Linux admin here, but do have an account to run queries on the DB.

I have found an older post with a script doing many things, but couldn't get it working. All i need to know how many seconds behind the slave is, whether it's zero seconds behind or any other value.

We currently run a batch file from a windows box with the following C:\mysql\bin\mysqlsh -h server01 --sql -uxxxxxxx -pzzzzzzz -e "show slave status\G".

Could this be run from the MySql v2 sensor? What other options would i need when setting up sensor.

Thanks for the help!

-Evan


Article Comments

Hi EA,

The shell just connects to your MySQL database and executes the command show slave status. The SQLv2 Sensors send SQL queries to the target database, only numerical values are accepted by the sensor. So if you write your own SQL script file with SQl query, this could be integrated via this sensor. Here is a link to the Configuration Guide for SQLv2 sensors

Here is a link to a page with a lot of SQL examples.

If a string is returned by the query, you need to translate it into an integer, as described in this article with CASE conditions.


Kind regards,
Felix Saure, Tech Support Team


Jun, 2019 - Permalink