Multiple NSCA daemons

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
HFroyen
Posts: 5
Joined: Mon Sep 09, 2013 3:23 am

Multiple NSCA daemons

Post by HFroyen »

Hi all,

I'm sitting here with a little problem :

I'm using multiple Nagios Core instances running besides each other on the same virtual machine.
Now I wanted some of the external checks of a server (which I configured on one Nagios instance) also on the other Nagios instance.
But in the /etc/nsca.conf there's only one command_file line (which in this case points to the nagios.cmd of the first Nagios instance).

If I change the command_file directive in my nagios.cfg of my secondary Nagios instance to the nagios.cmd of the first instance, nsca sends one result to my first instance, than the second result to the second and so on.

Now I was wondering if it could be possible to compile a second nsca daemon with a different nsca.cfg that handles passive checks for my secondary Nagios instance.
This would be great since I can't find any possible documentation on this.

Cheers!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Multiple NSCA daemons

Post by slansing »

This would not be advisable since they both need to use port 5667 and running duplicates of files, trying to open the same file at the same time while something else may be writing to it is also bad news. In short no, I have not heard a success story for multiple NSCA or NRPE agent's installed on the same site. However, you could forward checks from one NSCA server to another.
HFroyen
Posts: 5
Joined: Mon Sep 09, 2013 3:23 am

Re: Multiple NSCA daemons

Post by HFroyen »

Ah ok thanks.
Although I saw an option in the ./configure : --with-nsca-port=

I thought we could maybe put that on port 5668.. :D
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Multiple NSCA daemons

Post by slansing »

You may be able to configure it to use a separate port, however this probably won't fix the issue of how are you going to validly run multiple NSCA instances, the default use port is 5667 this may just change that on configuration in case you need to use another port. You can always experiment but I'm not sure how far you will be able to get.
HFroyen
Posts: 5
Joined: Mon Sep 09, 2013 3:23 am

Re: Multiple NSCA daemons

Post by HFroyen »

slansing wrote:You may be able to configure it to use a separate port, however this probably won't fix the issue of how are you going to validly run multiple NSCA instances, the default use port is 5667 this may just change that on configuration in case you need to use another port. You can always experiment but I'm not sure how far you will be able to get.
I'll get back to this once I found a valid and clean solution! :D
But thanks in advance for the tips!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Multiple NSCA daemons

Post by slansing »

Sure! Once you have gotten down to trying this, we can help as much as possible, theoretical ideas are a bit hard to support. :)
Locked