Python Forum

Full Version: Get inteface information
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

Im new in python and Im looking for a script to check how much traffic is going via an interface and only graba specific info.I need to capture what I have with and compare it to a variable in a txt file.

Thanks in advance for help or guidance.

This is the output
Ethernet0/0 is up, line protocol is up
Hardware is AmdP2, address is aabb.cc00.2000 (bia aabb.cc00.2000)
Internet address is 192.168.1.12/24
MTU 1500 bytes, BW 10000 Kbit/sec, DLY 1000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:00, output 00:00:00, output hang never
Last clearing of "show interface" counters never
Input queue: 1/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 1000 bits/sec, 2 packets/sec
5 minute output rate 1000 bits/sec, 1 packets/sec
925 packets input, 76652 bytes, 0 no buffer
Received 274 broadcasts (0 IP multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 input packets with dribble condition detected
432 packets output, 46177 bytes, 0 underruns
0 output errors, 0 collisions, 1 interface resets
2 unknown protocol drops
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
not sure this is of any help, but take a look: https://pypi.python.org/pypi/habu/0.0.45