how to sync downtime info from Master to Slave Nagios server

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

how to sync downtime info from Master to Slave Nagios server

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

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

Post 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:~$

abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

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

Post 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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post by ssax »

Did you have any additional questions related to this or can we mark it as resolved and lock the topic?
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

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

Post by nagmoto »

pls mark it as resolved.
Locked