Building up slave server as part of failover

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
kgopiramesh

Building up slave server as part of failover

Post by kgopiramesh »

Hi Experts,

We have few queries building up failover mechanism in nagios

1 ) We have 3000 services in master server, is there any way I can take the dump and load the services in the slave server? ( is backup from master server and restoring on the slave server would resolve the issue? )

2 ) Slave server will monitor the master server and if the master goes down, we want to enable the notification mechanism on the slave server, could that be done by using the ENABLE_NOTIFICATIONS external command? We want to schedule this under crontab. would it resolve our requirement if not please let me know how to proceed on this.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Building up slave server as part of failover

Post by tmcdonald »

The one thing I would watch out for is the IP address of the failover server. If you have firewall rules in place that only account for the main server, or passive clients only sending to it, you will need to have the main server IP set to the failover upon switching.

For the actual failover solution I would take a look at Mike Weber's presentation slides from the 2012 Nagios World Conference:

http://www.slideshare.net/nagiosinc/mike-weber-failover
Former Nagios employee
kgopiramesh

Re: Building up slave server as part of failover

Post by kgopiramesh »

Hi Tmcdonald,

Thank you for providing the ppt, but here I want to check for the process ( if possible ) in Nagios to perform the below tasks

1 ) For ex : 1 server is having 100 services configured in Nagios, and we have one more server with the same service set, do we have any way to copy the config of first to second instead of configuring each and every service manually in the second server

2 ) We have 4500 services defined in our environment till date , is there any way to upload the services in backup server ( using database or some otherway) - Please let us know.

3 ) We don't have any firewalls between the master server and slave server, so the ENABLE_NOTIFICATIONS & DISABLE_NOTIFICATIONS would help here?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Building up slave server as part of failover

Post by slansing »

1) You could just export the config files and import them on the other server, that should work fine.

2) Once again, you could copy the configs over and store them there as well, and/or set up an rsync to move the updated ones over daily, there is not currently a pre-built way to transfer your mysql server over continuously for backups. XI 2014 allows you to FTP off backups of your XI server though, under Admin > Scheduled Backups.

3) Not quite sure why lack of a firewall would matter for this, could you elaborate as to why you think it would in your situation?
kgopiramesh

Re: Building up slave server as part of failover

Post by kgopiramesh »

Hi Slansing,

Please let me know the exact way to export and import all the config from one nagios xi server to another nagios xi server as there is no option in GUI is able to do it.

Thanks in advance.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Building up slave server as part of failover

Post by slansing »

As I mentioned, if you were running XI 2014 you could... You can use the standard backup and restore document to copy everything, or like I previously said, just copy the configuration files off from their standard locations:

Code: Select all

/usr/local/nagios/etc/

http://assets.nagios.com/downloads/nagi ... ios-XI.pdf
kgopiramesh

Re: Building up slave server as part of failover

Post by kgopiramesh »

Hi Slansing,

Thank you. But I want to check for the process, if there is any way to replicate the services of one host to another host with out readding all the services.

Is that possible?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Building up slave server as part of failover

Post by tmcdonald »

Nagios relies on the flat configuration files existing, so no you can't replicate without re-adding them. The best solution currently is to do as slansing suggested and use the backup and restore, then maybe use something like rsync to transfer over any newly-created config files, import them, and apply config. Again, there is not currently a pre-built way to transfer your mysql server over continuously for backups.
Former Nagios employee
kgopiramesh

Re: Building up slave server as part of failover

Post by kgopiramesh »

Hi ,

Thanks for the reply but can we have feature request raised for copying the one host services to another host with out re adding all the hundreds of services again manually on same nagios xi server,

If there is already a way to do it, Please let me know.

We are having 8 hosts and for which we need to create 150 similar trap services manually, if we can copy from one host to another host that would save lot of time
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Building up slave server as part of failover

Post by tmcdonald »

Again, unless I am misunderstanding what you want to do, the easiest way is to backup from the main server and restore to the slave.

Correct me if I am wrong, but you want a one-time transfer of configs from main to slave?
Former Nagios employee
Locked