No Outbound Check Transfer...

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
mroter
Posts: 80
Joined: Sun Apr 29, 2012 12:43 pm

Re: No Outbound Check Transfer...

Post by mroter »

Thanks - the fix is working.
Can you give me an example of the ocsp command using NRPE (e.g. send_nrpe.sh)?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: No Outbound Check Transfer...

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mroter
Posts: 80
Joined: Sun Apr 29, 2012 12:43 pm

Re: No Outbound Check Transfer...

Post by mroter »

Thank you very much for your great support :D

Regarding:

Code: Select all

$cmd -H <SERVER_TO_SEND_TO>
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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: No Outbound Check Transfer...

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mroter
Posts: 80
Joined: Sun Apr 29, 2012 12:43 pm

Re: No Outbound Check Transfer...

Post 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$'
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: No Outbound Check Transfer...

Post 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... :oops:
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...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mroter
Posts: 80
Joined: Sun Apr 29, 2012 12:43 pm

Re: No Outbound Check Transfer...

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: No Outbound Check Transfer...

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked