Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Neat channel monitoring script

A wrote a Perl one-liner that uses the net-snmp "snmpwalk" tool to produce a simple display of ISDN circuits in use. I used it for monitor a E1 voice trunk. Output and script is below.

(As teh script stands, Linux or for Windows Cygwin is required, along with Perl and net-snmp.). If anyone has some other little scripts useful like this please contribute.

12:08:01 *.*........... 2 active

12:08:09 ***........... 3 active

12:08:14 ***......*.... 4 active

12:08:20 ***......*.... 4 active

12:08:26 ***......*.... 4 active

12:08:33 ***.*....*.... 5 active

12:08:39 *.*.*....*.... 4 active

12:08:45 *.*.*....*.... 4 active

12:08:52 *.*.*......... 3 active

12:08:58 *.*.*......... 3 active

12:09:04 *.*.*......... 3 active

12:09:10 ***.*......... 4 active

12:09:16 ***.*......... 4 active

12:09:22 ***.*......... 4 active

12:09:28 ***.*......... 4 active

12:09:34 *...*......... 2 active

( while [ 1 ] ; do snmpwalk -M "" -Ov -c public 172.17.32.1:161 .1.3.6.1.2.1.10.20.1.2.1.1.2 | perl -ne 'BEGIN{($sec,$min,$hour,$rem) = localtime(); printf "%02d:%02d:%02d ",$hour,$min,$sec;$act=0;} if(/4/) { print "*";$act++; }

else {print "."} END{ print " $act active\n";}' ; sleep 5 ; done ) | tee router-isdn-status.txt

167
Views
0
Helpful
0
Replies
CreatePlease to create content