Service Monitoring between two servers

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mindspring
Posts: 117
Joined: Thu Jul 19, 2012 10:24 am

Service Monitoring between two servers

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Service Monitoring between two servers

Post 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>'
Be sure to check out our Knowledgebase for helpful articles and solutions!
mindspring
Posts: 117
Joined: Thu Jul 19, 2012 10:24 am

Re: Service Monitoring between two servers

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Service Monitoring between two servers

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Service Monitoring between two servers

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
mindspring
Posts: 117
Joined: Thu Jul 19, 2012 10:24 am

Re: Service Monitoring between two servers

Post by mindspring »

Thanks, this is working great now!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Service Monitoring between two servers

Post by scottwilkerson »

mindspring wrote:Thanks, this is working great now!
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked