Ticket #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 |
| Cc: |
Description
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
comment:2 Changed 4 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 MRTG_lib.pm, line 687)...
$cfg->{threshhyst} = 0.1 unless $cfg->{threshhyst};
with...
# default ThreshHyst to 0.1 only if ThreshDir is defined
if ($cfg->{threshdir}{
$cfg->{threshhyst} = 0.1 unless $cfg->{threshhyst};
}


After removing the following statement block:
elsif ( not defined $cfg->{threshhyst} or
mrtg is now calling thresholds on every exception....