Application Delivery Management
Application Modernization & Connectivity
CyberRes
IT Operations Management
netcat localhost 2300
#!/usr/bin/expect -f
# Simple script to handle the output
# Of the NAM 3.1 Console
# William Vera wvera@novell.com
# 20 Feb 2013 - V.002
set timeout -1
# TCL escape character for CTR-C
set ctrl "03\r"
# Output file
log_file -noappend lagstats-app.log
spawn netcat localhost 2300
expect {
-exact "Please enter terminal type:" {
send -- "\r"
exp_continue
}
-exact "Pick a screen:" {
send -- "9\r"
exp_continue
}
-exact "Enter option:" {
send -- "9\r"
exp_continue
}
-exact "Client connection data read timeouts:" {
send $ctrl
}
}
tail -1 lagstats-app.log | sed -e "s/^M//g;s/\x00//g" > final-log.txt
$ cat final-log.txt
Connection Statistics
Total allocated connections 1458
Number of connections in use: 1155
Idle client persistent connections: -599
Idle server persistent connections: 1087
Total allocated send ECBs: 0
Total allocated request blocks: 300
Number of receive ECBs in use: 0
Number of ICP UDP ECBs in use: 0
Number of DNS UDP ECBs in use: 0
Server Received: 34,980,875,094 bytes, Sent: 141,350,429,652 bytes
Client Sent: 34,117,764,984 bytes, Received: 134,399,196,562 bytes
Client data retransmits: 0 Server data retransmits: 0
Server If-Modified-Since requests: 2405665 Not-Modified replies: 2332539
Client If-Modified-Since requests: 24356 Not-Modified replies: 24027
TCP send callback failures: 0
Total connections throttled: 1603
Current connections throttled: 0
Total connections refused: 0
Total requests on persistent connections refused: 0
Server connection data read timeouts: 0
Client connection data read timeouts: 0