Page 1 of 2

Send a notification only once

Posted: Thu Feb 01, 2018 5:08 pm
by tcjr2
Using Nagios XI. I have a service that I want to send one alert only. I have tried setting the notification interval to 0 (as suggested by a 2012 post) but it still sends an alert every 10 minutes. Any suggestions on how to make this happen? Thanks for any help -- Tom

Re: Send a notification only once

Posted: Thu Feb 01, 2018 5:31 pm
by dwhitfield
Do you have any escalations? Did you apply the configuration after setting it to 0? Please attach your objects.cache file which you can find with the command find / -name objects.cache. The likely location is /usr/local/nagios/var/objects.cache. You won't be able to PM it as this is your first post. If you'd like you can just post again saying "I'd like to PM" and then we can approve that and then you would be able to PM it.

UPDATE: objects.cache shared with techs

Re: Send a notification only once

Posted: Fri Feb 02, 2018 8:49 am
by tcjr2
There are no escalations

I did apply configuration after the change.

I'd like to PM so I can send the file. please approve. thanks -- tom

Re: Send a notification only once

Posted: Fri Feb 02, 2018 1:37 pm
by kyang
Is this the service you are talking about?

Code: Select all

    define service {

    	host_name	dmedap1001.jmlfdc.mil

    	service_description	TEST Check JMAR L Drive

    	display_name	TEST Check JMAR L Drive

    	check_period	24x7

    	check_command	check_nrpe_PRODUCTION!check_drivesize! -a drive=L: 'warning=free<90%' 'critical=free<85%'!!!!!!

    	contacts	xxxxx

    	notification_period	xxxx_notification_times

    	initial_state	o

    	importance	0

    	check_interval	10.000000

    	retry_interval	1.000000

    	max_check_attempts	1

    	is_volatile	1

    	parallelize_check	1

    	active_checks_enabled	1

    	passive_checks_enabled	1

    	obsess	1

    	event_handler_enabled	1

    	low_flap_threshold	0.000000

    	high_flap_threshold	0.000000

    	flap_detection_enabled	1

    	flap_detection_options	o,w,u,c

    	freshness_threshold	0

    	check_freshness	1

    	notification_options	r,w,u,c,f,s

    	notifications_enabled	1

    	notification_interval	0.000000

    	first_notification_delay	0.000000

    	stalking_options	n

    	process_perf_data	1

    	retain_status_information	1

    	retain_nonstatus_information	1

    	}
Could you also run the database repair script.

Code: Select all

cd /usr/local/nagiosxi/scripts/
./repair_databases.sh
Thanks.

Re: Send a notification only once

Posted: Fri Feb 02, 2018 1:40 pm
by tcjr2
Yes, that is the service. I'll have the DB repair script run shortly. I'll let you know once I run it. Thanks

Re: Send a notification only once

Posted: Fri Feb 02, 2018 2:25 pm
by tcjr2
repair script has been run and completed successfully. What would you like me to try next? The alert i still sending every 10 minutes. Should I resave the service config and apply config again? Thanks -- tc

Re: Send a notification only once

Posted: Fri Feb 02, 2018 2:49 pm
by kyang
Thanks!

Let's truncate some tables next.

Code: Select all

mysql -u ndoutils -pn@gweb nagiosxi -e 'TRUNCATE TABLE xi_meta'

mysql -u ndoutils -pn@gweb nagiosxi -e 'TRUNCATE TABLE xi_events'

mysql -u ndoutils -pn@gweb nagiosxi -e 'TRUNCATE TABLE xi_eventqueue
After that, you can repair the db again.

Code: Select all

cd /usr/local/nagiosxi/scripts/
./repair_databases.sh

Re: Send a notification only once

Posted: Tue Feb 13, 2018 9:19 am
by tcjr2
Just got back to this. We ran the truncate commands and the refresh and the service continues to send multiple notifications. What's next? Thanks -- Tom

Re: Send a notification only once

Posted: Tue Feb 13, 2018 2:41 pm
by kyang
Can you post or PM the output of this command. Thanks.

Code: Select all

ps -ef | head -1 && ps -ef | grep bin/nagios
If you see multiple nagios processes or not, please run kill the nagios process with these commands.

Code: Select all

service nagios stop
killall -9 nagios
service nagios start
Then let us know if notifications are correct.

Re: Send a notification only once

Posted: Tue Feb 13, 2018 4:40 pm
by tcjr2
Thanks very much for your help. I appreciate the timely responses.

We have resolved the problem and believe that the problem was caused by host/service/notification template inconsistencies. When we created a new service that did not use any templates with hosts and contacts that also did not use templates the single notification started working (i love this technical smoke and mirrors stuff :D )

Thanks again for your help -- Tom