Page 1 of 1

Check_command define is not working

Posted: Thu Dec 20, 2018 9:32 am
by vinothkumar
I have the nagios plugin for AWS ALB unhealthy host check, I have checked this plugin manually it works, but once we define this plugin in check_commands and passing the parameter. it wont respond.
the command looks like
./alb_unhealthyCheck.py --targetgroup <targetgroup-name> --loadbalancer <loadbalancer-name> --period 300 --statistics Average --unit Count --ok_threshold 0 --critical_threshold 0

for this above plugin can anyone tell me how to define this in check_commands.cfg or misccommands.cfg file.

Re: Check_command define is not working

Posted: Fri Dec 21, 2018 4:01 pm
by ssax
This should work:

Code: Select all

define command {
    command_name    check-alb-unhealthy
    command_line    $USER1$/alb_unhealthyCheck.py --targetgroup '$ARG1$' --loadbalancer '$ARG2$' --period $ARG3$ --statistics $ARG4$ --unit $ARG5$ --ok_threshold $ARG6$ --critical_threshold $ARG7$
}

define service {
    host_name              YOURHOST
    service_description    Your Service
    check_command          check-alb-unhealthy!TARGETGROUPNAME!LOADBALANCERNAME!Average!300!Count!0!0
    ...
    ...
}