Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CheckCommand generation for webhooks #399

Merged
merged 2 commits into from
Aug 3, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pkg/plugin/check_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,15 @@ func GenerateCheckCommand(plugin *api.SearchlightPlugin) string {
flagList = append(flagList, fmt.Sprintf(`"--%s" = "%s"`, check_webhook.FlagWebhookURL, url))
flagList = append(flagList, fmt.Sprintf(`"--%s" = "%s"`, check_webhook.FlagCheckCommand, plugin.Name))

// Arguments in CheckCommand
// Arguments in CheckCommand
for i, f := range args {
flagList = append(flagList, fmt.Sprintf(`"--key.%d" = "%s"`, i, f.key))
flagList = append(flagList, fmt.Sprintf(`"--val.%d" = "%s"`, i, f.val))
if f.key == "icinga.checkInterval" {
flagList = append(flagList, fmt.Sprintf(`"--%s" = "%s"`, f.key, f.val))
} else {
flagList = append(flagList, fmt.Sprintf(`"--key.%d" = "%s"`, i, f.key))
flagList = append(flagList, fmt.Sprintf(`"--val.%d" = "%s"`, i, f.val))
}
}
}

Expand Down