Check_command define is not working

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
vinothkumar
Posts: 1
Joined: Thu Dec 20, 2018 9:26 am

Check_command define is not working

Post 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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Check_command define is not working

Post 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
    ...
    ...
}
Locked