Port check on a remote host

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
eddiez
Posts: 72
Joined: Tue Dec 11, 2012 10:38 am

Port check on a remote host

Post by eddiez »

I would like to monitor a port from one host to another, example connection from host A to check connetivity of a DB2 port (54000) on host B. Has anyone have a custom script that they can share with me or tell me how to do this?

Thanks,

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

Re: Port check on a remote host

Post by scottwilkerson »

In Nagios XI there is a wizard just for this, the TCP/UDP Port Wizard is what you are looking for.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
eddiez
Posts: 72
Joined: Tue Dec 11, 2012 10:38 am

Re: Port check on a remote host

Post by eddiez »

I tried that, but when I was testing the check from within XI it was displaying the hostname of the host config. I did not see the other host
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Port check on a remote host

Post by scottwilkerson »

When you add the check, you are checking "host B" port 54000 so it would be "host B" that you would add as the host.

At the very least you can look at the command that is configured after running the wizard and make a new command that accomplishes the same thing the way you want, and add that command to a new service you want
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Port check on a remote host

Post by gormank »

I think the OP wants something like the following. Use check_nrpe to run check_tcp on a host to check another host port open.

/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -t 75 -c check_tcp -a '-H host -p=port'

# /usr/local/nagios/libexec/check_tcp
check_tcp: No arguments found
Usage:
check_tcp -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>]
[-e <expect string>] [-q <quit string>][-m <maximum bytes>] [-d <delay>]
[-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j]
[-D <warn days cert expire>[,<crit days cert expire>]] [-S <use SSL>] [-E]
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Port check on a remote host

Post by scottwilkerson »

gormank wrote:I think the OP wants something like the following. Use check_nrpe to run check_tcp on a host to check another host port open.
Thanks @gormank

I'm sorry I missed this
from one host to another
and thought host A was the Nagios XI server

His example may be correct but before I can give the example I need to verify that "host A" is a Linux server?

If so does it have the XI Linux Agent installed?
If not installed lets start by installing that
https://assets.nagios.com/downloads/nag ... _Agent.pdf
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked