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

Allow remediation on check.pp #560

Closed
gzjon opened this issue Oct 11, 2016 · 6 comments
Closed

Allow remediation on check.pp #560

gzjon opened this issue Oct 11, 2016 · 6 comments
Assignees

Comments

@gzjon
Copy link

gzjon commented Oct 11, 2016

Add remediation to check.pp parameters.

Allowed parameters are:
command
ensure
type
handlers
standalone
interval
occurrences
refresh
source
subscribers
low_flap_threshold
high_flap_threshold
timeout
aggregate
aggregates
handle
publish
dependencies
ttl
subdue

Remediator can be set as a handler but cannot set params:
remediation => {
low_remediation => {
ocurrences => [1,2],
severities => [1],
command => "/bin/bob"
publish => false.
},
...
}
Error 400 on SERVER: Syntax error at 'remediation'

@stevenviola
Copy link

It's not well documented, but I think in the check definition, you can pass a hash to custom, and that will show up as custom data included in each check. I think you would want your check to look like this:

sensu::check { 'check_ntp':
  command => 'PATH=$PATH:/usr/lib/nagios/plugins check_ntp_time -H :::ntp.server::: -w 30 -c 60',
  custom => {
    remediation => {
      low_remediation => {
        occurrences => [1,2],
        severities => [1],
        command => "/bin/bob",
        publish => false,
      } 
    }
  }
}

@cwjohnston
Copy link
Contributor

I believe @stevenviola's comment is correct. Because remediation is not part of the check definition specification, this handler configuration belongs under custom.

@ghoneycutt
Copy link
Collaborator

@Phil-Friderici could you please document this

@cwjohnston
Copy link
Contributor

For clarity, any attribute that's not listed in the check definition specification belongs under custom.

Phil-Friderici added a commit to Phil-Friderici/sensu-puppet that referenced this issue Jul 13, 2017
Use the given example in the spec tests.
Phil-Friderici added a commit to Phil-Friderici/sensu-puppet that referenced this issue Jul 13, 2017
Use the given example in the spec tests.
@Phil-Friderici
Copy link
Collaborator

working on this in PR #739

ghoneycutt added a commit that referenced this issue Jul 13, 2017
(GH-560) Add docs for $sensu::check::custom
@Phil-Friderici
Copy link
Collaborator

this issue can be closed now :)

@gzjon gzjon closed this as completed Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants