[mrtg] Re: MRTG performance
Tobias Oetiker
oetiker at ee.ethz.ch
Tue May 25 23:57:53 MEST 2004
Hi Pavel,
try this patch ...
--- MRTG_lib.pm~ 2004-05-25 23:48:40.190268000 +0200
+++ MRTG_lib.pm 2004-05-25 23:56:15.083306000 +0200
@@ -1450,7 +1450,7 @@
my $reread = shift;
my $snmpoptions = shift || {};
return if defined $$confcache{$host} and not $reread;
-
+
my $snmp_errlevel = $SNMP_Session::suppress_warnings;
$SNMP_Session::suppress_warnings = 3;
@@ -1466,6 +1466,7 @@
# it seems that some devices only give back sensible data if their tables
# are walked in the right ordere ....
foreach my $node (@nodes) {
+ next if time - $confcache->{___deadhosts}{$host} < 300;
$SNMP_Session::errmsg = undef;
@ret = snmpwalk(v4onlyifnecessary($host, $ipv4only), $snmpoptions, $node);
unless ( $SNMP_Session::errmsg){
@@ -1481,9 +1482,15 @@
}
};
} else {
+ $confcache->{___deadhosts}{$host} = time
+ if $SNMP_Session::errmsg =~ /no response received/;
debug('snpo',"Skipping $node scanning because $host does not seem to support it");
}
}
+ if (time - $confcache->{___deadhosts}{$host} < 300){
+ $SNMP_Session::suppress_warnings = $snmp_errlevel;
+ return;
+ }
$SNMP_Session::errmsg = undef;
@ret = snmpwalk(v4onlyifnecessary($host, $ipv4only), $snmpoptions, "ifPhysAddress");
unless ( $SNMP_Session::errmsg){
cheers
tobi
May 12 Pavel Ruzicka wrote:
> Hi,
>
> > oh I see what is hititng you ... you use reference names for
> > accessing targets and because they do not resolve, mrtg tries to
> > repopulate the cache ... in that case it does currently NOT detect
> > dead hosts ... will look into it ...
> >
> > cheers
> > tobi
>
> It's great information. I will be very grateful, when you implement this
> function ;-)
>
> Best regards,
>
> Pavel Ruzicka
>
> --
> Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
> Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
> Archive http://www.ee.ethz.ch/~slist/rrd-users
> WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
>
--
______ __ _
/_ __/_ / / (_) Oetiker @ ISG.EE, ETZ J97, ETH, CH-8092 Zurich
/ // _ \/ _ \/ / System Manager, Time Lord, Coder, Designer, Coach
/_/ \.__/_.__/_/ http://people.ee.ethz.ch/~oetiker +41(0)44-632-5286
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://www.ee.ethz.ch/~slist/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the mrtg
mailing list