I’ve been trying to get a server to report to two Nagios servers through NSCA. Everything works fine with one but I can’t seem to figure out the correct NSClient configuration to add the second NSCA target.
I found an earlier related thread http://nsclient.org/nscp/discussion/topic/910 and tried to use that as the starting point which means I added these config lines:
[/settings/NSCA/client/targets/server1] address=192.168.1.2 [/settings/NSCA/client/targets/server2] address=192.168.3.4 (plus encryption and password entries for each)
and added multiple scheduled jobs like this:
[/settings/scheduler/schedules/cpu1] alias=CPU Load command=alias_cpu target=server1 [/settings/scheduler/schedules/cpu2] alias=CPU Load command=alias_cpu target=server2
I tested this configuration and it looks like NSCP ignores the cpu1 job completely, probably because both jobs share the same alias.
Since NSCP seems to pick the reported Service Description from the alias and both NSCA targets should get the same result, I can’t really give those jobs different aliases either.
I noticed this entry in the changelog file:
2012-10-15 MickeM * Added support for lists in targets/destination (passive checks/channels)
I assume this means I could solve the problem by just using a single scheduled job and entering multiple targets for it?
If that’s what it means then what is the correct syntax for these kind of lists?
Allowed hosts seems to use a comma separated list so I tried this:
[/settings/scheduler/schedules/cpu] alias=CPU Load command=alias_cpu target=server1,server2
But it didn’t seem to work.
So, what is the correct way to solve this?
I’m using version 0.4.1.101.