On Mon, May 31, 2010 at 12:27:44PM +0200, Stian Øvrevåge wrote:

> When using edgetrigger alerts the value of the 6. argument calling the
> script is a "1" indicating a raising of the alarm. In the
> documentation it says that when lowering the alert the value is a 0.
> This is not the behaviour I'm observing; I'm observing the script
> being called with only 5 arguments, and thus causing my script to
> treat the alarm as a normal persistent alarm, and not a lowering of an
> incident that has been in progress.

This indeed seems to be a bug. Thanks for reporting it.

Looking at the code, the lower edge will call your script with six
arguments, but the last one is an empty string instead of zero. There is a
difference to the five argument case, and it should be possible to detect
this in your script (for Bourne shell scripts, looking at $# should do.)

That said, does this patch work for you? It should make the behaviour 
conform to the documentation.
-- 
Niko
Index: lib/Smokeping.pm
===================================================================
--- lib/Smokeping.pm	(revision 1090)
+++ lib/Smokeping.pm	(working copy)
@@ -1821,7 +1821,7 @@
                         if ( $addr =~ /^\|(.+)/) {
                         my $cmd = $1;
                         if ($edgetrigger) {
-                                        system $cmd,$_,$line,$loss,$rtt,$tree->{host}, ($what =~/raise/);
+                                        system $cmd,$_,$line,$loss,$rtt,$tree->{host}, ($what =~/raise/ ? 1 : 0);
                         } else {
                                         system $cmd,$_,$line,$loss,$rtt,$tree->{host};
                         }
_______________________________________________
smokeping-users mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/smokeping-users

Reply via email to