|
From: <dba...@us...> - 2009-09-11 07:06:44
|
Revision: 145
http://devmon.svn.sourceforge.net/devmon/?rev=145&view=rev
Author: dbaldwin
Date: 2009-09-11 07:06:33 +0000 (Fri, 11 Sep 2009)
Log Message:
-----------
dm_snmp.pm fixes
- SNMP max PDU size increased
- ignore more failing repeaters (increase to 6 from 2) to make some templates more tolerant of missing values
- check conn status for host, detect real green status even if conn test blue (disabled)
Modified Paths:
--------------
trunk/modules/dm_snmp.pm
Modified: trunk/modules/dm_snmp.pm
===================================================================
--- trunk/modules/dm_snmp.pm 2009-09-11 06:30:41 UTC (rev 144)
+++ trunk/modules/dm_snmp.pm 2009-09-11 07:06:33 UTC (rev 145)
@@ -36,6 +36,7 @@
use vars qw(%g);
*g = \%dm_config::g;
+ my $max_pdu_len = 16384; # default is 8000
# Set some of our global SNMP variables
$BER::pretty_print_timeticks = 0;
$SNMP_Session::suppress_warnings = 0;
@@ -71,11 +72,13 @@
);
if(defined $sock) {
- print $sock "hobbitdboard test=^conn\$ field=hostname,color";
+ print $sock "hobbitdboard test=^conn\$ fields=hostname,color,line1";
shutdown($sock, 1);
while(<$sock>) {
- my ($device,$test,$color) = split /\|/;
- $g{'hobbit_color'}{$device} = $color;
+ my ($device,$color,$line1) = split /\|/;
+ my ($l1col) = ($line1 =~ /^(\w+)/);
+ do_log("$device has hobbit status $color ($l1col)") if $g{debug};
+ $g{'hobbit_color'}{$device} = $color ne "blue" && $color || $l1col;
}
}
}
@@ -434,10 +437,10 @@
next DEVICE;
}
elsif($snmp_ver eq '1') {
- $session = SNMPv1_Session->open($host, $snmp_cid, $snmp_port);
+ $session = SNMPv1_Session->open($host, $snmp_cid, $snmp_port,$max_pdu_len);
}
elsif($snmp_ver =~ /^2c?$/) {
- $session = SNMPv2c_Session->open($host, $snmp_cid, $snmp_port);
+ $session = SNMPv2c_Session->open($host, $snmp_cid, $snmp_port,$max_pdu_len);
$session->{'use_getbulk'} = 1;
}
@@ -563,7 +566,7 @@
do_log("DEBUG SNMP: Failed queries $failed_query",0) if $g{'debug'};
# We dont want to do every table if we are failing alot of walks
- if($failed_query > 2) {
+ if($failed_query > 6) {
my $error_str =
"Failed too many queries on $dev, aborting query";
$data_out{'error'}{$error_str} = 1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|