Nagios: How to write properly the service command?

Hi there,

I’ve downloaded Percona’s Nagios monitoring tools and started setting them up, but I have some problem with one of the checks (the only one I’ve tried so far).
I have this command in /etc/nagios/commands.cfg:

define command{
command_name check-mysql-connections
command_line $USER1$/pmp-check-mysql-status -l $USER3$ -p $USER4$ -H $HOSTADDRESS$ -x Threads_connected -o / -y max_connections -T pct -w 80 -c 95
}

This is the service check I’ve built in reference:

define service{
servicegroups Database Functionality
host_name server.hostname
service_description MySQL check status
check_command check-mysql-connections!nagios!nagios-passwd!IPADDRESS!Threads_connected!/!max_connections!pct!80!95! #(tried with “!” and without).
use generic-service
}

In both cases, the notification in Nagios looks like this: [TABLE=“class: status”]
[TR]
[TD=“class: statusBGUNKNOWN, bgcolor: #E2ABDC”] [TABLE]
[TR]
[TD=“align: left”] [TABLE]
[TR]
[TD=“class: statusBGUNKNOWN, align: left”]MySQL check status[/TD]
[/TR]
[/TABLE]
[/TD]
[TD=“class: statusBGUNKNOWN”] [TABLE]
[TR]
[TD=“align: center”][/TD]
[/TR]
[/TABLE]
[/TD]
[/TR]
[/TABLE]
[/TD]
[TD=“class: statusUNKNOWN, bgcolor: #BF44B2”]UNKNOWN[/TD]
[TD=“class: statusBGUNKNOWN, bgcolor: #E2ABDC”]06-26-2014 11:14:56[/TD]
[TD=“class: statusBGUNKNOWN, bgcolor: #E2ABDC”]0d 0h 29m 59s[/TD]
[TD=“class: statusBGUNKNOWN, bgcolor: #E2ABDC”]4/4[/TD]
[TD=“class: statusBGUNKNOWN, bgcolor: #E2ABDC, align: center”]Error: -o must be one of: / * + -. Try --help. [/TD]
[/TR]
[/TABLE]

What am I doing wrong?

Thanks alot

Itai

Your don’t need “!nagios!nagios-passwd!IPADDRESS!Threads_connected!/!max_connections!pct!80!95! #(tried with “!” and without).”
The way you have written this, it’s the arguments to check-mysql-connections command but the actual command has no $ARG1$, $ARG2$ etc. vars.

Change
check_command check-mysql-connections!nagios!nagios-passwd!IPADDRESS!Threads_connected!/!max_connections!pct!80!95! #(tried with “!” and without).
to
check_command check-mysql-connections

Thanks, found it myself, it works like a charm!