Script to take count of transactions


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to take count of transactions
# 1  
Old 01-17-2012
Script to take count of transactions

Hello All,

I have written a script which i run on admin server to display the count of transaction on rest of the service blades. here is the code

Code:
s=''
if [ $# -gt 0 ]
then
        s=$1
fi

if [ "$s" = "-s" ]
then
        TPS=`on tswebpxmp1 snmpget -c public -v 2c 127.0.0.1:1610  1.3.6.1.4.1.12702.9.2.6.2.0 | grep Counter64 | sed -e's;^.*Counter64: ;;'`
        RSTRT=`on tswebpxmp1 snmpget -c public -v 2c 127.0.0.1:1610  1.3.6.1.4.1.12702.9.2.11.2.0 | grep Counter64 | sed -e's;^.*Counter64: ;;'`
        RSTOP=`on tswebpxmp1 snmpget -c public -v 2c 127.0.0.1:1610  1.3.6.1.4.1.12702.9.2.12.2.0 | grep Counter64 | sed -e's;^.*Counter64: ;;'`
        echo "`date +'%H:%Mh     Traffic  TPS: '`" $TPS
        echo "`date +'%H:%Mh Radius Start/sec: '`" $RSTRT
        echo "`date +'%H:%Mh Radius Stopp/sec: '`" $RSTOP
else
        TPS=`on tswebpxmp1 snmpget -c public -v 2c 127.0.0.1:1610  1.3.6.1.4.1.12702.9.2.6.2.0 | grep Counter64 | sed -e's;^.*Counter64: ;;'`
        PTPS=`on tswebpxmp1 snmpget -c public -v 2c 127.0.0.1:1610  1.3.6.1.4.1.12702.9.2.3.2.0 | grep Counter64 | sed -e's;^.*Counter64: ;;'`
        TTPS=`on tswebpxmp1 snmpget -c public -v 2c 127.0.0.1:1610  1.3.6.1.4.1.12702.9.2.8.2.0 | grep Counter64 | sed -e's;^.*Counter64: ;;'`
        WTPS=`on tswebpxmp1 snmpget -c public -v 2c 127.0.0.1:1610  1.3.6.1.4.1.12702.9.2.14.2.0 | grep Counter64 | sed -e's;^.*Counter64: ;;'`
        RSTRT=`on tswebpxmp1 snmpget -c public -v 2c 127.0.0.1:1610  1.3.6.1.4.1.12702.9.2.11.2.0 | grep Counter64 | sed -e's;^.*Counter64: ;;'`
        RSTOP=`on tswebpxmp1 snmpget -c public -v 2c 127.0.0.1:1610  1.3.6.1.4.1.12702.9.2.12.2.0 | grep Counter64 | sed -e's;^.*Counter64: ;;'`
        echo "`date +'%H:%Mh        Total TPS: '`" $TPS
        echo "`date +'%H:%Mh  Transparent TPS: '`" $TTPS
        echo "`date +'%H:%Mh        Proxy TPS: '`" $PTPS
        echo "`date +'%H:%Mh         WAP1 TPS: '`" $WTPS
        echo "`date +'%H:%Mh Radius Start/sec: '`" $RSTRT
        echo "`date +'%H:%Mh Radius Stopp/sec: '`" $RSTOP
fi

It actually get the value through snmpget command. The output is as below.

[xmp@tswebpxmpadmin bin]$ curtps
13:48h Total TPS: 6673
13:48h Transparent TPS: 5236
13:48h Proxy TPS: 1080
13:48h WAP1 TPS: 0
13:48h Radius Start/sec: 71
13:48h Radius Stopp/sec: 73


The above value of Total TPS is for all service blades. Now i want a script to show details about each blade. i.e. number of transactions each blades are handling. Any help is appreciated.


-Siddhesh.K
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Character Count in script

#!/bin/ksh read name read mobile echo $name | wc -m Nunberchar=`echo $name |wc -m` echo $Nunberchar I write something above, however the char count is wrong, it always count the $ , how to avoid it ? (5 Replies)
Discussion started by: sakurai2601
5 Replies

2. Shell Programming and Scripting

Word Count In A Script

I am in need of a basic format to 1. list all files in a directory 2. list the # of lines in each file 3. list the # of words in each file If someone could give me a basic format i would appreicate it ***ALSO i can not use the FIND command*** (4 Replies)
Discussion started by: domdom110
4 Replies

3. Shell Programming and Scripting

I am having trouble with this count script

I have to display the file name followed by the line count then work count. I am able to display it in the opposite order, but can figure out how to switch it. Can anyone help me with this it would be greatly appreciated. My code is as follows: #!/bin/bash # #Conts and displays the... (5 Replies)
Discussion started by: football12345
5 Replies

4. UNIX for Advanced & Expert Users

Need to get the time difference for all the transactions in a day

Hello Experts, I need to evaluate my API performance, so need a script to get the time difference for all the transaction that has gone through my application in a day. The challenge is the multi threaded logs, so I cant just get all the Telephone Numbers and check the entering and existing... (5 Replies)
Discussion started by: samjna
5 Replies

5. Shell Programming and Scripting

Help identifying transactions with no detail lines

Wondering if someone can help with my task of identifying missing detail lines in transactions. I have a flat file that contains transaction header, transaction detail, and transaction trailer lines. These lines are identified with a 5-character line identifier "THEAD", "TDETL", and "TTAIL" at... (2 Replies)
Discussion started by: rookie12
2 Replies

6. Shell Programming and Scripting

script to take row count

hi i am pretty new to unix .i am ETL guy I need a unix script to take row count of a file and write it to another file the problem with wc-l is it include filename also wc -l abc.dat will give me like 1000 abc.dat i just want 1000 to be written can u just take 2 min to write a simple... (5 Replies)
Discussion started by: er_zeeshan05
5 Replies

7. HP-UX

count commas in a script

I've a text file which is delimeted by a comma. But there are some commas in side a quoted string. For ex: My file a1.txt contains: "ab,bef",a,b,1,2,"abcde",0, If you look at the above line, the shell script should give me a count of commas which is 7 according to the above example.... (2 Replies)
Discussion started by: obedkhan
2 Replies
Login or Register to Ask a Question