Passive Service check not functioning as expected

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
markmerchant
Posts: 65
Joined: Tue Oct 17, 2017 8:38 am

Passive Service check not functioning as expected

Post by markmerchant »

I would like to create a service check that I can fail any time to test end-to-end
alerting. Seems like a passive check would be perfect, but not functioning as I
expect. Once setup, a simple command line would be enough to trigger an alert,
but getting inconsistent results. I would like to be able to set the service as
up/down at any time.

Code: Select all

version
    Nagios XI 5.4.10
    Linux cvglpnagios01.xx.xxx 3.10.0-693.11.1.el7.x86_64 #1 SMP Fri Oct 27 05:39:05 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux
    
/app/nagios/etc/hosts/em-test-host.cfg
	define host {
		host_name                       em-test-host
		use                             xiwizard_passive_host
		alias                           A host for testing alerts
		display_name                    em-test-host
		address                         em-test-host
		max_check_attempts              1
		check_interval                  5
		retry_interval                  0
		active_checks_enabled           0
		passive_checks_enabled          1
		check_period                    xi_timeperiod_24x7
		contacts                        servicenow-soap
		notification_interval           60
		notification_period             xi_timeperiod_24x7
		_xiwizard                       passivecheck
		register                        1
		}

/app/nagios/etc/services/em-test-host.cfg
	define service {
		host_name                       em-test-host
		service_description             em-test-service
		use                             xiwizard_passive_service
		display_name                    em-test-service
		max_check_attempts              1
		check_interval                  5
		retry_interval                  1
		active_checks_enabled           0
		passive_checks_enabled          1
		check_period                    xi_timeperiod_24x7
		notification_interval           5
		notification_period             xi_timeperiod_24x7
		notifications_enabled           1
		contacts                        servicenow-website-soap
		_xiwizard                       passivecheck
		register                        1
		}

command line
    echo "[$DATE] PROCESS_SERVICE_CHECK_RESULT;em-test-host;em-test-service;2;Service Down" >> "/usr/local/nagios/var/rw/nagios.cmd"
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Passive Service check not functioning as expected

Post by npolovenko »

Hello, @markmerchant. Does your passive check command not work at all or is it just inconsistent? Can you change the double >> sign to a single >?

https://old.nagios.org/developerinfo/ex ... and_id=114
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
markmerchant
Posts: 65
Joined: Tue Oct 17, 2017 8:38 am

Re: Passive Service check not functioning as expected

Post by markmerchant »

Mostly inconsistent, sometimes I can see it, sometimes not.

Code: Select all

tail -f ./nagios.cmd
[1519145243] PROCESS_SERVICE_CHECK_RESULT;em-test-host;em-test-service;2;Host/Service is Down.

Will try with the single quote.
markmerchant
Posts: 65
Joined: Tue Oct 17, 2017 8:38 am

Re: Passive Service check not functioning as expected

Post by markmerchant »

Changed the ">>" to ">" -- didn't seem to help. But, came in this morning and it was working. Go figure.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Passive Service check not functioning as expected

Post by lmiltchev »

I am glad your issue got resolved! Do you want us to keep this thread open for a while just in case the issue resurfaces? Otherwise, we can close this topic - you can always start a new thread if needed, and provide a URL to this one for reference. Let us know what do you prefer.

Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked