Showconn and abortcon utilities |
|||||||||||||||||||||||
|
This software is provided "as is". use it at your own risk!System requirements
Usage - syntaxShowing connectionsTo find out about all possible options for the command, have a look into the command file (SHOWCONN) itself. The syntax for the command is about the following:SHOWCONN [ [JOB=] {jobspec }] {jobspec [,jobspec ]...} [ [;SYSTEM= [ON|OFF]] ] [ [;NAME= [ON|OFF]] ] [ [;PIN=]{pinspec}] [ [;HELP= [ON|OFF]] ] [ [;SUMMARY= [ON|OFF]] ] [ [;VERSION= [ON|OFF]] ] ... Aborting/killing connectionsAnother feature of the same utility can be invoked through a use of a newer version of the program and a new command file called "abortcon":ABORTCON [ [PIN=]{pinspec} [VERSION= [ON|OFF]] ] Usage - samplesOnce installed in place, the utility is invoked by simply typing:SHOWCONNBy default, all the sockets in the callers session process family are displayed: :showconn JOBNUM INTRO DATE AND TIME LDEV USERNAME REMOTE ADDRESS RPORT LPORT FLAGS PIN(PROGRAM) #S100 THU AUG 3 1995 21:44 31 MGR.TELESUP,PATCHXL 12.34.56.91 33335 vt utcind 113(VTSERVER.NET.SYS) Total processes checked: 4 Processes with sockets : 1 Total sockets open : 1 IP-addresses VS. node namesTo translate IP-addresses to node names, make sure that the system has DNS resolver configured and that your nameserver is responding. Once it works, nodenames can be resolved by simply adding the keyword "name" as the third positional parameter - or using alternate syntax "name=on" - or by changing the default in SHOWCONN-script to be display nodenames.:showconn;;name JOBNUM INTRO DATE AND TIME LDEV USERNAME REMOTE ADDRESS RPORT LPORT FLAGS PIN(PROGRAM) DNS-NODENAME #S100 THU AUG 3 1995 21:44 31 MGR.TELESUP,PATCHXL 12.34.56.78 33335 vt utcind 113(VTSERVER.NET.SYS) sysname.cup.hp.com Total processes checked: 4 Processes with sockets : 1 Total sockets open : 1 Aborting a network connection:showconn s46 JOBNUM INTRO DATE AND TIME LDEV USERNAME REMOTE ADDRESS RPORT LPORT FLAGS PIN(PROGRAM) #S46 THU MAR 21 1996 16:14 2 MANAGER.SYS,PUB 15.13.195.50 35568 vt utcind 44(VTSERVER.NET.SYS) Total processes checked: 3 Processes with sockets : 1 Total sockets open : 1 :abortcon pin=44 16:14/#S46/64/LOGOFF ON LDEV #2. ** NS/3000 NetIPC ERROR IN VT; Job: #S46; PIN: 44; Info: 1 - Error: 39;I.e., in most cases the connection aborts just fine and the session logs off. However, ocassionally you may also see the following behaviour: :showconn JOBNUM INTRO DATE AND TIME LDEV USERNAME REMOTE ADDRESS RPORT LPORT FLAGS PIN(PROGRAM) #S47 THU MAR 21 1996 16:19 2 MANAGER.SYS,PUB 15.13.195.50 35578 vt utcind 66(VTSERVER.NET.SYS) 15.28.88.182 vt 32773 utcond 57(VTSERVER.NET.SYS) Total processes checked: 5 Processes with sockets : 2 Total sockets open : 2 :abortcon 57 :showconn JOBNUM INTRO DATE AND TIME LDEV USERNAME REMOTE ADDRESS RPORT LPORT FLAGS PIN(PROGRAM) #S47 THU MAR 21 1996 16:19 2 MANAGER.SYS,PUB 15.13.195.50 35578 vt utcind 66(VTSERVER.NET.SYS) 15.28.88.182 vt 32773 utcona 57(VTSERVER.NET.SYS) Total processes checked: 5 Processes with sockets : 2 Total sockets open : 2I.e. it may seem that nothing happened. This is a case where the application (in this case VTSERVER) is not reading the network socket and thus did not get notified of an error (well, the message is there but he hasn't seen it yet). If you have a close look, you will notice that the socket FLAGS changed. At first execution of SHOWCONN, the flags were "utcond", i.e. user process, TCP connection socket, outgoing connection, netipc socket and in duplex open state. After ABORTCON, the second SHOWCONN shows the same with the exception that the socket state has changed from "duplex open" to "connection aborted" state. As soon as the user does something that tries to use the the socket, the vtserver will see the error and terminate. Required MPE user capabilities
:showconn;system JOBNUM INTRO DATE AND TIME LDEV USERNAME REMOTE ADDRESS RPORT LPORT FLAGS PIN(PROGRAM) system process sockrg spl-nu 57(SOCKREG.NET.SYS) system process vtr stl-nt 59(DSDAD.NET.SYS) rpm stl-nt 59(DSDAD.NET.SYS) vt stl-nt 59(DSDAD.NET.SYS) ptop stl-nt 59(DSDAD.NET.SYS) vta stl-nt 59(DSDAD.NET.SYS) hpip stl-nt 59(DSDAD.NET.SYS) rfa stl-nt 59(DSDAD.NET.SYS) nsstat stl-nt 59(DSDAD.NET.SYS) nft stl-nt 59(DSDAD.NET.SYS) loopbk stl-nt 59(DSDAD.NET.SYS) system process 127.0.0.1 32885 vt stcind 66(VTSERVER.NET.SYS) system process 127.0.0.1 32886 vt stcind 92(VTSERVER.NET.SYS) #S79 THU AUG 3 1995 11: 6 30 MANAGER.SYS,PUB 12.34.56.222 39846 vt utcind 45(VTSERVER.NET.SYS) #S47 WED AUG 2 1995 20:29 32 MANAGER.SYS,PUB 12.13.111.22 1428 ftpcmd utcind 60(FTPSRVR.ARPA.SYS) #S10 WED AUG 2 1995 16:23 34 EERO,MANAGER.SYS,PUB 12.13.111.44 1317 vta utcind 74(VTSERVER.NET.SYS) 12.111.22.33 vt 32867 utcond 77(VTSERVER.NET.SYS) 127.0.0.1 vt 32873 utcond 87(VTSERVER.NET.SYS) 12.43.123.23 vt 32875 utcond 85(VTSERVER.NET.SYS) 127.0.0.1 vt 32885 utcond 78(VTSERVER.NET.SYS) 127.0.0.1 vt 32886 utcond 82(VTSERVER.NET.SYS) 127.0.0.1 vt 32887 utcond 94(VTSERVER.NET.SYS) 12.34.56.78 vt 32900 utcond 118(VTSERVER.NET.SYS) #S20 WED AUG 2 1995 18: 9 35 MANAGER.SYS,PUB 127.0.0.1 32873 vt utcind 86(VTSERVER.NET.SYS) #S100 THU AUG 3 1995 21:44 31 MGR.TELESUP,PATCHXL 12.34.56.33 33335 vt utcind 113(VTSERVER.NET.SYS) #J1 WED AUG 2 1995 16:57 10 FTPMON,FTP.SYS,ARPA ftpcmd atl-nt 80(FTPMON.ARPA.SYS) #J2 WED AUG 2 1995 17:38 10 HTTPD,MGR.WWW,PUB 80 atl-bt 79(HTTPDC.BIN.WWW) detached process snmp dud-nb 55(SNMP.NET.SYS) snmptr dud-nb 55(SNMP.NET.SYS) Total processes checked: 97 Processes with sockets : 19 Total sockets open : 29 Flags-columnTo decode all the flags in FLAGS-column, type::showconn help=on FLAGS column usage: Column 1 (process type): a: Application (1st son of a CI) u: User process (not the 1st son of a CI) c: CI process t: Task process s: System process d: Detached process j: JSMAIN process o: Other (unknown process type) Column 2 (protocol): t: TCP protocol u: UDP protocol p: PXP protocol Column 3 (socket type): l: Listening socket (call socket) c: Connection socket d: Datagram (UDP) socket Column 4 (direction): o: Outgoing connection (initiated by this process) i: Incoming connection (received by this process) -: No connection, listening socket Column 5 (API in use): n: NetIPC socket b: BSD socket Column 6 (socket state): u: Undefined = undefined state z: initialiZed = connection doesn't exist c: Connecting = ipcconnect called, wait for ipcrecv w: Wait_confirm = ipcrecvcn done, user must accept/reject d: Duplex_open = connected, can send and recv data i: simplex_In = graceful close, can only receive o: simplex_Out = received graceful close, send only l: cLosed = both parties closed, user must shut a: conn_Aborted = connection aborted, user must shut b: Bound = socket is bound to an address t: lisTening = sk_listen has been called s: Shut = sock shutdown or encountered an error g: linGering = sock shutdown lingering pending Pin-parameterOr, to zoom in a process and have as much info as this utility can give on a process, use the PIN-parameter::showconn pin=230 pin(program) : 230(VTSERVER.NET.SYS) pin re-use count: 131 ldev/job/session: 74 #S2543 ,EERO.ARPAXL,LAURILA scheduling info : CS priority 152 cpu time used : 29032 msec process type : USR start time : TUE OCT 24 1995 20:25:28.4 sockets in use : 1 ============ SOCKET #1 ============ local ip address : 12.34.56.78 node name : node1.cup.hp.com socket address: vt (1537) socket type : connection socket socket protocl: TCP socket state : Connected, can send and recv data socket flags select supported : FALSE BSD socket : FALSE catch all flag : FALSE tcp msg mode : TRUE connection initiator: FALSE remote ip address : 12.34.56.79 node name : node2.cup.hp.com socket address: 1229 Total processes checked: 1 Processes with sockets : 1 Total sockets open : 1 CI-variablesTo make it easier to use this utility from a job, showconn will set a bunch of CI-variables to indicate the status of the last command execution. This way the user does not need to redirect command output into a file and then parse it's contents to figure out what happened. CI-variables set are: :showconn JOBNUM INTRO DATE AND TIME LDEV USERNAME REMOTE ADDRESS RPORT LPORT FLAGS PIN(PROGRAM) #S2543 TUE OCT 24 1995 20:25 74 EERO.ARPAXL,LAURILA 12.34.123.45 1229 vt utcind 230(VTSERVER.NET.SYS) Total processes checked: 9 Processes with sockets : 1 Total sockets open : 1 :showvar HPSCSCRIPTVERSION = A.02.00.001 HPSCVERSION = A.01.00.000 HPSCERR = 0 HPSCERRTXT = HPSCNUMPROCS = 9 HPSCNUMSOCKETS = 1 HPSCNUMSOCKOWNERS = 1 :showconn job=#j1 Job number #J1 does not exist. (SC ERROR 16) :showvar HPSCSCRIPTVERSION = A.02.00.001 HPSCVERSION = A.01.00.000 HPSCERR = 16 HPSCERRTXT = Job number #J1 does not exist. (SC ERROR 16) HPSCNUMPROCS = 0 HPSCNUMSOCKETS = 0 HPSCNUMSOCKOWNERS = 0 ComponentsThere are two components to this utility. One is the command file SHOWCONN, which will take users command parameters and massage them into one string variable, info. The second component is a program file "SC", which gets invoked by the command file, which passes users parms in an info string to the program. Note that there are two versions of the program and although externally they appear (almost) the same, the biggest internal difference is the fact that the 5.0 version of "SC"-program file calls some system internal routines directly since AIFPROCGET item 2149 does not exist on 5.0. The 5.5 version works without making direct system calls as the AIFPROCGET item 2149 is there. By not calling internal system routines I can also provide the source for the 5.5 version. Feel free to improve the command - you've got the source! Version numbers for SHOWCONN, ABORTCON scripts and the SC-program file:
Installation instructionsTo install these utilities, copy the appropriate version to your machine and use mover to unpack the truck-file. For both 5.0 and 5.5 versions you'll receive the SHOWCONN and ABORTCON command files and the SC-program file (5.5 version has some additional stuff). If you copy the command files (SHOWCONN and ABORTCON) and the SC-program file to some location that is on everyone's default command execution search path (see HPPATH variable) - and the program file is in location that everyone has execute access to, the commands will start working right away for all users. No re-boots, nothing. You may want to consider who'll you allow to use ABORTCON. For example, all files could go in PUB.SYS on your machine. If the program file resides in some other group than what is in HPPATH, the command files needs to be edited to point to the program file. Of course, in case of any of these filenames collides with an alredy existing program/command file/ UDC etc., appropriate renames and edits have to be done.To download the SHOWCONN/ABORTCON package, click
|