Opened 15 years ago

Closed 12 years ago

Last modified 10 years ago

#42 closed defect (fixed)

Threshholds program not being called on subsequent over/under threshold alarms

Reported by: human Owned by: somebody
Version: 2.x Keywords: Threshold


I am having an issue with threshold programs only being called on the first threshold violation.

MRTG 2.15.2

I originally had a commented line in the config:

#ThreshDir?: /opt/nms_bin/mrtg

Just to be sure, I removed that line and it still doesn't work.

I use a number of config files included in a master cfg and I don't see any sign of a ThreshDir? statement anywhere, yet I continue to only see the call to the threshold program for the first instance of the threshold being exceeded.

The config:

ThreshProgI[mdlarlcdr_atm2_0.6378_health]: /opt/nms_bin/mrtg/traffic_thresh_detect_in.php ThreshProgO[mdlarlcdr_atm2_0.6378_health]: /opt/nms_bin/mrtg/traffic_thresh_detect_out.php ThreshMaxI[mdlarlcdr_atm2_0.6378_health]: 2450 ThreshMaxO[mdlarlcdr_atm2_0.6378_health]: 2450

Help, please.

Vern Dias

Change History (6)

comment:1 Changed 15 years ago by human

After removing the following statement block:

elsif ( not defined $cfg->{threshhyst} or

($bound eq 'min' and $boundval - $cfg->{threshhyst}* $boundval < $threshval) or ($bound eq 'max' and $boundval + $cfg->{threshhyst}* $boundval > $threshval)

) {

mrtg is now calling thresholds on every exception....

comment:2 Changed 15 years ago by human

I think I found the problem. I've never submitted a bug fix before, so I apologize if there is a better way to do this.

It looks like back in revision 166 a default setting was set for $cfg->{threshhyst} but it breaks logic in MRTG if the user doesn't want to use ThreshDir/ThreshHyst?.

I propose replacing (in, line 687)...

    $cfg->{threshhyst} = 0.1 unless $cfg->{threshhyst};


    # default ThreshHyst to 0.1 only if ThreshDir is defined
    if ($cfg->{threshdir}{
        $cfg->{threshhyst} = 0.1 unless $cfg->{threshhyst};

comment:3 Changed 15 years ago by human

That should read...

    # default ThreshHyst to 0.1 only if ThreshDir is defined
    if ($cfg->{threshdir}){
        $cfg->{threshhyst} = 0.1 unless $cfg->{threshhyst};

I missed a closing parenthesis.

comment:4 Changed 12 years ago by oetiker

thanks. fix is in #331

comment:5 Changed 12 years ago by oetiker

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.

NOTE: The content of this website is accessible with any browser. The graphical design though relies completely on CSS2 styles. If you see this text, this means that your browser does not support CSS2. Consider upgrading to a standard conformant browser like Mozilla Firefox or Opera but also Apple's Safari or KDE's Konqueror for example.