配置nagios的时候发现一个问题,就是改变了某个主机或者服务的描述之后,在主页信息总是更新很慢,而且告警信息还是老的信息,重启多次nagios甚至重启主机都没有解决,其实这些都是由于nagios每次关闭的时候都会保存数据到/usr/local/nagios/var/retention.dat这个文件中,然后启动的时候读取这个文件的数据,打开这个文件发现都是一些nagios各个监控对象的状态参数,如:
host {
host_name=DianAn-MSR5400
alias=********
display_name=DianAn-MSR5400
modified_attributes=0
check_command=
check_period=24x7
notification_period=24x7
event_handler=
has_been_checked=0
check_execution_time=0.000
check_latency=0.056
check_type=0
current_state=0
last_state=0
last_hard_state=0
last_event_id=0
current_event_id=0
current_problem_id=0
last_problem_id=0
plugin_output=
long_plugin_output=
performance_data=
last_check=0
next_check=1323659506
check_options=0
current_attempt=1
max_attempts=1
normal_check_interval=1.000000
retry_check_interval=1.000000
state_type=1
last_state_change=1323659204
last_hard_state_change=1323659204
last_time_up=0
last_time_down=0
last_time_unreachable=0
notified_on_down=0
notified_on_unreachable=0
last_notification=0
current_notification_number=0
current_notification_id=0
notifications_enabled=1
problem_has_been_acknowledged=0
acknowledgement_type=0
active_checks_enabled=1
passive_checks_enabled=1
event_handler_enabled=1
flap_detection_enabled=0
failure_prediction_enabled=1
process_performance_data=1
obsess_over_host=1
is_flapping=0
percent_state_change=0.00
check_flapping_recovery_notification=0
state_history=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
}