3 # This works with Net-SNMP and UCD-SNMP
6 $comm=shift || 'public';
7 $type=shift || 'cisco';
9 $conf='/usr/local/dialup_admin/conf/admin.conf';
11 or die "Could not open configuration file\n";
14 ($key,$val)=(split /:\s*/,$_);
15 $snmp_type = $val if ($key eq 'general_snmp_type');
16 $snmpwalk = $val if ($key eq 'general_snmpwalk_command');
20 die "general_snmp_type directive is not set in admin.conf\n" if ($snmp_type eq '');
21 die "Could not find snmpwalk binary. Please make sure that the \$snmpwalk variable points to the right location\n" if (! -x $snmpwalk);
23 $snmpwalkcmd="$snmpwalk $host $comm" if ($snmp_type = 'ucd');
24 $snmpwalkcmd="$snmpwalk -v 1 -c $comm $host" if ($snmp_type = 'net');
26 if ($type eq 'cisco'){
27 $walk =`$snmpwalkcmd .iso.org.dod.internet.private.enterprises.9.9.150.1.1.3.1.2`;
28 if ($walk =~ /^$/ || $walk =~ /No Such Object/){
29 $walk =`$snmpwalkcmd .iso.org.dod.internet.private.enterprises.9.10.19.1.3.1.1.3`;
30 if ($walk =~ /^$/ || $walk =~ /No Such Object/){
31 $walk =`$snmpwalkcmd .iso.org.dod.internet.private.enterprises.9.2.9.2.1.18`;
35 elsif ($type eq 'lucent'){
36 $walk =`$snmpwalkcmd .iso.org.dod.internet.private.enterprises.529.10.4.1.12`;
38 elsif ($type eq 'usrhiper'){
39 $walk =`$snmpwalkcmd .iso.org.dod.internet.private.enterprises.429.4.10.1.1.18`;
42 while($walk=~/\"([\@\.\w\-]+?)\"/g){