Monday, September 30, 2019

Calculating ASA Throughput

  1. copy output of command below to the asaThroughput text file:
    1. show traffic | begin Aggregated Traffic on Physical Interface
  2. delete all traffic statistics for interfaces with "Internal" word
  3. Automatically count bytes in all interfaces statistics:
    1. bytes=$(grep -E "bytes$" asaThroughput  | \
    2. grep -v "0 packets.*0 bytes" | \
    3. awk '{s=s+$3} END {print s}')
  4. select the first appearance of the number of seconds of traffic statistics:
    1. seconds=$(grep -m 1 secs asaThroughput | \
    2. awk '{print $3}' | \
    3. cut -d\. -f 1)
  5. get final result (ASA throughput in Mbps):
    1. echo $((bytes/seconds*8/1024/1024))

No comments:

Post a Comment