Install multiple instance of NRPE agent

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
anilgupta
Posts: 102
Joined: Fri Mar 01, 2019 8:35 am

Install multiple instance of NRPE agent

Post by anilgupta »

Team,

We have a set of servers being monitored by Nagios Core server using NRPE agents. This Nagios Core is owned by local system administrators.

As Enterprise Monitoring initiative, we need to monitor the same set of servers. We do not want to disturb their monitoring, these servers are so critical.

Questions:
1) How to install second instance of agent running on different port (let's say, 4666). While running agent installation, it doesn't give option to specify the port number.
2) Once the Agent running on PORT 4666, how should it be monitored? because Nagios starts communication on default agent port 5666.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Install multiple instance of NRPE agent

Post by scottwilkerson »

when running the configure script you are going to want to add the arg

Code: Select all

--with-nrpe-port=4666
But this aside, there is going to be a ton of other items that are going to need to changed as otherwise you are going to clobber the existing config, binary, service file, etc.

Instead of this, may I propose you just use the existing nrpe, however in the nrpe.cfg you just add the following which will point th the commands you want to use for the seperate commands

Code: Select all

include_dir=/path/to/custom/nrpe/
then in this directory make a file with your commands

custom_commands.cfg

Code: Select all

command[check_procs_custom]=/usr/local/nagios/libexec/check_procs $ARG1$

The biggest thing to make sure of is that you do not make identical command names
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
anilgupta
Posts: 102
Joined: Fri Mar 01, 2019 8:35 am

Re: Install multiple instance of NRPE agent

Post by anilgupta »

Hello scottwilkerson,

Thanks for your response.

I liked the proposed idea. In order to compare the both idea, I need clarification on below.
1) with the given instructions, there will be single instance of NRPE agent running on port 5666. Is my understanding correct?
2) We will just be creating another directory where we will define our command. Is this correct?

Regarding my original question, you said that we can define the port with --with-nrpe-port=4666. How can we specify the installation location so that it will not mess up the existing instance.

Let me know if any clarification needed.

Thanks,
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Install multiple instance of NRPE agent

Post by scottwilkerson »

anilgupta wrote:I liked the proposed idea. In order to compare the both idea, I need clarification on below.
1) with the given instructions, there will be single instance of NRPE agent running on port 5666. Is my understanding correct?
yes
anilgupta wrote:2) We will just be creating another directory where we will define our command. Is this correct?
yes
anilgupta wrote:Regarding my original question, you said that we can define the port with --with-nrpe-port=4666. How can we specify the installation location so that it will not mess up the existing instance.
there are a ton of different directories you would need to change. You can see the available option by running the following on the nrpe configure file

Code: Select all

./configure --help
Even given this, there is also the need to actually have a different service name and I'm not 100% sure that is even a configurable option.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
anilgupta
Posts: 102
Joined: Fri Mar 01, 2019 8:35 am

Re: Install multiple instance of NRPE agent

Post by anilgupta »

Hi, I tried to install the nrpe agent under different location and new PORT number.
I had to update only TWO files: nrpe2.cfg and common.cfg.
After the change the new agent is up and running and serving the request from Naigos.

But I am concerned as what other files/directories needs to be updated as you stated below.

Code: Select all

there are a ton of different directories you would need to change
We would like to discuss this in detail. Can we please have phone conversation on this?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Install multiple instance of NRPE agent

Post by scottwilkerson »

anilgupta wrote:But I am concerned as what other files/directories needs to be updated as you stated below.
I was mainly referring the the config file locations you were mentioning (and afraid that if you did it wrong it would overwrite your existing configs) and the fact that a typical installation sets up a service named nrpe which would be in conflict (because it could overwrite your existing service) unless you setup a separate service name.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
anilgupta
Posts: 102
Joined: Fri Mar 01, 2019 8:35 am

Re: Install multiple instance of NRPE agent

Post by anilgupta »

thanks for the response.

I understand the risk of conflicting service name.
Please confirm that renaming service name along with changing the TWO files (nrpe.cfg and common.cfg) is good enough to run the instance under different location. And, literally we do not need to update/modify tones of files.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Install multiple instance of NRPE agent

Post by scottwilkerson »

anilgupta wrote:thanks for the response.

I understand the risk of conflicting service name.
Please confirm that renaming service name along with changing the TWO files (nrpe.cfg and common.cfg) is good enough to run the instance under different location. And, literally we do not need to update/modify tones of files.
That sounds right to me.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
anilgupta
Posts: 102
Joined: Fri Mar 01, 2019 8:35 am

Re: Install multiple instance of NRPE agent

Post by anilgupta »

Thanks for the response scottwilkerson !

Need further confirmation.

Our proposed way of agent installation will remain eligible for support by Nagios. Is that correct?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Install multiple instance of NRPE agent

Post by scottwilkerson »

anilgupta wrote:Thanks for the response scottwilkerson !

Need further confirmation.

Our proposed way of agent installation will remain eligible for support by Nagios. Is that correct?
Sure, but if you need assistance with this you are going to have to outline what you did each time as this is not standard at all and our techs will not be anticipating this.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked