Page 1 of 1

check_forigate_status help

Posted: Thu Jan 21, 2016 10:04 am
by batchen
Hello,

im using :
Nagios Core 4.1.1
on CentOS release 6.7 VM .


i have downloaded this external plugin :
https://exchange.nagios.org/directory/P ... us/details

and add it to my /usr/lib64/nagios/plugins/
i have made a test throw the CLI by the directions :

root@localhost: ~#/usr/lib64/nagios/plugins/check_fortigate_status -H 172.10.170.99 -m cpu -C public -M 1 -w 80% -c 90%
FortiGate-100D: OK, CPU Usage: 23%| CPU Usage=23%;80%;90%


but when i set it in the commend.cfg and switch.cfg it fives an error :

commend.cfg set :
#check FortiCPU
define command{
command_name CPU
command_line /usr/lib64/nagios/plugins/check_fortigate_status -H '$HOSTADDRESS$' -m cpu -C public -M 1 -w 80% -c 90%
}


and then i ran : /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg and its error free.

but after i set it on switch.cfg :
#define service{
# use generic-service ; Inherit values from a template
# host_name Fortigate100D
# service_description CPU
# check_command check_fortigate_status
# }


it shows :
Error: Service check command 'check_fortigate_status' specified in service 'CPU' for host 'Fortigate100D' not defined anywhere

i know im doing somthing worng at switch.cfg please help.

Re: check_forigate_status help

Posted: Thu Jan 21, 2016 10:14 am
by rkennedy
You will also need to define a host

Code: Select all

define host {
        host_name                       Fortigate100D
        alias                           Fortigate100D
        address                         ipofyourfortigate
        register                        1
        }
Also, the command name needs to be changed to what you mentioned in your service definition.

Code: Select all

#check FortiCPU
define command{
command_name check_fortigate_status
command_line /usr/lib64/nagios/plugins/check_fortigate_status -H '$HOSTADDRESS$' -m cpu -C public -M 1 -w 80% -c 90%
}
Then restart the nagios service, and it should be working.

Re: check_forigate_status help

Posted: Thu Jan 21, 2016 10:21 am
by batchen
THANKS!
it was what you said about :
Also, the command name needs to be changed to what you mentioned in your service definition.
CODE: SELECT ALL
#check FortiCPU
define command{
command_name check_fortigate_status
command_line /usr/lib64/nagios/plugins/check_fortigate_status -H '$HOSTADDRESS$' -m cpu -C public -M 1 -w 80% -c 90%
}
WORKS!

Re: check_forigate_status help

Posted: Thu Jan 21, 2016 10:36 am
by bwallace
Glad we were able to help. We'll lock this thread now and feel free to open another should you require assistance with anything else.