check_forigate_status help

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
batchen
Posts: 24
Joined: Tue Jan 19, 2016 10:04 am

check_forigate_status help

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_forigate_status help

Post 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.
Former Nagios Employee
batchen
Posts: 24
Joined: Tue Jan 19, 2016 10:04 am

Re: check_forigate_status help

Post 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!
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: check_forigate_status help

Post 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.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked