3Com Total Control -Modem Utilization- how many users are on

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Post Reply
FIacusso
Posts: 25
Joined: Fri Jun 17, 2005 11:33 am

3Com Total Control -Modem Utilization- how many users are on

Post by FIacusso »

Hi all,

I have a script that hits all 4 cards on this 3Com dial-up box and counts how many users are active. The end result usually looks like this:

24
96

My question is, how can i transfer this script into Cacti and have it graph how many users are on throughout the day?

Here is my Perl Script: (any steps or info would be perfect)

#Perl SCript - 3Com Test Run

#!c:\Perl\Bin

# perltest.pl
#
# Usage perltest.pl community@IP@slot#
# Example perltest.pl public@172.xx.xx.x

# Modems in use (value1)
# 3Com card capacity (value2)
# Assumes 23 channels are available

# Points to lib installed with MRTG. Modify as needed

use lib "c:\\perl\\lib";

use BER;
use SNMP_util;
use SNMP_Session;

my $community = "public";
my $router = "172.xx.xx.x";


#my($community,$router,$slot) = split /\@/, $ARGV[0];

foreach ($i = 1001;$i <= 1024; $i++) {
$mib1 = "enterprises.429.1.6.9.1.1.2.";
$mib2 = "100";
$mib = $mib1.$i;

($value) = snmpget("$community\@$router","$mib");
print "Query interface $mib = $value\n";
if ($value eq 8) {
$value1=($value1+1);
$value2=($value2+1);
}
else {
$value2=($value2+1);
}
}

foreach ($i = 2001;$i <= 2024; $i++) {
$mib1 = "enterprises.429.1.6.9.1.1.2.";
$mib2 = "200";
$mib = $mib1.$i;

($value) = snmpget("$community\@$router","$mib");
print "Query interface $mib = $value\n";
if ($value eq 8) {
$value1=($value1+1);
$value2=($value2+1);
}
else {
$value2=($value2+1);
}
}

foreach ($i = 3001;$i <= 3024; $i++) {
$mib1 = "enterprises.429.1.6.9.1.1.2.";
$mib2 = "300";
$mib = $mib1.$i;

($value) = snmpget("$community\@$router","$mib");
print "Query interface $mib = $value\n";
if ($value eq 8) {
$value1=($value1+1);
$value2=($value2+1);
}
else {
$value2=($value2+1);
}
}

foreach ($i = 4001;$i <= 4024; $i++) {
$mib1 = "enterprises.429.1.6.9.1.1.2.";
$mib2 = "400";
$mib = $mib1.$i;

($value) = snmpget("$community\@$router","$mib");
print "Query interface $mib = $value\n";
if ($value eq 8) {
$value1=($value1+1);
$value2=($value2+1);
}
else {
$value2=($value2+1);
}
}


if( $value1 eq ''){$value1 = 0 };
if( $value2 eq ''){$value2 = 0 };
print "$value1\n";
print "$value2\n";


--Thank You!!--
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

You need to assign each name to each value the script spits out. So output would look like this: if0:23 if1:56 if2:96 etc.

You can modify the script by doing something like this:

Code: Select all

print "val1:$value1 "; 
print "val2:$value2"; 
Take a read here for any more questions about scripts: http://www.cacti.net/downloads/docs/htm ... cacti.html
FIacusso
Posts: 25
Joined: Fri Jun 17, 2005 11:33 am

Thanks

Post by FIacusso »

Thank you for your help.

I will give it a shot.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests