Passive checks incorrectly/partially processed and PENDING

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Re: Passive checks incorrectly/partially processed and PENDI

Postby JoostICM » Tue Feb 13, 2018 3:58 am

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
JoostICM
 
Posts: 8
Joined: Fri Feb 02, 2018 10:33 am

Re: Passive checks incorrectly/partially processed and PENDI

Postby JoostICM » Tue Feb 13, 2018 9:16 am

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
JoostICM
 
Posts: 8
Joined: Fri Feb 02, 2018 10:33 am

Re: Passive checks incorrectly/partially processed and PENDI

Postby npolovenko » Tue Feb 13, 2018 3:51 pm

@JoostICM, Interesting, thanks for sharing the solution with us.
I suppose your problem is resolved now so it's ok to lock the topic?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
npolovenko
Support Tech
 
Posts: 1785
Joined: Mon May 15, 2017 5:00 pm

Previous

Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 24 guests