Page 1 of 2
Configure Nagios in HA mode
Posted: Wed Aug 10, 2016 8:08 am
by network2016
Hi please help in setting two nagios servers in HA mode .My requirements are as below,
Configuring two NMGRs in HA Mode: Active (S1) – Passive (S2)
1. Configure S1 with Nagios (Including the DB)
2. Configure S2 with Nagios (Including the DB)
3. Configure S1 be Primay / Active Nagios
4. Configure S2 to be Slave / Passive Nagios
5. Generate the network events. Assuming that those network devices are configured to send events to S1 Nagios Server.
6. Observe the events in S1
7. Observer & Verify for the events in S2 as well
The events which appeared in S1, should also reflect in S2.
Which database files should be used to sync the two servers in order to make them synchronized . I have tried rsync but it did not help . I am looking for a solution which take the updates from network devices in Nagios server 1 and replicate them in nagios server 2.
Any help is welcomed and thanks for help in advance!!!!
Thanks
Re: Configure Nagios in HA mode
Posted: Wed Aug 10, 2016 1:00 pm
by tmcdonald
For HA setups we actually recommend LinBit as a point of contact. They wrote an excellent guide on HA for Nagios XI specifically, using DRBD:
http://www.linbit.com/en/resources/tech ... centos-6-5
They also do consulting to set this up for you if you need some assistance.
Re: Configure Nagios in HA mode
Posted: Wed Aug 24, 2016 4:54 am
by network2016
thanks for the reply!!
Actually i have used the solution as described below,
https://allmybase.com/2010/10/04/settin ... ent-269374
I used Rsync to sync retention.dat file ,I am able to sync the retention.dat file on both nagios servers but no events are seen in the notification or dashboards , I would like to sync the dashboard of two nagios servers in HA mode ,how is it possible ,is there any solution avalaible .or if u can provide me with the files or database which i can sync using Rsync between two servers two get the replicated nagios servers in HA mode. My primary objectve is just t produce a scenerio where I can sync and see the same data n dashboards in two nagios servers in a redundent mode.
Please help
Thanks
Re: Configure Nagios in HA mode
Posted: Wed Aug 24, 2016 12:30 pm
by ssax
The link you provided will only work for Nagios Core, the XI data that you're looking to sync is stored in the DB, your best option is to look at LinBit's solution that tmcdonald linked to.
Thank you
Re: Configure Nagios in HA mode
Posted: Wed Aug 31, 2016 5:17 am
by network2016
Hi thanks All for replies!!
I have configured two nagios servers such that first N1 is receiving data from devices and I want to sync those data on to N2 ,So for that I have used Rsync and Written a script which sync below databases of nagios,
/usr/local/nagios
/usr/local/nagiosxi
/etc/nagiosql
So finally I am getting my dashboard syncing on both servers. But the issue is that ,in view or dashboard i can see all host but not in the CCM as N1 CCM shows 6 hosts ,whereas in N2 CCM only local host is there.
Also when I write the configuration file in CCM it says ghost entries for hosts and services found and deleted
Can anyone help me in understanding which is that means and why ghost entries are removing and not syncing as I synced all three databases.
Re: Configure Nagios in HA mode
Posted: Wed Aug 31, 2016 6:33 am
by network2016
Also To add the dashboard entries for example sometime synced and sometime again become different,when I reboot n run script i synced and after sometime again become different.
Please provide possible reason and how to rectify it
Thanks
Re: Configure Nagios in HA mode
Posted: Wed Aug 31, 2016 6:44 am
by network2016
Another observation is as the script runs and nagios server synced the monitoring engine,performance grapher and back end database become automatically stop. I have to manually start them n then again dashboard synced but only hosts ,it shows different number of services ,also CCM is not updated in server 2 and still shows 1 device which is local host.
these three services stop after few seconds and the N2 shows old entries again and when I restart the monitoring service it again sync or show same as N1 but only number of hosts and not the services.
Any suggestions ...
Struck

badly.
thanks
Re: Configure Nagios in HA mode
Posted: Wed Aug 31, 2016 2:11 pm
by ssax
Here are the data files for the DBs:
Code: Select all
/var/lib/mysql/nagios
/var/lib/mysql/nagiosql
/var/lib/mysql/nagiosxi
Sounds like you're missing the nagiosql DB, validate that it's actually syncing.
Re: Configure Nagios in HA mode
Posted: Thu Sep 01, 2016 1:04 am
by network2016
Thanks for reply!!!
It is actually working now now the CCM is synced when I synced /var/lib/ .. databases,but their are two issues now
1. dashboard is after few seconds shows entries for the host which is deleted in N1 and their services are also appeared in the dashboard only ,not in CCM and
2. The monitoring engine ,performance grapher and database back end stops automatically when I run the script on N1 but the changes appear in CCM
also please help me to understand right now in my script I am syncing following things
/usr/local/nagios/
/usr/local/nagiosxi/
/etc/nagiosql/
/var/lib/ files
So what is actually needed to sync the two server or replicate it . Should all above need to sync or specifically DB and Lib files so that above issues can be rectify. Please help me with this .
Also dashboard in N2 shows all deleted entries which are deleted from N1 initially means 1st time sync .and it will look like something as attached file....
It is adding host from nowhere means may be not updating temp data so, what should be synced to update temp data for dashboard or view sections
Hosts .11 .5 and two blank entries are already deleted but still shows here please help!!!!
View section look like this [attached file]
Thanks in advance
waiting for your help!!!!
Re: Configure Nagios in HA mode
Posted: Thu Sep 01, 2016 1:18 am
by network2016
Hi Another observation
When I clicked on deleted host which is actually not in N1 or shows in CCM of both N1 and N2 , it throws following errors
Attached file!!!!!!!!!!!
After that I repaired database as it says nagios_object need to be repaired, it shows correct entries as in N1 but again started adding deleted device and services and I cant configure or open those services as they actually not exit in CCM also when I tried to write config it gives following error .
The ghost entries for x.x.x.11 which is a deleted host is found and removed but still dashboard shows deleted services and hosts
Also after sometime the data base corrupted and give following error as attache dbfile "Database corrupt error"
please advice
thanks