Reputation: 218
We have an AWS instance, where we have installed Nagios Core and we want to host multiple monitoring for different set of hosts and services. For example, when we type: https://nagiosdev1.com/nagios_test1/ it should direct to one set of host groups, and https://nagiosdev1.com/nagios_test2/ it should direct to another set of host groups.
Test2 is cloned from Test1, and both web-pages are working,but they do not show their independent host groups. We modified all host groups in Test2 and they are different from Test1.
At server level, we have specifically mentioned what host groups both should contain, but the GUI part for Test2 are showing the hosts of Test1.
If we make any changes on Test1, it is getting replicated on Test2. But any changes on Test2 doesn't show up.
[aghosh@nagiosdev apt]$ cd /usr/local/nagios
test1/ test2/
[aghosh@nagiosdev apt]$ pwd
/usr/local/test2/etc/apt
[aghosh@nagiosdev apt]$ ls | wc -l
1
[aghosh@nagiosdev apt]$ pwd
/usr/local/test1/etc/apt
[aghosh@nagiosdev apt]$ ls | wc -l
25
As you can see, Test2 has only 1 host group, while Test1 has 25.
The whole point being, one site will be holding production host groups and other site will be hosting non-prod host groups.
Anyone got ideas?
Upvotes: 0
Views: 245
Reputation: 19
Your description of the problem I.e what steps you have performed and what you are looking to achieve completely mismatches moreover this is not following any Nagios best practice methodology. Owing to very little information on reasons why you are creating two different host group in the same server for two different set of to be monitored host ( Prod and Non Prod) and trying to call them by different URI isn't clear to me. In my several Nagios over AWS and GCP I haven't ever used such a crude method. Nagios XI has sophisticated method of host separation and a multi site Nagios Architecture would require you to consider lot more than just creating two hostgroup. For two different set of hosts in same network you may register them on same server with host agents reporting to master, if host are in different network you would use two different Nagios server i.e two different EC2 instance holding two different URL.
Regarding why the nagios_test1 is resembling nagios_test2 in your case, I suspect you are incorrectly calling the host groups which is why every time it is returning you same set of data. You should know NagiosXi provide Nagios API which can be used to show hostgroup members and service group members. Vanilla Nagios free version doesn't provide the same. This could be reason, it can also happen when incorrectly copied the template data for host and services. They may pass Nagios syntax check but provide wrong host / service information.
Supporting Nagios Doc: https://assets.nagios.com/downloads/nagiosxi/docs/Accessing_The_XI_Backend_API.pdf
Hope you have got your answer.
Upvotes: 1
Reputation: 1
Try not to create two different directories like test1 & test2. Rather, prefer you to create the soft link on test1 to test2 so that physically it appears two different sites but logically it points to the directory test1.
ln -s nagios_test1 nagios_test2
https://nagiosdev1.com/nagios_test1/ https://nagiosdev1.com/nagios_test2/
Upvotes: 0