You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-10Lines changed: 14 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,16 +153,20 @@ Examples:
153
153
| total=2 firing=1 pending=0 inactive=1
154
154
155
155
Flags:
156
-
--exclude-alert stringArray Alerts to ignore. Can be used multiple times and supports regex.
157
-
-h, --help help for alert
158
-
-n, --name strings The name of one or more specific alerts to check.
159
-
This parameter can be repeated e.G.: '--name alert1 --name alert2'
160
-
If no name is given, all alerts will be evaluated
161
-
-g, --group strings The name of one or more specific groups to check.
162
-
This parameter can be repeated e.G.: '--group group1 --group group2'
163
-
If no group is given, all groups will be scanned for alerts
164
-
-T, --no-alerts-state string State to assign when no alerts are found (0, 1, 2, 3, OK, WARNING, CRITICAL, UNKNOWN). If not set this defaults to OK (default "OK")
165
-
-P, --problems Display only alerts which status is not inactive/OK. Note that in combination with the --name flag this might result in no alerts being displayed
156
+
--exclude-alert stringArray Alerts to ignore. Can be used multiple times and supports regex.
157
+
--exclude-label stringArray The label of one or more specific alerts to exclude.
158
+
This parameter can be repeated e.g.: '--exclude-label prio=high --exclude-label another=example'
159
+
-g, --group strings The name of one or more specific groups to check for alerts.
160
+
This parameter can be repeated e.g.: '--group group1 --group group2'
161
+
If no group is given, all groups will be scanned for alerts
162
+
-h, --help help for alert
163
+
--include-label stringArray The label of one or more specific alerts to include.
164
+
This parameter can be repeated e.g.: '--include-label prio=high --include-label another=example'
165
+
-n, --name strings The name of one or more specific alerts to check.
166
+
This parameter can be repeated e.g.: '--name alert1 --name alert2'
167
+
If no name is given, all alerts will be evaluated
168
+
-T, --no-alerts-state string State to assign when no alerts are found (0, 1, 2, 3, OK, WARNING, CRITICAL, UNKNOWN). If not set this defaults to OK (default "OK")
169
+
-P, --problems Display only alerts which status is not inactive/OK. Note that in combination with the --name flag this might result in no alerts being displayed
// If the alert labels matches here we can skip it.
145
+
continue
146
+
}
147
+
129
148
// Handle Inactive Alerts
130
149
iflen(rl.AlertingRule.Alerts) ==0 {
131
150
// Counting states for perfdata
@@ -208,18 +227,27 @@ func init() {
208
227
209
228
fs.StringVarP(&cliAlertConfig.NoAlertsState, "no-alerts-state", "T", "OK", "State to assign when no alerts are found (0, 1, 2, 3, OK, WARNING, CRITICAL, UNKNOWN). If not set this defaults to OK")
210
229
211
-
fs.StringArrayVar(&cliAlertConfig.ExcludeAlerts, "exclude-alert", []string{}, "Alerts to ignore. Can be used multiple times and supports regex.")
0 commit comments