[Nagiosplug-help] How to use the mysql_check pulgin?

Robert bobb Crosbie bobb+nagiosplug-help at redbrick.dcu.ie
Tue Sep 17 10:13:04 CEST 2002


Marc Mertes hath declared on Tuesday the 10 day of September 2002  :-:
> Hi all!
> I try to use the check_mysql plugin, but I don´t really know how to define
> the command in the checkcommands.cfg file.
> Maybe it have to look like this? : 
> 
> # 'check_mysql' command definition
> define command{
> 	command_name	check_mysql
> 	command_line	$USER1$/check_mysql -H $HOSTADDRESS$ -P 3306
> 	}
> 
> If I try it in this way I get every time a Timout Issue.
> How does this plugin work or what parameters are needed?
> Does anybody have experience with this plugin and can help me?

Hi,
Sorry if I'm a bit late, I'm somewhat behind on lists...

You need to create a database on the mysql server with permissions
for a particular user on your nagios machine to access it.

mysql -p mysql
Enter password:

create database nagios;
grant select on nagios.* to nagios at 192.168.1.1 identified by 'SomePass';
flush privileges;

You can then test this on the command line...

./check_mysql -d nagios -H 192.168.1.6 -P 3306 -u nagios -p SomePass
Uptime: 448955  Threads: 2  Questions: 99446  Slow queries: 0  Opens: 1872
Flush tables: 1  Open tables: 59 Queries per second avg: 0.222

If this gives you a timeout, you may have a firewall or something in 
the way.


I'm just checking 2 mysql servers, and I have the same database / username / 
password on them so I just use a generic check command which specifies
them, you could use the $ARG1$ things if you wish.

define command {
	command_name	check_mysql
	command_line	$USER1$/check_mysql -d nagios -H $HOSTADDRESS$ -u nagios -p SomePassword
}


HTH,

- bobb









More information about the Help mailing list