No Outbound Check Transfer...
Re: No Outbound Check Transfer...
Thanks - the fix is working.
Can you give me an example of the ocsp command using NRPE (e.g. send_nrpe.sh)?
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...
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.
Change the nagios.cfg settings to those below. The timeout prevents your Nagios server from spending too much time
on one command.
You will need to create two scripts in the /usr/local/nagios/libexec/eventhandlers directory replacing <SERVER_TO_SEND_TO>.
service_check
host_check
Then add 2 commands under Configure -> CCM -> Commands:
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=somecommandon 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=5service_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>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>Code: Select all
command=service_check
command line*=$USER1$/eventhandlers/service_check $HOSTNAME$ '$SERVICEDESC$' $SERVICESTATEID$ '$SERVICEOUTPUT$'
Command type=misc commandCode: Select all
command=host_check
command line*=$USER1$/eventhandlers/host_check $HOSTNAME$ $HOSTSTATEID$ '$HOSTOUTPUT$'
Command type=misc commandRe: No Outbound Check Transfer...
Thank you very much for your great support
Regarding:
I think the use of -H is wrong. it should be:
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?
Regarding:
Code: Select all
$cmd -H <SERVER_TO_SEND_TO>Code: Select all
$cmd -u <URL of the NRDP server> -t <shared token>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...
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...
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
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...
It doesn't matter either way.mroter wrote:Is the use of pipe (STDIN) better than the use of the explicit parameters -H -s -S -o ?
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:Do I need to set the "Obsess over host"/"Obsess over service" to "on" on the required hosts/services?
Boy, I am starting to think I didn't put enough time in that first post, too much copy/pasting...mroter wrote:The service_check is working perfectly but the host_check returens the following as if the $SERVICESTATEID$ and '$SERVICEOUTPUT$' are undefined
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 commandThanks again...mroter wrote:The path to the cmd is /clients/ and not /client/
Re: No Outbound Check Transfer...
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.
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...
The defaults are being set when you issue
So you could set the obsess over service to no in your templates, and then override with yes on the specific services.
Code: Select all
obsess_over_services=1
obsess_over_hosts=1