Skip to content

Commit abe7ee9

Browse files
committed
[squash]
1 parent 640649b commit abe7ee9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Examples:
153153
| total=2 firing=1 pending=0 inactive=1
154154
155155
Flags:
156-
-S, --state-label-key string Use the given AlertRule label to override the exit state for firing alerts.
156+
-S, --label-key-state string Use the given AlertRule label to override the exit state for firing alerts.
157157
If this flag is set the plugin looks for warning/critical/ok in the provided label key
158158
--exclude-alert stringArray Alerts to ignore. Can be used multiple times and supports regex.
159159
--exclude-label stringArray The label of one or more specific alerts to exclude.
@@ -172,7 +172,7 @@ Flags:
172172
-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
173173
```
174174
175-
The `--state-label-key` can be used to override the exit code for firing alerts.
175+
The `--label-key-state` can be used to override the exit code for firing alerts.
176176
When the flag is set, the plugin looks for the given label key on the AlertRule and uses
177177
the specified as label value (`warning/critical/ok`) as exit code.
178178
An invalid value will result in an UNKNOWN exit code.

cmd/alert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ func init() {
252252
fs.BoolVarP(&cliAlertConfig.ProblemsOnly, "problems", "P", false,
253253
"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")
254254

255-
fs.StringVarP(&cliAlertConfig.StateLabelKey, "state-label-key", "S", "",
255+
fs.StringVarP(&cliAlertConfig.StateLabelKey, "label-key-state", "S", "",
256256
"Use the given AlertRule label to override the exit state for firing alerts."+
257257
"\nIf this flag is set the plugin looks for warning/critical/ok in the provided label key")
258258
}

cmd/alert_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ exit status 2
310310
w.WriteHeader(http.StatusOK)
311311
w.Write(loadTestdata(alertTestDataSet1))
312312
})),
313-
args: []string{"run", "../main.go", "alert", "--state-label-key=icinga"},
313+
args: []string{"run", "../main.go", "alert", "--label-key-state=icinga"},
314314
expected: `[WARNING] - 3 Alerts: 1 Firing - 1 Pending - 1 Inactive
315315
\_ [OK] [HostOutOfMemory] is inactive
316316
\_ [WARNING] [SqlAccessDeniedRate] - Job: [mysql] on Instance: [localhost] is pending - value: 0.40 - {"alertname":"SqlAccessDeniedRate","instance":"localhost","job":"mysql","severity":"warning"}

0 commit comments

Comments
 (0)