Page 1 of 1

Add multiple Nagios server in the nsclient.ini (Windows)

Posted: Thu Feb 24, 2022 8:15 am
by ruudboek
Hello,

i use the nsclient for Windows to sent passive checks to my Nagios monitoring server.

The problem is that i have multiple Nagios monitoring servers and i would like for the Windows nsclient to sent alerts to all of my Nagios monitoring servers.

The nagios server is defined in the nsclient.ini file by the address line:

[/settings/NSCA/client/targets/default]
address = monitoringserver.com

Is it possible to add multiple hostnames or ip addresses to the address line?
If yes, how do i do that?

Re: Add multiple Nagios server in the nsclient.ini (Windows)

Posted: Thu Feb 24, 2022 12:54 pm
by gormank
Yes, just add them after the other separated by spaces I think (or maybe comma separated). Restart the service and check the log for errors.

Re: Add multiple Nagios server in the nsclient.ini (Windows)

Posted: Fri Feb 25, 2022 4:08 am
by ruudboek
I tried both komma separated as well as space separated and restarted the nsclient service, but it didn't work.
Both Nagios servers show an "unknown" error after making those changes because no data is received anymore from the nsclient.

The nsclient.log shows this error:

2022-02-25 10:06:15: error:c:\source\master\modules\Scheduler\Scheduler.cpp:173: Failed to submit nsca2m_Get-Service: Socket error: resolve: No such host is known

We are using nsclient version 0.5.2.39.

Re: Add multiple Nagios server in the nsclient.ini (Windows)

Posted: Fri Feb 25, 2022 11:22 am
by gormank
I checked one of my nsclient.ini files and here's what I see:

; ALLOWED HOSTS - A comaseparated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges.
allowed hosts = 10.133.134.0/24,10.136.243.0/24

The .0/24 is probably overkill since there are just two Nagios hosts in each network.

Re: Add multiple Nagios server in the nsclient.ini (Windows)

Posted: Fri Feb 25, 2022 2:21 pm
by gormank
Sorry,
I'm a creative reader and answered for nrpe, w/o noticing you asked about passive checks.