NSClient++ Help (#1) - scheduled checks to multiple NSCA servers? (#910) - Message List
I have a question about configuring passive checks in 0.4.0 RC1 to send results to multiple NSCA servers.
I can successfully send the results to a single default NSCA server with a configuration similar to the following.
[/settings/NSCA/client/targets/default] host = <NSCA Server IP> [/settings/scheduler/schedules/test1] alias = test_1 channel = NSCA command = check_ok interval = 25s report = all
But I can't figure out how to send the results to multiple NSCA servers. I think that I may need to create a new target for each NSCA server. But when I do that, the result only gets sent to the default server. If I remove the default server, the result is sent to an empty host.
I was thinking I needed something like the following.
[/settings/NSCA/client/targets/NSCA_host1] host = <NSCA Server1 IP> [/settings/NSCA/client/targets/NSCA_host2] host = <NSCA Server2 IP>
Can you explain what I'm doing wrong?
Well... the idea is that you have two basic options.
- Set the target (but I am unsure if this actually works, have never tried it, but will do and let you know later tonight or tomorrow). This is if you want to configure each check with a dedicated target (ie. the check drives the upstream node).
- Use multiple NSCAClient on different channels with different default targets. This is mainly if you have a fixed set of upstreams that will not change. And you want to split the configuration into sections for each. (ie. the checks are zoned and each zone wants to be configured independently).
In the future (technically now, but not supported/complete):
- You can use routing to route the channels information to the correct target.
- Use multiple channels with a single NSCAClient (not currently supported) settinga default target for each channel.
- Configure the target host details in the scheduled check (things like host port etc).
So the short answer (using the simplest option) would be to add:
[/settings/scheduler/schedules/test1] # .... target=NSCA_host1
But I have never tried this so have to check if it actually works so let me verify and add/fix if it is not currently working :)
Michael Medinmickem01/31/12 12:45:57 (16 months ago)
Sorry for the delay... But I had to rework some things inside to manage this :) Now it works as intended: NOTICE this is brand new and will be in the next nightly build, as well as 0.4.0 RC2.
The short example:
[/settings/NSCA/client/targets/host1] address = 127.0.0.1:1234 [/settings/NSCA/client/targets/host2] address = 127.0.0.1:1234 [/settings/scheduler/schedules/default] channel = NSCA command = check_ok [/settings/scheduler/schedules/s1] target = host1 [/settings/scheduler/schedules/s2] target = host2
The full example:
# Concept # # s1 => NSCAClient => (target 1) =>  => server1 # s2 => NSCAClient => (target 2) =>  => server2 # # # Define muled (notice two NSCA servers for loopback) [/modules] Scheduler = 1 NSCAClient = 1 CheckHelpers = 1 server1 = NSCAServer server2 = NSCAServer # Configure servers to listen to different ports [/settings/NSCA/server1] port = 1234 [/settings/NSCA/server2] port = 4321 # Setup default target (all others inherit from this) # Notice invalid port (5667) as we never use this target, but we want to inherit host [/settings/NSCA/client/targets/default] address = nsca://127.0.0.1:5667 # Override port for client 1 [/settings/NSCA/client/targets/host1] port = 1234 # Override port for client 2 [/settings/NSCA/client/targets/host2] port = 4321 # Setup default scheduled job (all others inherit from this) [/settings/scheduler/schedules/default] channel = NSCA command = check_ok interval = 5s report = all # Override target for s1 [/settings/scheduler/schedules/s1] target = host1 # Override target for s2 [/settings/scheduler/schedules/s2] target = host2
So all you have to do in your end is set:
target = <id of target>
And it should work just as you wanted...
Michael Medinmickem02/12/12 12:52:26 (15 months ago)