Properly escaping check_command in nagios

Posted by shadyabhi on Server Fault See other posts from Server Fault or by shadyabhi
Published on 2012-10-15T16:22:29Z Indexed on 2012/10/15 21:40 UTC
Read the original article Hit count: 176

Filed under:
|
|

When I execute

sudo -u nagios /usr/lib64/nagios/plugins/check_by_ssh.sh hostname "check_haproxy -u \"http://localhost:10000/haproxy?stats\;csv\""

it runs perfectly on the server.

For this, I have this in my HAProxy.cfg

define service {
        use     generic-service
        hostgroup_name  pwmail-ee-oxweb
        service_description     HAProxy-ee
        servicegroups   ssh-dep
        check_command   check_by_ssh!check_haproxy -u \"http://localhost:10000/haproxy?stats\;csv\"
        contacts        sysad,mail-hosting-rt
}

It doesn't work. Says that Return code of 127 is out of bounds - plugin may be missing.

What am I doing wrong?

© Server Fault or respective owner

Related posts about monitoring

Related posts about nagios