Hi David,

This is part of the snmptrap2mon script I use:

---
my $status = $opt_u ? 'ok' : 'fail' ;
my $retval = $opt_u ? 0 : 1 ;

$t = $mon->send_trap(group => $watch,
                     service => $service,
                     retval => $retval,
                     opstatus => $status,
                     summary => $summary,
                     detail => $detail,
                     );
---

SNMP linkUp traps are translated with the -u flag and linkDown traps without 
that flag. Simulating a
flap by sending mon traps with snmptrap2mon ( snmptrap2mon & snmptrap2mon -u) 
does not generate an
alert when 3 flaps occur during 30 secs.

I've just tested it and, by not sending the linkUp trap and using the option 
trapduration on the
right place, makes mon to keep the service down for 30 secs and, after the trap 
timer expires,
changes the service to OK (green on moncgi), which is the behaviour I was 
expecting.

Regards,
Emilio

> 
> 
> --On Thursday, August 24, 2006 13:58:49 +0200 Emilio Mira Alfaro 
> <[EMAIL PROTECTED]> wrote:
> 
> > Hi list,
> >
> > I'm trying to configure mon to alert when one of our routers interfaces
> > flaps 3 times during 30 secs.  I also would like mon not to send more
> > than 1 alert every 30 minutes I came up with this config:
> >
> > watch mad_log_flapping
> >     service path_a
> >         description flapping on path_a
> >         period wd {Mon-Sun}
> >             alertafter 3 30s
> >             alertevery 30m
> >             #trapduration 30s
> >             alert mail.alert <email_address>
> >
> > I'm redirecting SNMP traps from the router to mon using snmptrap2mon.pl .
> > The thing is that if I redirect linkUp and linkDown traps, the service
> > never come down and mon never sends and alert even when there are more
> > than 2 transitions (linkDown & linkUp). If only linkDown traps are
> > redirected, mon sends the alerts as it should but the services is always
> > down (it shows up on red on moncgi) after a flapping occurs, which
> > bothers me. This is mainly because no linkUp traps are redirected. I've
> > tried option "trapduration 30s" but on the lastet CVS release mon
> > complains with "unknown syntax [trapduration 30s], line 59".
> >
> 
> 
> trapduration is a configuration option that belongs in a service 
> definition, but outside of a period definition.  The current Mon code is 
> much more strict about options that are misplaced, where earlier versions 
> would just ignore those options.
> 
> 
> > I'd like to have the service on green while there is no flapping and, if
> > there is flapping (3 interface transitions during 30 secs), put in on red
> > during 30 min and bring it back to green if no more flapping happens.
> >
> 
> trapduration won't quite get you this behavior.  When the trap status 
> expires the service will go back to the untested state, not the OK state. 
> This may be acceptable to you...
> 
> To get the behavior you describe you need to make snmptrap2mon.pl to send a 
> mon trap with status OK for linkUp traps, I suspect its currently sending 
> failure alerts for both linkDown and linkUp traps.
> 
> -David
> 
> 
> 
> 


--
Emilio Mira
e-mail: [EMAIL PROTECTED]
------------------------------------------------------
"Sure UNIX is user friendly; it's just picky about who
its friends are."
------------------------------------------------------




_______________________________________________
mon mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/mon

Reply via email to