Page 1 of 1

how to sync downtime info from Master to Slave Nagios server

Posted: Wed Mar 25, 2015 10:26 am
by nagmoto
Hi

I am setting up a redundant passive(notification is disabled) Nagios server but I found the downtime type of info is not propagated.
Can you advise what files need to be rysnced over from master to slave ?

Thanks

tj

Re: how to sync downtime info from Master to Slave Nagios se

Posted: Wed Mar 25, 2015 10:53 am
by abrist
Scheduled downtime is considered runtime-state data (as well as acknowledgements). It is located in the /usr/local/nagios/var/retention.dat and the /usr/local/nagios/var/status.dat files.

Re: how to sync downtime info from Master to Slave Nagios se

Posted: Wed Mar 25, 2015 11:21 am
by nagmoto
Can runtime-state data file be copied directly over the a Slave server also doing checks but with notification disabled ?
Looks like the content is machine specific, it should not be a direct file to file overwritten,right ?

Code: Select all

nagios@nagios1:~$ sudo head -20  /var/log/nagios/retention.dat
########################################
#      NAGIOS STATE RETENTION FILE
#
# THIS FILE IS AUTOMATICALLY GENERATED
# BY NAGIOS.  DO NOT MODIFY THIS FILE!
########################################
info {
created=1427299561
version=3.5.1
last_update_check=1427222686
update_available=1
update_uid=1375217352
last_version=3.5.1
new_version=4.0.8
}
program {
modified_host_attributes=0
modified_service_attributes=0
enable_notifications=1
active_service_checks_enabled=1
nagios@nagios1:~$


Re: how to sync downtime info from Master to Slave Nagios se

Posted: Wed Mar 25, 2015 11:30 am
by abrist
nagmoto wrote:Looks like the content is machine specific, it should not be a direct file to file overwritten,right ?
Yeah, that is a caveat of allowing the second machine to run checks. If it was a pure failover situation, you could just sync the retention/status files.
What type of checks are you running on the slave? If they are just checks to verify if the master is up (and subsequently run an event handler enabling all the slave checks when the master is down), move those checks/logic to a cron job instead, which will allow you to sync the runtime data.

If you are actually running all the checks from the slave (for historical redundancy, etc), then your options are a bit more limited.

Re: how to sync downtime info from Master to Slave Nagios se

Posted: Wed Mar 25, 2015 5:10 pm
by nagmoto
After reading following two articles,

https://allmybase.com/2010/10/04/settin ... s-servers/
http://www.slideshare.net/nagiosinc/nag ... -solutions

I need to do more home work on understanding the challenge and do put in more lab testing effort.

Re: how to sync downtime info from Master to Slave Nagios se

Posted: Thu Mar 26, 2015 9:03 am
by ssax
Did you have any additional questions related to this or can we mark it as resolved and lock the topic?

Re: how to sync downtime info from Master to Slave Nagios se

Posted: Thu Mar 26, 2015 9:35 am
by nagmoto
pls mark it as resolved.