Operating System - OpenVMS
1753902 Members
9476 Online
108810 Solutions
New Discussion

Monitoring network traffic?

 
SOLVED
Go to solution
Sebastian Bazley
Regular Advisor

Re: Monitoring network traffic?

Same with VMS 7.3-2 - the counts do not seem to increase for TCPIP SHO DEV BGnnn.

However the system command

$ SHOW DEVICE BGnnnn /FULL

does show the I/Os.
labadie_1
Honored Contributor

Re: Monitoring network traffic?

Some formatting with awk.

Do
$ set term/wid=132
$ gawk :== $ sys$common:[syshlp.examples.tcpip.snmp]gawk.exe

then
$ cre a.awk
ty l.awk
BEGIN { format = "%-107s"
printf format, "Device | type | ploc | prem | host local | host remote | b
ytes rec| bytes sent| I/O rec | I/O sen |\n"
printf format, "________________________________________________________________
__________________________________________\n"}
/Device_socket/ {dev=$2; typ=$4}
/Port:/ {plocal=$(NF-1); pdist=$NF}
/Host/ {hlocal=$2; hdist=$3}
/Bytes/ {bytest=$3; bytesr=$4}
/O completed/ {iot=$(NF-1); ior=$NF ;
{printf("%-7s,%-8s,%5d,%5d,%16s,%16s,%10d,%10d,%10d,%10d\n",dev,typ,plocal,pdist
,hlocal,hdist,bytest,bytesr,iot,ior)}}
END { format = "%-107s"
printf format, "Device | type | ploc | prem | host local | host remote | b
ytes rec| bytes sent| I/O rec | I/O sen |\n"
printf format, "________________________________________________________________
__________________________________________"}


Then the command

$ pipe wr sys$output "tcpip sh dev bg/fu" | ana/sys | sea sys$pipe "Device_socket","Bytes",Service,Host,port,comp
leted | gawk/input=l.awk sys$pipe

gives some stats

You can add a sort at the end, for example

$ pipe wr sys$output "tcpip sh dev bg/fu" | ana/sys | sea sys$pipe "Device_socket"
,"Bytes",Service,Host,port,comp
leted | gawk/input=l.awk sys$pipe | sort/key=(pos:64,size:10,asc) sys$pipe sys$output

will show the bg device stats with the most bytes received at the end of the display.

replace ,asc) by ,des) in the previous command and you will have the most at the beginning of the display

To sort on the I/O received, use
/key=(pos:85,size=10)

There is a buglet at the moment with the formatting lines being both at the beginning or the end of the display after the sort.
:-(

This hack could be modified with the pid of the bg device - just f$getdvi("bg123","pid") and/or the processname on the bg device - f$getjpi(f$getdvi("bg123","pid"),"prcnam")

Have fun !