This one is a script I found and tweeaked a bit, Original authors are listed =)
Command line is a follows...
tcuser.sh <hparc> <rostring> <card> <span>
hparc is the ip or dns name of the Hyperarc card (NOT the main management adr)
rostring is the Read only communnity string to be used
card is the card / slot you want to monitor
Span, by default is 1, although you may have to telnet inand confirm this.
Heres the script =)
#!/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.
# Slight mods done by Roman De Luna III 4-22-02
# If using E1's vs T1s, change channels to 30
$chanels = 23;
$snmpget = '/usr/bin/snmpget';
# Should not need to make any changes below here.
#
$usage =
"./tcuser.sh 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";
Script to monitor # of users on a Total Control =)
Moderators: Developers, Moderators
Script to monitor # of users on a Total Control =)
If it's only over kill, it's simply underdone...
Who is online
Users browsing this forum: No registered users and 2 guests