Using the same host configs in two Nagios 3.4.1 instances
Posted: Thu Jan 01, 2015 7:56 am
Hi,
I cannot imagine this is not normal - I have a small network to monitor, but it spans the country with a VPN.
The background to my question is that I have a Nagios server at each end of the network, so that I can continue to monitor the state of the services at each end even when the VPN is down.
I store my configuration in a Version Control System, so I really want to define each host once and use the same host, service, command & extinfo configuration at each end.
The issue I am facing is that the parents parameter of a host must be different for the two Nagios servers, at one end I will monitor host e via hosts b c & d, where as at the other end I will monitor host a via hosts d, c & b. The parents for b, c & d are different from the two Nagios monitoring servers.
My question is: what is the best way to reuse as much configuration as I can between the two Nagios servers?
I currently have two thoughts:
1) define all hosts as templates without parents. Then for each Nagios server define the actual hosts to 'use' the template host and set the parent correctly for that Nagios server. I have not tested this yet, but it seems OK in theory. Still, quite a lot of duplication in config files.
2) create my own definition of the network and write software to export the host configuration files for the two Nagios servers. Quite a lot of work for me, but no duplication of config files.
Are there options or tricks I have missed?
Thanks in advance.
I cannot imagine this is not normal - I have a small network to monitor, but it spans the country with a VPN.
The background to my question is that I have a Nagios server at each end of the network, so that I can continue to monitor the state of the services at each end even when the VPN is down.
I store my configuration in a Version Control System, so I really want to define each host once and use the same host, service, command & extinfo configuration at each end.
The issue I am facing is that the parents parameter of a host must be different for the two Nagios servers, at one end I will monitor host e via hosts b c & d, where as at the other end I will monitor host a via hosts d, c & b. The parents for b, c & d are different from the two Nagios monitoring servers.
My question is: what is the best way to reuse as much configuration as I can between the two Nagios servers?
I currently have two thoughts:
1) define all hosts as templates without parents. Then for each Nagios server define the actual hosts to 'use' the template host and set the parent correctly for that Nagios server. I have not tested this yet, but it seems OK in theory. Still, quite a lot of duplication in config files.
2) create my own definition of the network and write software to export the host configuration files for the two Nagios servers. Quite a lot of work for me, but no duplication of config files.
Are there options or tricks I have missed?
Thanks in advance.