Page 1 of 1

MONITORING REMOTE MYSQL SERVER

Posted: Thu Sep 11, 2014 8:56 am
by rquaresma
Hello,

I want to connect on a remote mysql server and check in a specific table the value of register, any one can indicate a plugin to do it?

example:

I will connect from nagios server in other mysql server using the plugin and it will check by query the value of register in the table and will return the result.

Tks!

sorry for the english.

Re: MONITORING REMOTE MYSQL SERVER

Posted: Thu Sep 11, 2014 9:56 am
by slansing
It's fine, I think we have the jist of what you want to do, however your example sounds the same as what you are asking for. I would highly suggest taking a look at the exchange and searching for a plugin which will run queries for you:

http://exchange.nagios.org/

http://exchange.nagios.org/index.php?op ... ql%20query

Something like this perhaps:

http://exchange.nagios.org/directory/Pl ... 29/details

Re: MONITORING REMOTE MYSQL SERVER

Posted: Thu Sep 11, 2014 10:17 am
by rquaresma
Thanks slansing , i will take a look at the links that you sended..
thanks..

Re: MONITORING REMOTE MYSQL SERVER

Posted: Thu Sep 11, 2014 10:33 am
by slansing
Great, let me know if you need help.

Re: MONITORING REMOTE MYSQL SERVER

Posted: Thu Sep 18, 2014 3:04 pm
by rquaresma
Hi slansing,

I am using the plugin check_mysqlhealth, i did the conifguration to check mysql connection time and its working fine, but i have a dubt at the how can i make a query using this plugin...

i have a remoe my sql server, and i watn to verify a database called teste, and the table name is test too and when the value of table is 1 is returns ok if the value is diferent its returns warnning.

in the site of plugin i have the fallow exemple :

nagios$ echo 'select 111 from dual' |
check_mysql_health --mode encode
select%20111%20from%20dual

nagios$ check_mysql_health --mode sql
--name select%20111%20from%20dual
CRITICAL - select 111 from dual: 111 | 'select 111 from dual'=111;1;5

and the exlain of this function of plugin :

sql Result of any SQL-Statement that returns a number. The statement itself is passed over with the parameter –name. A Label for the performance data output can be passed over with the parameter –name2. The parameter –units can add units to the output (%, c, s, MB, GB,..). If the SQL-Statement includeds special characters or spaces, it can first be encoded with the mode encode.

i hope that i was clear about my doubt...

tks

Re: MONITORING REMOTE MYSQL SERVER

Posted: Thu Sep 18, 2014 5:07 pm
by Nagios Support
We will do some digging on the issue and will get back to you within the next 24 hours.

Re: MONITORING REMOTE MYSQL SERVER

Posted: Fri Sep 19, 2014 12:58 pm
by lmiltchev
The correct syntax would be "SELECT COUNT(*) FROM sometable", for example:

Code: Select all

[root@testbox libexec]# /usr/local/nagios/libexec/check_mysql_health --hostname=localhost --port=3306 --username=root --password="nagiosxi" --database=nagios --mode sql --name=SELECT%20COUNT%28%2A%29%20FROM%20nagios_contacts --name2="Test Query" --warning=5 --critical=10
OK - test query: 3 | 'test query'=3;5;10

Re: MONITORING REMOTE MYSQL SERVER

Posted: Thu Sep 25, 2014 8:25 am
by rquaresma
thanks guys,

I will try it..

have you seen this plugin: check_mysql_all ?

Re: MONITORING REMOTE MYSQL SERVER

Posted: Thu Sep 25, 2014 9:34 am
by slansing
Are you talking about this out?:

https://code.google.com/p/check-mysql-all/

If you could link the plugin you are talking about that would be a lot easier. Do you have a specific question about it?