Operating System - OpenVMS
1748265 Members
3912 Online
108760 Solutions
New Discussion юеВ

Monitor IP ports utility

 
SOLVED
Go to solution
Nicolau Roca
Advisor

Monitor IP ports utility

Hello

Does anyone use (or know about) an utility able to monitor IP ports on OpenVMS? I would use such utility to periodically verify that the SMTP, POP3 and IMAP services are responding on ports 25, 110 and 143 respectively.

Thank you

Nicolau
10 REPLIES 10
Steven Schweda
Honored Contributor

Re: Monitor IP ports utility

It really depends on what you mean by
"monitor". You can see some useful info
using commands like:

tcpip show device
tcpip netstat -a

(and similar), but if you really need to know
if the service is working, then you really
need to use it. I use Wget to check my Web
server periodically and send me e-mail if it
doesn't respond properly.

You could probably write a Kermit script or
use TELNET /CREATE_SESSION to let you talk
to any port you wish. What you have to say
when you talk to it depends on the protocol.
I believe that this sort of thing has been
discussed here recently, so searching for
Kermit and/or CREATE_SESSION might find
something.
labadie_1
Honored Contributor
Solution

Re: Monitor IP ports utility

Have a look at
http://dcl.openvms.org/stories.php?story=03/09/23/7962305

replace 8044 by 25,110 and 143, and the associated text. That's it !
Wim Van den Wyngaert
Honored Contributor

Re: Monitor IP ports utility

Or very simple :

$ def/us sys$output xxx
$ ucx sho dev/port=0

This will create a file with all ports that have a listener.

Then if diff returns a difference, something is gone/changed/added. Check and take action.

Wim
Wim
Steven Schweda
Honored Contributor

Re: Monitor IP ports utility

> [...] That's it !

That's it, _if_ you don't care whether the
server actually responds to a request.
Getting connected is nice, but it's not the
same as proving that the server at the other
end is working properly. For that, you need
to have a little conversation with the server
after you've gotten connected.
labadie_1
Honored Contributor

Re: Monitor IP ports utility

Steven

You can check that the process owning the device showed by $ tcpip sh dev/port=25/110/143 is still here, but you will not know if is is working or it is hang.

I think Nicolau wants some basic check.

How to check Smtp works fine ?
- there is a process tcpip$smtp_'node'_xx
- tcpip sh service smtp -> shows enabled
- sh que tcpip$smtp_'node'* -> queue is not stopped or any other "bad" state
- other things to check ?

We have all met situations where the process was here, but not responding.
Steven Schweda
Honored Contributor

Re: Monitor IP ports utility

> You can check that the process owning the
> device showed by $ tcpip sh
> dev/port=25/110/143 is still here, but you
> will not know if is is working or it is
> hang.

That's exactly my point.

> I think Nicolau wants some basic check.

I don't know what kind of check he wants,
which is why I suggested more than one
method, including a serious test. As I said,
'It really depends on what you mean by
"monitor".'

> We have all met situations where the
> process was here, but not responding.

_I_ certainly have, which is why I suggested
actually talking to the server (and listening
for a response), instead of simply seeing if
the port is registered, or if a connection to
the server can be made.

In other words, if you wish to test a POP
server, then ask the POP server to do
something (and see if it does it). Simpler
tests may be useful, but they will not tell
you as much as a real test.
labadie_1
Honored Contributor

Re: Monitor IP ports utility

Steven

Many monitoring tools search for a process name, even with the ugly $ show system/proc=*abcd*.

So this means that if a process, started with a privileged UIC like system, disappears for any reason, and a user, with another Uic, has a process name similar or identical (as long as it is a different uic, it is OK), the monitoring tool, often looping with a delay, will not notice it. And it could last for long, if the user does not disconnect
Nicolau Roca
Advisor

Re: Monitor IP ports utility

Hello

By "monitor" I meant to check if there was a process in a given port and if it responds properly.

The DCL script in htttp://dcl.openvms.org/stories.php?story=03/09/23/7962305 almost suites my needs Iabadie, but I have modified it just to implement a very simple talk with the server across the TNA pseudo-terminal device, as Steven suggested. I also have used as an example a DCL script offered up by Robert Brooks on thread with Subject: Non interactive telnet service, june 19, 2006

This script checks port 25 to see if the SMTP server responds properly

Thank you

$!
$ set noon
$ host = "myhost"
$ port = 25
$!
$! Find an unused TNA (Pseudo-terminal device) unit number
$!
$ unit = 1
$ findtna:
$ if f$getdvi( "tna''unit':", "EXISTS" ) .eqs. "FALSE" then goto tnafound
$ unit = unit + 1
$ goto findtna
$!
$ tnafound:
$ telnet/create 'host 'port 'unit /protocol=telnet
$ if $severity.ne.1
$ then
$ write sys$output "Port ''port' unavailable at ''f$time()' on ''host'"
$!
$! mail or any ...
$ else
$! checking
$ open/read/write myport tna'unit':
$ write myport "help"
$ read myport line
$ close myport
$ show sym line
$ if line.eqs." ..... my text ... "
$ then
$ write sys$output "Port 'port check on 'host successful..."
$ else
$ write sys$output "Port 'port check on 'host unsuccessful !!"
$ endif
$ telnet/delete 'unit
$ endif
$ exit
labadie_1
Honored Contributor

Re: Monitor IP ports utility

Nicolau

May be you could submit your script to dcl.openvms.org, as it may help others ?

Regards

Gerard