Page 3 of 3
Re: No Outbound Check Transfer...
Posted: Mon Jul 09, 2012 8:53 am
by mroter
Thanks - the fix is working.
Can you give me an example of the ocsp command using NRPE (e.g. send_nrpe.sh)?
Re: No Outbound Check Transfer...
Posted: Mon Jul 09, 2012 10:50 am
by scottwilkerson
The master Nagios machine must use OCSP and OCHP in order to send the proper updates to
the central server.
The default nagios.cfg has these settings.
Code: Select all
obsess_over_services=0
#ocsp_command=somecommand
obsess_over_hosts=0
#ochp_command=somecommand
Change the nagios.cfg settings to those below. The timeout prevents your Nagios server from spending too much time
on one command.
Code: Select all
obsess_over_services=1
ocsp_command=service_check
ocsp_timeout=5
obsess_over_hosts=1
ochp_command=host_check
ochp_timeout=5
You will need to create two scripts in the /usr/local/nagios/libexec/eventhandlers directory replacing <SERVER_TO_SEND_TO>.
service_check
Code: Select all
#!/bin/bash
# Service Check
cmd="/usr/local/nrdp/clients/send_nrdp.sh"
host=$1
srv=$2
result=$3
output=$4
/bin/echo -e "$host\t$srv\t$result\t$output\n" | $cmd -u <URL of the NRDP server> -t <shared token>
host_check
Code: Select all
#!/bin/bash
# Host Check
cmd="/usr/local/nrdp/clients/send_nrdp.sh"
host=$1
result=$2
output=$3
/bin/echo -e "$host\t$result\t$output\n" | $cmd -u <URL of the NRDP server> -t <shared token>
Then add 2 commands under Configure -> CCM -> Commands:
Code: Select all
command=service_check
command line*=$USER1$/eventhandlers/service_check $HOSTNAME$ '$SERVICEDESC$' $SERVICESTATEID$ '$SERVICEOUTPUT$'
Command type=misc command
Code: Select all
command=host_check
command line*=$USER1$/eventhandlers/host_check $HOSTNAME$ $HOSTSTATEID$ '$HOSTOUTPUT$'
Command type=misc command
Re: No Outbound Check Transfer...
Posted: Tue Jul 10, 2012 3:04 am
by mroter
Thank you very much for your great support
Regarding:
I think the use of -H is wrong. it should be:
Code: Select all
$cmd -u <URL of the NRDP server> -t <shared token>
Is the use of pipe (STDIN) better than the use of the explicit parameters -H -s -S -o ?
Do I need to set the "Obsess over host"/"Obsess over service" to "on" on the required hosts/services?
Re: No Outbound Check Transfer...
Posted: Tue Jul 10, 2012 9:48 am
by scottwilkerson
You are correct. I was modifying this from some old docs I had that use NSCA. I'm going to modify my previous post to reflect the correct setup.
Re: No Outbound Check Transfer...
Posted: Tue Jul 10, 2012 11:39 am
by mroter
Can you please answer my 2 questions from the last post?
Two other corrections (if I may):
1. The path to the cmd is /clients/ and not /client/
2. The service_check is working perfectly but the host_check returens the following as if the $SERVICESTATEID$ and '$SERVICEOUTPUT$' are undefined
Code: Select all
host_check SNG-VC $SERVICESTATEID$ '$SERVICEOUTPUT$'
Re: No Outbound Check Transfer...
Posted: Tue Jul 10, 2012 1:15 pm
by scottwilkerson
mroter wrote:Is the use of pipe (STDIN) better than the use of the explicit parameters -H -s -S -o ?
It doesn't matter either way.
mroter wrote:Do I need to set the "Obsess over host"/"Obsess over service" to "on" on the required hosts/services?
It should use the defaults from the nagios.cfg if you haven't specifically set it per host/service, so the answer would be no.
mroter wrote:The service_check is working perfectly but the host_check returens the following as if the $SERVICESTATEID$ and '$SERVICEOUTPUT$' are undefined
Boy, I am starting to think I didn't put enough time in that first post, too much copy/pasting...
The host check should be like this
Code: Select all
command=host_check
command line*=$USER1$/eventhandlers/host_check $HOSTNAME$ $HOSTSTATEID$ '$HOSTOUTPUT$'
Command type=misc command
mroter wrote:The path to the cmd is /clients/ and not /client/
Thanks again...
Re: No Outbound Check Transfer...
Posted: Tue Jul 10, 2012 2:02 pm
by mroter
Where is the default in nagios.cfg ? I want to obsess only the services with no perfdata otherwise i might get duplicate reporting.
One from perfproc and one from obsess.
Re: No Outbound Check Transfer...
Posted: Tue Jul 10, 2012 3:15 pm
by scottwilkerson
The defaults are being set when you issue
Code: Select all
obsess_over_services=1
obsess_over_hosts=1
So you could set the obsess over service to no in your templates, and then override with yes on the specific services.