Is there any way to get the status of a TCP port within a program? We need to monitor a specific port to ensure that a communications link is established, and then send a page to the analyst on call when the communications link goes down.
I can view the information with NETSTAT 3 (WRKTCPSTS *CNN), but I need to create a never ending batch process to do the monitoring.
Any help would be appreciated.
Software/Hardware used:
ASKED:
September 29, 2005 12:23 PM
UPDATED:
November 14, 2009 1:00 PM
You might try looking at API QTocRtvNetCnnDta (Retrieve Network Connection Data)in IBM’s Information Centre
WhatsUp Gold is a good inexpensive application that you can purchase that will handle this. Its good in a Windows environment although you can measure any platform with it via SNMP.
Nagios is a good Unix Base application. I believe it is freeware.
ttrish is right.
Just about the only way you can recreate the functionality of netstat option 3 is by calling the API of QTocRtvNetCnnDta….however, Im not that strong with API programming….
ttrish, can u send us a sample source code that will call this API?
What do you mean by “monitoring”? If there’s a program communicating through the port, it knows if it’s communicating or not. What are you expecting something outside the program to do that the program can’t do easier?
And what do you mean by “communications link”? The internet? Or do you have a modem/point-to-point connection or similar?
Please provide some info on what the process is. It’s far too vague so far.
The QTocRtvNetCnnDta API might be appropriate, but there’s no way to know from the info so far. And it’s not a trivial API, especially if you don’t already know sockets programming to help interpret the results. Connections come and go all the time. You don’t want to be alerting an admin every 20 minutes for no good reason.
Tom