Page 1 of 1

Service Monitoring between two servers

Posted: Tue Oct 29, 2019 9:08 am
by mindspring
Hi There,

I just wanted to find out what is the best practice in monitoring for example:

A front end server connects to a back end database server ( on a public or private IP)
So essentially I would need to monitor the connection between the front end and back end server. The speed of the response time from the front end web server to the back end database server.
Not the connection from my Nagios server to the back end server.

Thanks

Re: Service Monitoring between two servers

Posted: Tue Oct 29, 2019 10:21 am
by lmiltchev
If you wanted to monitor the connection between server A and server B, you could install NRPE on server A, and set up a simple check_ping command in the nrpe.cfg file, e.g.

Code: Select all

command[check_ping]=/usr/local/nagios/libexec/check_ping -H $ARG1$ -w 3000.0,80% -c 5000.0,100% -p 5
Then, you could call the check_ping command via check_nrpe from the Nagios XI server:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <ip address of server A> -c check_ping -a '<ip address of server B>'

Re: Service Monitoring between two servers

Posted: Wed Oct 30, 2019 1:48 am
by mindspring
Thanks I tried that and I get the the error:

nrpe.cfg on ServerA

Code: Select all


command[check_tcp]=/usr/local/nagios/libexec/check_tcp -H $ARG1$ -p $ARG2$ -w $ARG3$ -c $ARG4$

Command I am running from NAgiosXI server

Code: Select all

./check_nrpe -H SERVERA -c check_tcp -H SERVERB -p 3306
CHECK_NRPE: Error - Could not complete SSL handshake.



I thought that I then might need to add the Server A IP address in nrpe.cfg allowed hosts, which I did but I still seem to get the error.

Am I missing something?

Just to confirm, the allowed hosts in nrpe.cfg - is that meant to be comma separated or space separated as documentation differs in this regards?

Thanks.

Re: Service Monitoring between two servers

Posted: Wed Oct 30, 2019 9:15 am
by lmiltchev
1. If you are running NRPE as a "standalone daemon" on server A, then you must enter the IP address of your Nagios XI server on the "allowed_hosts" line in the nrpe.cfg file. These are comma-separated IP addresses!

Example:

Code: Select all

allowed_hosts=127.0.0.1,x.x.x.x
Note: The "x.x.x.x" should be the IP address of your Nagios XI server.

Also, make sure you have this line:

Code: Select all

dont_blame_nrpe=1
Save, exit and restart nrpe, so that changes can take effect.

2. If you are running NRPE under xinetd, then you would need to enter the IP address of your Nagios XI server on the "only_from" line in the /etc/xinetd.d/nrpe file. These are space separated IP addresses!

Example:

Code: Select all

only_from = 127.0.0.1 x.x.x.x
Note: The "x.x.x.x" should be the IP address of your Nagios XI server.
Save, exit and restart xinetd, so that changes can take effect.

3. You can test your check from the command line by running the following on the Nagios XI server:

Code: Select all

./check_nrpe -H SERVERA -c check_tcp -a SERVERB 3306 <warn> <crit>
where <warn> and <crit> values are in seconds (use double here).

Example:

Code: Select all

./check_nrpe -H x.x.x.x -c check_tcp -a y.y.y.y 5693 0.001 0.009
TCP OK - 0.000 second response time on y.y.y.y port 5693|time=0.000367s;0.001000;0.009000;0.000000;10.000000

Re: Service Monitoring between two servers

Posted: Thu Nov 07, 2019 3:59 pm
by benjaminsmith
Hello @MindSpring,

It's been a while since Ludmil's post with setup instructions. Were you able to start monitoring with NRPE. Let us know how it's going when you have a moment.

Thanks.

Re: Service Monitoring between two servers

Posted: Mon Nov 11, 2019 4:47 am
by mindspring
Thanks, this is working great now!

Re: Service Monitoring between two servers

Posted: Mon Nov 11, 2019 8:18 am
by scottwilkerson
mindspring wrote:Thanks, this is working great now!
Great!

Locking thread