Page 2 of 2

Re: Passive checks incorrectly/partially processed and PENDI

Posted: Tue Feb 13, 2018 3:58 am
by JoostICM
I installed a new server with NAGIOS Core while following the quickstart guide. The first passive check I ran registered correctly although my submission method to the cmd file is identical to the older server, as is my service setup. I must have missed a dependency or a specific setting or something while installing the server and setting up NAGIOS Core as I didn't even change standard settings on the new server. On a standard installation I just created the host, created the check and fired at the cmd file to see the check change colour.

As it is easy for me to just backup system configuration, reinstall OS and go from there I'll do that instead of trying to find and solve the problem by examining the system.

Thanks for your support!

BR, Joost

Re: Passive checks incorrectly/partially processed and PENDI

Posted: Tue Feb 13, 2018 9:16 am
by JoostICM
I partied too soon.

New server installed. Passive checks again not working so compared the previous setup with the current one.

During testing I found something.
- if I write to the cmd file with an append operator (>>) it doesn't work
- if I write to the cmd file with an overwrite operator (>) it works

I've tested this by adapting the submission script to overwrite rather than append on the cmd file. This solved the problem. Overwrite instead of append.....

So to be complete, hereby the adapted submission script:

Code: Select all


#!/bin/sh

# Write a command to the Nagios command file to cause
# it to process a service check result

echocmd="/bin/echo"

CommandFile="/usr/local/nagios/var/rw/nagios.cmd"

# get the current date/time in seconds since UNIX epoch
datetime=`date +%s`

# create the command line to add to the command file
cmdline="[$datetime] PROCESS_SERVICE_CHECK_RESULT;$1;$2;$3;$4"

# append the command to the end of the command file
`$echocmd $cmdline > $CommandFile`
The last line in the script was the issue before changing it.

BR, Joost

Re: Passive checks incorrectly/partially processed and PENDI

Posted: Tue Feb 13, 2018 3:51 pm
by npolovenko
@JoostICM, Interesting, thanks for sharing the solution with us.
I suppose your problem is resolved now so it's ok to lock the topic?