mysql_health_check


#1

I am trying to use this plugin, but I am having some troubles with it. It seems like its something so simple, but I have gone over it a million times, but cant find the issue. I hope a second set of eyes can find where I am going wrong.

This is a single server deal thats monitoring itself, localhost, only.

I am getting the following error in Nagios: (Return code of 127 is out of bounds - plugin may be missing)

Simple enough, right? I wish.

The file it calls is mysql_health_check.pl and it is located in /usr/local/nagios/libexec

resource.cfg

localhost.cfg

define service { use generic-service host_name localhost service_description MySQL Locked Query is_volatile 0 check_period 24x7 max_check_attempts 2 normal_check_interval 1 retry_check_interval 1 contact_groups admins notification_interval 120 notification_period 24x7 notification_options w,u,c,r,f check_command check_mysql_lock_query!30!60 }

commands.cfg

define command{ command_name check_mysql_lock_query command_line $USER1$/mysql_health_check.pl --hostname localhost --port 3306 --user root --password xxxxxxxxx --mode=locked-query --warning=$ARG1$ --critical=$ARG2$ }

so if I run the following command in the libexec dir, it works fine and returns “mysql_locked-query OK”

So if the command itself works, and all the paths are correct, where am I going wrong? any suggestions?


#2

I got it to work finally. I had to put the absolute path of my perl bin in there like this.

define command{ command_name check_mysql_lock_query command_line /usr/bin/perl /usr/local/nagios/libexec/mysql_health_check.pl --hostname localhost --port 3306 --user root --password xxxxxxxxx --mode=locked-query --warning=$ARG1$ --critical=$ARG2$ }