Almost forgot, here is a set of Defaults and some example targets. <------------------Defaults----------------> target --default-- hostname = "" short-desc = "Dialup lines in use" card = "" span = "" hipergetprog = "/usr/home/cricket/cricket/util/hiperget" hiperget = "%hipergetprog% %hostname% %snmp-community% %card% %span%" target-type = HiPerARC snmp-community = "public" datasource --default-- rrd-ds-type = GAUGE rrd-heartbeat = 1800 rrd-min = undef rrd-max = undef datasource portsinuse ds-source = EXEC:0:%hiperget% targetType HiPerARC ds = "portsinuse" view = "Ports In Use: portsinuse" html short-desc "3Com HiPerARC" graph --default-- precision = integer graph portsinuse color = dark-green draw-as = AREA y-axis = "Ports in use" legend = "Ports In Use" <----------------targets---------------------> #Monitor an entire chassis. This counts ALL logins, modem, telnet, etc target tc1total hostname = "tc1" target-type = HiperARC short-desc = "All logins on TC1" #Monitor all logins on the dsp in slot 3. target tc1c3 hostname = "tc1" target-type = HiperARC short-desc = "TC1 Card 3" card = "3" #Monitor the second span on the dsp in slot3. target tc1c3s2 hostname = "tc1" target-type = HiperARC short-desc = "TC1 Card 3 Span 2" card = "3" span = "2" On Wed, 18 Apr 2001, Joshua Coombs wrote:
Here is a perl script based on a bash script written by Dave C. at PathWay Computing that will allow you to use cricket to monitor a HiperARC TC at either the chassis, card, or span level. There is some cleanup work left to be done on it, but it is usable as posted. I'll post updates as they are appropriate. If anyone has any comments/etc on this code, please let me know.
Joshua Coombs jcoombs@gwi.net GWI Networking
<--------hiperget---------->
#!/usr/bin/perl
# # Script to walk through SNMP tree and add up total # active modems on a particular chassis, card or span. # # Created 4-17-01 by Joshua Coombs and Ed Howe # Based on a bash script by Dave C.
# If using E1's vs T1s, change channels to 30 $chanels = 23; $snmpget = '/usr/local/bin/snmpget';
# Should not need to make any changes below here. # $usage = "./hiperget hostname comminuty-string [card-number] [span-number]\n";
$hostname = $ARGV[0]; $community = $ARGV[1]; $card = $ARGV[2]; $span = $ARGV[3];
if ( !($hostname) || !($community) ) { die ($usage); }
if ($ARGV[4] ne "") { die ("Modem level reporting not implimented yet.\n"); }
# No card specified. Report stats for the whole chassis, # then exit. # if ($card eq "") { $inuse = `$snmpget $hostname $community .1.3.6.1.4.1.429.4.2.1.10.0 | awk \'\{\ print \$4\ \}\'`; print "$inuse"; exit(0); }
# No span specified. Report stats for a card, # then exit. # if ($span eq "") { $inuse = `$snmpget $hostname $community .1.3.6.1.4.1.429.4.10.35.1.3.${card} | awk \'\{\ print \$3\ \}\'`; print "$inuse"; exit(0); }
# Card and Span specified. Calculate start position # in MIB tree. # $spanstart = 970 + ($card * 256) + ($span *31); $counterend = $spanstart + $chanels; $inuse = 0; $temp = 0;
# Report stats on a span. # while ($spanstart != $counterend) { $temp = `$snmpget $hostname $community .1.3.6.1.4.1.429.4.10.1.1.18.${spanstart} | grep -v \'\=\ \"\"\' | wc -l`; chomp ($temp); $inuse = $temp + $inuse; $spanstart = $spanstart + 1; }
print "$inuse\n";
- To unsubscribe to usr-tc, send an email to "majordomo@xmission.com" with "unsubscribe usr-tc" in the body of the message. For information on digests or retrieving files and old messages send "help" to the same address. Do not use quotes in your message.
- To unsubscribe to usr-tc, send an email to "majordomo@xmission.com" with "unsubscribe usr-tc" in the body of the message. For information on digests or retrieving files and old messages send "help" to the same address. Do not use quotes in your message.