Page 1 of 1
Port check on a remote host
Posted: Tue Apr 24, 2018 12:49 pm
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
Re: Port check on a remote host
Posted: Tue Apr 24, 2018 1:05 pm
by scottwilkerson
In Nagios XI there is a wizard just for this, the TCP/UDP Port Wizard is what you are looking for.
Re: Port check on a remote host
Posted: Tue Apr 24, 2018 1:19 pm
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
Re: Port check on a remote host
Posted: Tue Apr 24, 2018 1:35 pm
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
Re: Port check on a remote host
Posted: Tue Apr 24, 2018 2:07 pm
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]
Re: Port check on a remote host
Posted: Tue Apr 24, 2018 2:57 pm
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