File tree 2 files changed +7
-1
lines changed 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -89,20 +89,25 @@ func (checker *Checker) checkRecord(record CollectdRecord) ([]shared.CheckResult
89
89
}
90
90
91
91
// Load host specific thresholds
92
+ priority := 0
92
93
for pattern , threshold := range rule .Check .HostThresholds {
93
94
if threshold .Regexp == nil {
94
95
continue
95
96
}
96
97
98
+ if threshold .Priority < priority {
99
+ continue
100
+ }
101
+
97
102
if ! threshold .Regexp .MatchString (record .Host ) {
98
103
continue
99
104
}
100
105
101
106
matchName = fmt .Sprintf ("host:%s" , pattern )
102
107
108
+ priority = threshold .Priority
103
109
critical = threshold .Critical
104
110
warning = threshold .Warning
105
- break
106
111
}
107
112
108
113
// CRITICAL CHECK
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ const (
24
24
type CheckThreshold struct {
25
25
WarningTpl string `hcl:"warning"`
26
26
CriticalTpl string `hcl:"critical"`
27
+ Priority int `hcl:"priority"`
27
28
Warning hil.EvaluationResult `hcl:"-"`
28
29
Critical hil.EvaluationResult `hcl:"-"`
29
30
Regexp * regexp.Regexp `hcl:"-"`
You can’t perform that action at this time.
0 commit comments