Announcement

Announcement Module
Collapse
No announcement yet.

Nagios: How to write properly the service command?

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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:
    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

  • #2
    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

    Comment


    • #3
      Thanks, found it myself, it works like a charm!

      Comment

      Working...
      X