[Nagiosplug-help] Unable to configure check_mysqld.pl

Holger Weiss holger at CIS.FU-Berlin.DE
Thu Aug 30 18:30:15 CEST 2007


[ Please don't post the same message to both nagios-users@ and
  nagiosplug-help at . ]

* Bijit Bhattacharjee <tu.bijit at gmail.com> [2007-08-30 17:51]:
> I have installed nagios-2.9 and nagios-plugins-1.4.9 on a RHEL 5 system. 
> For monitoring MySql, I downloaded check_mysqld.pl and i kept it under
> the directory /usr/local/nagios/libexec/
> 
> I modified the following parameters in check_mysqld.pl file to my need;
> my $HOSTNAME= 'localhost';
> my $PORT=     3306;
> my $DATABASE= 'test';
> my $USERNAME= 'username';
> my $PASSWORD= 'password';
> 
> After that, in the file commands.cfg
> 
> I added the command for mysqld as
> 
> define command{
>   command_name check_mysqld
>   command_line $USER1$/check_mysqld.pl -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$
> }
> 
> Then, in the file localhost.cfg, I added the service for mysqld as
> 
> define service {
>   use                     local-service
>   host_name               localhost
>   service_description     MYSQLD
>   check_command           check_mysqld
> }

I don't know check_mysqld.pl (I use check_mysql from the official
plugins distribution), but you referenced $ARG1$ and $ARG2$ within the
command definition without specifying arguments within the service
definition.  I guess check_mysqld.pl's "-u" and "-p" flags specify the
username and password.  Basically, you have three options:

1) If you hardcoded both username and password into check_mysqld.pl, you
   could simply remove "-u $ARG1$ -p $ARG2$" from the command_line
   definition.

2) If you'd like to specify them within the service definition, see

	http://nagios.sf.net/docs/2_0/macros.html

   on how check_command arguments are specified.

3) Another option would be to put them into your resource_file and
   reference them using the $USERn$ macros:

	http://nagios.sf.net/docs/2_0/configmain.html#resource_file

> The services section shows MYSQLD is critical.

If this doesn't solve your problem, please also post the plugin output.

Holger




More information about the Help mailing list