Not the answer you need?
Register and ask your own question!

Nagios: How to write properly the service command?

camelelcamelel EntrantInactive User Role Beginner
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:





MySQL check status





action.gif






UNKNOWN
06-26-2014 11:14:56
0d 0h 29m 59s
4/4
Error: -o must be one of: / * + -. Try --help.



What am I doing wrong?

Thanks alot

Itai

Comments

  • weberweber Advisor Inactive User Role Beginner
    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
  • camelelcamelel Entrant Inactive User Role Beginner
    Thanks, found it myself, it works like a charm!
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.