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

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
ruudboek
Posts: 2
Joined: Thu Feb 24, 2022 8:08 am

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

Post 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?
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

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

Post 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.
ruudboek
Posts: 2
Joined: Thu Feb 24, 2022 8:08 am

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

Post 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.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

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

Post 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.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

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

Post by gormank »

Sorry,
I'm a creative reader and answered for nrpe, w/o noticing you asked about passive checks.
Locked