Page 2 of 2
Re: Service checks notifications swithcing back to enabled
Posted: Tue Jun 16, 2015 9:27 am
by lmiltchev
You can delete or modify the retention.dat, regardless of what it says on the top of the file, but you
must stop nagios prior to doing so. I would not recommend deleting it as this will set all of your checks to pending state, and you will lose the downtime and comment info. Read more about the retention.dat here:
http://nagios.sourceforge.net/docs/nagi ... ntion_file
You can however, remove/modify one entry (i.e. host/service config) - it should get recreate it after you start the nagios service. If you want to delete the file, you could run:
Code: Select all
service nagios stop
rm -f /usr/local/nagios/var/retention.dat
service nagios start
Re: Service checks notifications swithcing back to enabled
Posted: Tue Jun 16, 2015 10:05 am
by krobertson71
I checked retention.dat and all seems well. I then checked a particular host where in the GUI it is showing notifications disabled:
notifications-1.png
Here is the code segments from status.dat and retention.dat. They both show notifications disabled for the particular service, but CCM still shows them "ON". This is even after I restarted Nagios. So having trouble making sense of this.
Status.dat
Code: Select all
servicestatus {
host_name=hostname1
service_description=Swap Usage
modified_attributes=1
check_command=check_xi_ncpa_agent!-t 'mytoken' -P 5693 -M memory/swap/percent -w 85 -c 90!!!!!!!
check_period=xi_timeperiod_24x7
notification_period=xi_timeperiod_24x7
check_interval=15.000000
retry_interval=1.000000
event_handler=
has_been_checked=1
should_be_scheduled=1
check_execution_time=0.111
check_latency=0.000
check_type=0
current_state=0
last_hard_state=0
last_event_id=148683
current_event_id=151368
current_problem_id=0
last_problem_id=67078
current_attempt=1
max_attempts=5
state_type=1
last_state_change=1432852487
last_hard_state_change=1432852487
last_time_ok=1434465527
last_time_warning=0
last_time_unknown=1432852487
last_time_critical=0
plugin_output=OK: percent was 0%
long_plugin_output=
performance_data='percent_0'=0%;85;90;
last_check=1434465527
next_check=1434466427
check_options=0
current_notification_number=0
current_notification_id=91293
last_notification=0
next_notification=0
no_more_notifications=0
[b][u]notifications_enabled=0[/u][/b]
active_checks_enabled=1
passive_checks_enabled=1
event_handler_enabled=1
Retention.dat
Code: Select all
service {
host_name=hostname1
service_description=Swap Usage
modified_attributes=1
check_command=check_xi_ncpa_agent!-t 'mytoken' -P 5693 -M memory/swap/percent -w 85 -c 90!!!!!!!
check_period=xi_timeperiod_24x7
notification_period=xi_timeperiod_24x7
event_handler=
has_been_checked=1
check_execution_time=0.111
check_latency=0.000
check_type=0
current_state=0
last_state=0
last_hard_state=0
last_event_id=148683
current_event_id=151368
current_problem_id=0
last_problem_id=67078
current_attempt=1
max_attempts=5
normal_check_interval=15.000000
retry_check_interval=1.000000
state_type=1
last_state_change=1432852487
last_hard_state_change=1432852487
last_time_ok=1434465527
last_time_warning=0
last_time_unknown=1432852487
last_time_critical=0
plugin_output=OK: percent was 0%
long_plugin_output=
performance_data='percent_0'=0%;85;90;
last_check=1434465527
next_check=1434466427
check_options=0
notified_on_unknown=0
notified_on_warning=0
notified_on_critical=0
current_notification_number=0
current_notification_id=91293
last_notification=0
notifications_enabled=0
active_checks_enabled=1
passive_checks_enabled=1
event_handler_enabled=1
problem_has_been_acknowledged=0
But as you can see CCM, even after a Nagios restart, still shows notifications for this service check as on.
notifications-2.png
Also found this in the objects.cache.. as you can see here notifications are enabled, where they are not in status.dat and retention.dat, even after a restart.
Code: Select all
define service {
host_name arlgasp01.dcri.duke.net
service_description Swap Usage
check_period xi_timeperiod_24x7
check_command check_xi_ncpa_agent!-t 'mytoken' -P 5693 -M memory/swap/percent -w 85 -c 90!!!!!!!
contact_groups Linux Team
notification_period xi_timeperiod_24x7
initial_state o
importance 0
check_interval 15.000000
retry_interval 1.000000
max_check_attempts 5
is_volatile 0
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 a
freshness_threshold 0
check_freshness 0
notification_options a
notifications_enabled 1
notification_interval 360.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
_XIWIZARD ncpa
Re: Service checks notifications swithcing back to enabled
Posted: Tue Jun 16, 2015 2:42 pm
by abrist
If you enable notifications for object, and then restart nagios, does the setting stick? (check retention.dat)
You could also stop nagios and then change the notifications_enabled directive and then restart Nagios.