#!/bin/ksh # Walk the snmp tree. Works on Tru64 only. # Mario Stargard, sometime 2002. host=$1 # Root of the snmp mib2 tree var=1.3.6.1.2.1 # TCP connections table (netstat -na) with remote IPs #var=1.3.6.1.2.1.6.13.1.4 # UDP connections table (netstat -na) #var=1.3.6.1.2.1.7 # IP table #var=1.3.6.1.2.1.4 # ICMP #var=1.3.6.1.2.1.5 # TCP #var=1.3.6.1.2.1.6 # Digital's subtree #var=1.3.6.1.4.1.36.2.15.2.3 # AIX's Subtree #var=1.3.6.1.4.1.2.3.1.2.1.1.3 # Banyan y2k subtree #var=1.3.6.1.4.1.130.1.3 # Linux Subtree #var=1.3.6.1.4.1.1575.1.5 # Route table #var=1.3.6.1.2.1.4.21 #community=nothing community=public x=$( snmp_request $host $community getnext $var ) while [[ -n $x ]] ; do print $x var=$( print $x | cut -d= -f1 ) # This is necessary because udp is unreliable over long haul networks. # If the request doesn't return within 10 iterations of our loop, # then we kill the request and start a fresh one. Works, but makes our # script very cpu intensive. x=$( snmp_request $host $community getnext $var & count=0 while jobs |grep . > /dev/null ; do print -u2 -n "." if [[ $count -gt 10 ]]; then print -u2 "timed out" kill %% > /dev/null 2>&1 fg snmp_request $host $community getnext $var & count=0 continue fi let count=count+1 done ) done | awk -F\= ' $1 ~ /^1\.3\.6\.1\.2\.1\.1\.1/ { printf("system:description %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.1\.2/ { printf("system:vendors id %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.1\.3/ { printf("system:time since snmp init hundredths of a second %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.1\.4/ { printf("system:contact person %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.1\.5/ { printf("system:nodename %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.1\.6/ { printf("system:location %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.1\.7/ { printf("system:service sum %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.1/ { printf("system %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.1/ { printf("interfaces:number of interfaces %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.10/ { printf("interfaces:interface list:octets received %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.11/ { printf("interfaces:interface list:subnet unicast packets delivered %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.12/ { printf("interfaces:interface list:non-unicast packets delivered %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.13/ { printf("interfaces:interface list:inbound packets without errors discarded %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.14/ { printf("interfaces:interface list:inbound packets with errors discarded %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.15/ { printf("interfaces:interface list:inbound packets of unknown protocol discarded %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.16/ { printf("interfaces:interface list:octets sent %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.17/ { printf("interfaces:interface list:packets destined for unicast %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.18/ { printf("interfaces:interface list:packets destined for non-unicast %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.19/ { printf("interfaces:interface list:outbound packets without errors discarded %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.20/ { printf("interfaces:interface list:outbound packets with errors discarded %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.21/ { printf("interfaces:interface list:length of outbound packet queue in packets %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.22/ { printf("interfaces:interface list:interface MIB reference %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.1/ { printf("interfaces:interface list:unique value %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.2/ { printf("interfaces:interface list:description %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.3/ { if ( $2 == 1 ) TYPE = "other" if ( $2 == 2 ) TYPE = "regular1822" if ( $2 == 3 ) TYPE = "hdh1822" if ( $2 == 4 ) TYPE = "ddn_x25" if ( $2 == 5 ) TYPE = "rfc877_x25" if ( $2 == 6 ) TYPE = "ethernet_csmacd" if ( $2 == 7 ) TYPE = "iso88023_csmacd" if ( $2 == 8 ) TYPE = "iso88024_tokenBus" if ( $2 == 9 ) TYPE = "iso88024_tokenRing" if ( $2 == 10 ) TYPE = "iso88026_man" if ( $2 == 11 ) TYPE = "starLan" if ( $2 == 12 ) TYPE = "proteon_10Mbit" if ( $2 == 13 ) TYPE = "proteon_80Mbit" if ( $2 == 14 ) TYPE = "hyperchannel" if ( $2 == 15 ) TYPE = "fddi" if ( $2 == 16 ) TYPE = "lapb" if ( $2 == 17 ) TYPE = "sdlc" if ( $2 == 18 ) TYPE = "dsl_T1" if ( $2 == 19 ) TYPE = "el_T1" if ( $2 == 20 ) TYPE = "basicISDN" if ( $2 == 21 ) TYPE = "primaryISDN" if ( $2 == 22 ) TYPE = "propPointToPointSerial" if ( $2 == 23 ) TYPE = "ppp" if ( $2 == 24 ) TYPE = "softwareLoopback" if ( $2 == 25 ) TYPE = "eon" if ( $2 == 26 ) TYPE = "ethernet_3Mbit" printf("interfaces:interface list:type %s %s\n", $0, TYPE ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.4/ { printf("interfaces:interface list:largest datagram size octets %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.5/ { printf("interfaces:interface list:bandwidth bits per sec %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.6/ { printf("interfaces:interface list:address below network layer %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.7/ { if ( $2 == 1 ) STATE = "up" if ( $2 == 2 ) STATE = "down" if ( $2 == 3 ) STATE = "testing" printf("interfaces:interface list:desired state %s %s\n", $0, STATE ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.8/ { if ( $2 == 1 ) STATE = "up" if ( $2 == 2 ) STATE = "down" if ( $2 == 3 ) STATE = "testing" printf("interfaces:interface list:current state %s %s\n", $0, STATE ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2\.1\.9/ { printf("interfaces:interface list:interface uptime sec %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2\.2/ { printf("interfaces:interface list %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.2/ { printf("interfaces %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.3\.1\.1\.1/ { printf("addr xlation:interface %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.3\.1\.1\.2/ { printf("addr xlation:physical addr %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.3\.1\.1\.3/ { printf("addr xlation:network addr %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.3/ { printf("addr xlation %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.10/ { printf("ip:datagrams generated by user protocols %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.11/ { printf("ip:output datagrams without problems discarded anyway %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.12/ { printf("ip:output datagrams discarded due to no route %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.13/ { printf("ip:number of seconds fragments await reassembly %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.14/ { printf("ip:number of fragments received needing reassembly %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.15/ { printf("ip:number of fragments successfully reassembled %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.16/ { printf("ip:number of failures detected by IP reassebly algorithm %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.17/ { printf("ip:number of IP datagrams successfully fragmented %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.18/ { printf("ip:number of datagrams could not be fragmented and discarded %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.19/ { printf("ip:number of datagrams fragmented at this host %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.20\.1\.1/ { printf("ip:IP address table:entry\047s informational IP %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.20\.1\.2/ { printf("ip:IP address table:interface index value %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.20\.1\.3/ { printf("ip:IP address table:subnet mask %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.20\.1\.4/ { printf("ip:IP address table:broadcast LSB %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.20\.1\.5/ { printf("ip:IP address table:largest reassemblable datagram size %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.20/ { printf("ip:IP address table %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.21\.1\.10/ { printf("ip:IP route table:seconds since last update %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.21\.1\.11/ { printf("ip:IP route table:route mask %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.21\.1\.12/ { printf("ip:IP route table:alternate5 routing metric %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.21\.1\.13/ { printf("ip:IP route table:route protocol MIB reference %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.21\.1\.1/ { printf("ip:IP route table:dest IP of this route %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.21\.1\.2/ { printf("ip:IP route table:interface index of next route hop %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.21\.1\.3/ { printf("ip:IP route table:primary routing metric %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.21\.1\.4/ { printf("ip:IP route table:alternate2routing metric %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.21\.1\.5/ { printf("ip:IP route table:alternate3 routing metric %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.21\.1\.6/ { printf("ip:IP route table:alternate4 routing metric %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.21\.1\.7/ { printf("ip:IP route table:IP of next hop in route %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.21\.1\.8/ { if ( $2 == 1 ) ROUTETYPE = "other" if ( $2 == 2 ) ROUTETYPE = "invalid" if ( $2 == 3 ) ROUTETYPE = "direct" if ( $2 == 4 ) ROUTETYPE = "indirect" printf("ip:IP route table:IP of next hop in route %s %s\n", $0, ROUTETYPE ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.21\.1\.9/ { if ( $2 == 1 ) ROUTETYPE = "other" if ( $2 == 2 ) ROUTETYPE = "local" if ( $2 == 3 ) ROUTETYPE = "netmgmt" if ( $2 == 4 ) ROUTETYPE = "icmp" if ( $2 == 5 ) ROUTETYPE = "egp" if ( $2 == 6 ) ROUTETYPE = "ggp" if ( $2 == 7 ) ROUTETYPE = "hello" if ( $2 == 8 ) ROUTETYPE = "rip" if ( $2 == 9 ) ROUTETYPE = "is-is" if ( $2 == 10 ) ROUTETYPE = "es-is" if ( $2 == 11 ) ROUTETYPE = "ciscoIgrp" if ( $2 == 12 ) ROUTETYPE = "bbnSpflgp" if ( $2 == 13 ) ROUTETYPE = "ospf" if ( $2 == 14 ) ROUTETYPE = "bgp" printf("ip:IP route table:routing protocol we learned route from %s %s\n", $0, ROUTETYPE ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.21/ { printf("ip:IP route table %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.22\.1\.1/ { printf("ip:arp table:interface index %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.22\.1\.2/ { printf("ip:arp table:physical address %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.22\.1\.3/ { printf("ip:arp table:IP address %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.22\.1\.4/ { if ( $2 == 1 ) ARPTYPE = "other" if ( $2 == 2 ) ARPTYPE = "invalid" if ( $2 == 3 ) ARPTYPE = "dynamic" if ( $2 == 4 ) ARPTYPE = "static" printf("ip:arp table:arp entry type %s %s\n", $0, ARPTYPE ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.22/ { printf("ip:arp table %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.23/ { printf("ip:discarded routes %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.1/ { if ( $2 == 1 ) FORW = "yes" if ( $2 == 2 ) FORW = "no" printf("ip:forwarding %s %s\n", $0, FORW ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.2/ { printf("ip:default TTL %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.3/ { printf("ip:total received datagrams %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.4/ { printf("ip:input datagrams with errors discarded %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.5/ { printf("ip:input datagrams with invalid addresses discarded %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.6/ { printf("ip:input datagrams destined destined for another host %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.7/ { printf("ip:locally addressed datagrams with unknown protocols discarded %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.8/ { printf("ip:input datagrams without problems discarded anyway %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4\.9/ { printf("ip:input datagrams successfully delivered to user protocols %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.4/ { printf("ip %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.10/ { printf("icmp:number of timestamp request messages received %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.11/ { printf("icmp:number of timestamp reply messages received %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.12/ { printf("icmp:number of address mask request messages received %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.13/ { printf("icmp:number of address mask reply messages received %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.14/ { printf("icmp:number of messages attempted to send %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.15/ { printf("icmp:number of messages did not send due to errors %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.16/ { printf("icmp:number of destination unreachable messages sent %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.17/ { printf("icmp:number of time exceeded messages sent %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.18/ { printf("icmp:number of parameter problem messages sent %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.19/ { printf("icmp:number of source quench messages sent %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.20/ { printf("icmp:number of redirect messages sent %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.21/ { printf("icmp:number of echo request messages sent %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.22/ { printf("icmp:number of echo reply messages sent %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.23/ { printf("icmp:number of timestamp request messages sent %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.24/ { printf("icmp:number of timestamp reply messages sent %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.25/ { printf("icmp:number of address mask request messages sent %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.26/ { printf("icmp:number of address mask reply messages sent %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.9/ { printf("icmp:number of echo reply messages received %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.8/ { printf("icmp:number of echo request messages received %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.7/ { printf("icmp:number of redirect messages received %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.6/ { printf("icmp:number of source quench messages received %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.5/ { printf("icmp:number of parameter problem messages received %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.4/ { printf("icmp:number of time exceeded messages received %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.3/ { printf("icmp:number of destination unreachable messages received %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.2/ { printf("icmp:icmp messages with errors %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5\.1/ { printf("icmp:total icmp messages received %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.5/ { printf("icmp %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.10/ { printf("tcp:number of segments received %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.11/ { printf("tcp:number of segments sent, but not retransmit %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.12/ { printf("tcp:number of retransmitted segments sent %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.13\.1\.1/ { if ( $2 == 1 ) THING = "closed" if ( $2 == 2 ) THING = "listen" if ( $2 == 3 ) THING = "synSent" if ( $2 == 4 ) THING = "synReceived" if ( $2 == 5 ) THING = "established" if ( $2 == 6 ) THING = "finWait1" if ( $2 == 7 ) THING = "finWait2" if ( $2 == 8 ) THING = "closeWait" if ( $2 == 9 ) THING = "lastAck" if ( $2 == 10 ) THING = "closing" if ( $2 == 11 ) THING = "timeWait" if ( $2 == 12 ) THING = "deleteTCB" printf("tcp:TCP connection table:state %s %s\n", $0, THING ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.13\.1\.2/ { printf("tcp:TCP connection table:local ip address %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.13\.1\.3/ { printf("tcp:TCP connection table:local port %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.13\.1\.4/ { printf("tcp:TCP connection table:remote ip address %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.13\.1\.5/ { printf("tcp:TCP connection table:remote port %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.13/ { printf("tcp:TCP connection table %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.14/ { printf("tcp:number of segments received in error %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.15/ { printf("tcp:number of segments sent with RST set %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.1/ { if ( $2 == 1 ) THING = "other" if ( $2 == 2 ) THING = "constant -- a constant rto" if ( $2 == 3 ) THING = "rsre -- MIL-STD-1778, Appendix B" if ( $2 == 4 ) THING = "vanj -- Van Jacobson\047s algorithm" printf("tcp:algorithm used for timeout value %s %s\n", $0, THING ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.2/ { printf("tcp:maximum retransmission timeout milliseconds %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.3/ { printf("tcp:maximum retransmission timeout milliseconds %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.4/ { printf("tcp:maximum number of TCP connections supported %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.5/ { printf("tcp:number of direct CLOSED to SYN-SENT state %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.6/ { printf("tcp:number of direct LISTEN to SYN-RCVD state %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.7/ { printf("tcp:number of direct SYN-SENT or SYN-RCVD to CLOSED state %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.8/ { printf("tcp:number of direct ESTABLISHED or CLOSE-WAIT to CLOSED state %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6\.9/ { printf("tcp:number of current ESTABLISHED or CLOSE-WAIT states %s\n", $0 ) ; next} $1 ~ /^1\.3\.6\.1\.2\.1\.6/ { printf("tcp %s\n", $0 ) ; next} { print } '