Page 1 of 1
Data replication vis NDOUtils?
Posted: Fri May 06, 2016 10:53 am
by nicladas
Hi,
My team is trying to make sure we have replication configured for the Nagios data to allow an alternate presentation dashboard to poll for status and historical data. I'm not 100% clear on how Nagios works to broker this data to the db though, I assume it is all using NDOUtils? Basically, I would like to be able to configure one or multiple instances to
replicate, not offload, data to another db server to not increase additional stress on the main Nagios instances. Is this possible? Is there a better solution?
Thanks for your help! Just trying to get a leg up on this while we're waiting for finance to write the check

Re: Data replication vis NDOUtils?
Posted: Fri May 06, 2016 12:02 pm
by tmcdonald
If you wanna cut down the load on the Nagios side of things, then I would suggest doing this at the DB level:
http://dev.mysql.com/doc/refman/5.7/en/ ... howto.html
Re: Data replication vis NDOUtils?
Posted: Fri May 06, 2016 12:40 pm
by nicladas
I had thought of that, but "real time" is fairly imperative with this ask. Are we talking milliseconds or seconds with type scenario?
Also, am I correct in assuming NDOUtils configuration is what sends all data to the database? Right now, the instance is configured to point to localhost, I'm just wanting to verify that if I changed that hostname that no data whatsoever would be entered into the localhost db anymore and it would all be directed to the new hostname. I ask because if we configure multiple instances of Nagios and point them all to a single db host ( which we would then replicate ), I just want to know whether or not data will live in multiple locations.
Thanks for the link and the help!
Re: Data replication vis NDOUtils?
Posted: Fri May 06, 2016 1:44 pm
by tmcdonald
nicladas wrote:I had thought of that, but "real time" is fairly imperative with this ask. Are we talking milliseconds or seconds with type scenario?
That really depends on your network and disk speeds:
http://serverfault.com/questions/30605/ ... eplication
If you are needing true real-time replication, you need to talk to MIT about getting quantum computing down to a reasonable price point :)
nicladas wrote:Also, am I correct in assuming NDOUtils configuration is what sends all data to the database? Right now, the instance is configured to point to localhost, I'm just wanting to verify that if I changed that hostname that no data whatsoever would be entered into the localhost db anymore and it would all be directed to the new hostname. I ask because if we configure multiple instances of Nagios and point them all to a single db host ( which we would then replicate ), I just want to know whether or not data will live in multiple locations.
Take a look at our doc on offloading the XI database:
https://assets.nagios.com/downloads/nag ... Server.pdf
But basically yes, the
ndo2db.cfg file is where you define where the NDO data goes.
Now, I can't say we would necessarily support multiple XI servers sharing one DB like this, but it should be technically possible. I also need to question what you mean by "all data" - some things like debug logging and of course the RRD files for performance data are not going to end up in the NDO database. You also do not have the XI users or configs handled by NDO.
Re: Data replication vis NDOUtils?
Posted: Sun May 08, 2016 12:50 pm
by nicladas
I guess "real time replication" being database replication may be too definitive. Another alternative to get us to that goal could/would be to intercept the event broker messages and instead of going to one database, they would either a) go to mutliple or b) go to an event store which other services could subscribe to.
Now, I can't say we would necessarily support multiple XI servers sharing one DB like this, but it should be technically possible.
I'm a little confused by this statement... this seems like the exact use case presented for NDOUtils directly from Nagios:
https://exchange.nagios.org/directory/image/94 . Am I misreading?
I also need to question what you mean by "all data" - some things like debug logging and of course the RRD files for performance data are not going to end up in the NDO database.
To be more specific, we're mainly looking for status + history for all objects.
Re: Data replication vis NDOUtils?
Posted: Mon May 09, 2016 9:17 am
by tmcdonald
nicladas wrote:
tmcdonald wrote:Now, I can't say we would necessarily support multiple XI servers sharing one DB like this, but it should be technically possible.
I'm a little confused by this statement... this seems like the exact use case presented for NDOUtils directly from Nagios:
https://exchange.nagios.org/directory/image/94 . Am I misreading?
By "support" I meant "provide support for" since it is untested on an XI system, and therefor not guaranteed to work. This would need to go through the devs and QA before we could provide support for it.
To be more specific, we're mainly looking for status + history for all objects.
These exist in the NDO tables
nagios_statehistory,
nagios_servicestatus, and
nagios_hoststatus. And to clarify, the perfdata is sill there but is not in the same format as in the RRD files.
Re: Data replication vis NDOUtils?
Posted: Wed May 11, 2016 8:27 am
by nicladas
Maybe I need to reword with the core use case(s) we're after
What we're really looking for is two things I think...
1) To be able to capture the events of host and service status updates/alerts and have them go to another data source. ( Possible database trigger? )
2) To be able to replicate the database itself ( I believe your first answer already solves this use case )
Re: Data replication vis NDOUtils?
Posted: Wed May 11, 2016 4:33 pm
by tmcdonald
Having spoken to our in-house Core dev (who also handles other C projects like NDO) it does not appear that ndo2db can currently send data to multiple remote databases, which is what I remember being the case. This is why (along with your original request to keep the load on the Nagios server low) I suggested doing DB-level replication.
Re: Data replication vis NDOUtils?
Posted: Wed May 11, 2016 8:42 pm
by nicladas
Done and done.
Thanks so much for your help, and from what I'm told we FINALLY received our license!
Re: Data replication vis NDOUtils?
Posted: Thu May 12, 2016 9:43 am
by rkennedy
Great to hear! Are we good to mark this one as resolved?