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

Unknown : var "icinga.checkInterval" is not registered in SearchlightPlugin #397

Closed
mmta opened this issue Jul 18, 2018 · 1 comment
Closed
Labels

Comments

@mmta
Copy link
Contributor

mmta commented Jul 18, 2018

searchlight isn't generating a correct icinga2 conf for webhook. This is on Version = 7.0.0.

My web hook runs OK like this:

bash-4.3# ./hyperalert check_webhook --check_command="check-ssh" --webhook_url="http://check-ssh.icinga.svc/check-ssh" --key.0="cmd" --val.0="id" --key.2="server" --val.2="k8sworker1c" --icinga.checkInterval=30
OK : uid=0(root) gid=0(root) groups=0(root)

But the config generated by searchlight is:

bash-4.3# cat /etc/icinga2/custom.d/check-ssh.conf
object CheckCommand "check-ssh" {
  import "plugin-check-command"
  command = [ PluginDir + "/hyperalert", "check_webhook"]

  arguments = {
        "--webhook_url" = "http://check-ssh.icinga.svc/check-ssh"
        "--check_command" = "check-ssh"
        "--key.0" = "cmd"
        "--val.0" = "$cmd$"
        "--key.1" = "icinga.checkInterval"
        "--val.1" = "$service.check_interval$"
        "--key.2" = "server"
        "--val.2" = "$server$"
  }
}bash-4.3#

And here's what happen when I try to emulate that CheckCommand. The same message also occurs on the icingaweb2 page (UNKNOWN status).

bash-4.3# ./hyperalert check_webhook --check_command="check-ssh" --webhook_url="http://check-ssh.icinga.svc/check-ssh" --key.0="cmd" --val.0="id" --key.2="server" --val.2="k8sworker1c" --icinga.checkInterval=30 --key.1="icinga.checkInterval" --val.1="30"
*Unknown : var "icinga.checkInterval" is not registered in SearchlightPlugin*
bash-4.3#

So maybe this block needs to exclude icinga.checkInterval?
https://github.com/appscode/searchlight/blob/d5e04e0a6be5c750c659d24a42b6e1742c971daa/pkg/plugin/check_command.go#L87-L90

@tamalsaha tamalsaha added the bug label Jul 18, 2018
@tamalsaha
Copy link
Contributor

Thanks @mmta . If you would like to send a pr, please do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants