Sensu remediation triggering when not required.

Hi,

Sensu remediation getting triggered again and again evem when not required.

check_display.json:

{

“checks”: {

“check_display”: {

“command”: “/etc/sensu/plugins/check-display.rb -p PROC”,

“interval”: 60,

“handlers”: [“remediator”],

“occurrences”: 1,

“standalone”: true,

“refresh”: 60,

“remediation”: {

“light_remediation_display”: {

“occurrences”: [1],

“severities”: [“WARNING”]

}

}

},

“light_remediation_display”: {

“command”: “/etc/sensu/handlers/fixdisplay.rb”,

“standalone”: true,

“interval”: 60,

“publish”: false

}

}

}

I have tried setting severities as 1,2 “ERROR”, OK no change. Is there something missing here?

···

Mishal

The docs say it "severities" is a list of integers:
https://github.com/sensu/sensu-community-plugins/blob/master/handlers/remediation/sensu.rb#L12

It sounds like [1, 2] is correct for this use case.

Can you provide sensu-server or sensu-client logs after changing that
to aid in debugging?

The only other thing I can think of is the subscribers key. The
remediation command should subscribe to nothing ("subscribers": ,)
I don't see that in the config, but I'm pretty sure that is going to
be the default anyway? Doesn't hurt to be explicit that nothing should
be susbcribing to light_remediation_display.

Also the remediation check should not be standalone, it is designed to
be initiated on-demand and not as a standalone check.

Check out the documentation for working example of how to use this
remediation handler if you have not already:
https://github.com/sensu/sensu-community-plugins/blob/master/handlers/remediation/sensu.rb#L26-L63

···

On Thu, Jul 2, 2015 at 8:22 AM, Mishal Dholakia <mishal.dholakia@gmail.com> wrote:

Hi,

Sensu remediation getting triggered again and again evem when not required.

check_display.json:

{

"checks": {

"check_display": {

"command": "/etc/sensu/plugins/check-display.rb -p PROC",

"interval": 60,

"handlers": ["remediator"],

"occurrences": 1,

"standalone": true,

"refresh": 60,

"remediation": {

"light_remediation_display": {

"occurrences": [1],

"severities": ["WARNING"]

}

}

},

"light_remediation_display": {

"command": "/etc/sensu/handlers/fixdisplay.rb",

"standalone": true,

"interval": 60,

"publish": false

}

}

}

I have tried setting severities as 1,2 "ERROR", OK no change. Is there
something missing here?

--

Mishal

I suppose remedition only works with non standalone checks?

See

···

Am Sonntag, 5. Juli 2015 02:46:12 UTC+2 schrieb Kyle Anderson:

The docs say it “severities” is a list of integers:

https://github.com/sensu/sensu-community-plugins/blob/master/handlers/remediation/sensu.rb#L12

It sounds like [1, 2] is correct for this use case.

Can you provide sensu-server or sensu-client logs after changing that

to aid in debugging?

The only other thing I can think of is the subscribers key. The

remediation command should subscribe to nothing (“subscribers”: ,)

I don’t see that in the config, but I’m pretty sure that is going to

be the default anyway? Doesn’t hurt to be explicit that nothing should

be susbcribing to light_remediation_display.

Also the remediation check should not be standalone, it is designed to

be initiated on-demand and not as a standalone check.

Check out the documentation for working example of how to use this

remediation handler if you have not already:

https://github.com/sensu/sensu-community-plugins/blob/master/handlers/remediation/sensu.rb#L26-L63

On Thu, Jul 2, 2015 at 8:22 AM, Mishal Dholakia > > mishal....@gmail.com wrote:

Hi,

Sensu remediation getting triggered again and again evem when not required.

check_display.json:

{

“checks”: {

“check_display”: {

“command”: “/etc/sensu/plugins/check-display.rb -p PROC”,

“interval”: 60,

“handlers”: [“remediator”],

“occurrences”: 1,

“standalone”: true,

“refresh”: 60,

“remediation”: {

“light_remediation_display”: {

“occurrences”: [1],

“severities”: [“WARNING”]

}

}

},

“light_remediation_display”: {

“command”: “/etc/sensu/handlers/fixdisplay.rb”,

“standalone”: true,

“interval”: 60,

“publish”: false

}

}

}

I have tried setting severities as 1,2 “ERROR”, OK no change. Is there

something missing here?

Mishal

As far as I understand it, the "normal" check can be standalone, but
the remediation part must be non-standalone. (because it has to be
triggerable by the sensu server onto the remote host)
This does imply that safemode has to be off.

···

On Wed, Jul 15, 2015 at 1:07 AM, Philipp H <hellmi@gmail.com> wrote:

I suppose remedition only works with non standalone checks?

See
Recovery command for each check · Issue #850 · sensu/sensu · GitHub

Am Sonntag, 5. Juli 2015 02:46:12 UTC+2 schrieb Kyle Anderson:

The docs say it "severities" is a list of integers:

https://github.com/sensu/sensu-community-plugins/blob/master/handlers/remediation/sensu.rb#L12

It sounds like [1, 2] is correct for this use case.

Can you provide sensu-server or sensu-client logs after changing that
to aid in debugging?

The only other thing I can think of is the subscribers key. The
remediation command should subscribe to nothing ("subscribers": ,)
I don't see that in the config, but I'm pretty sure that is going to
be the default anyway? Doesn't hurt to be explicit that nothing should
be susbcribing to light_remediation_display.

Also the remediation check should not be standalone, it is designed to
be initiated on-demand and not as a standalone check.

Check out the documentation for working example of how to use this
remediation handler if you have not already:

https://github.com/sensu/sensu-community-plugins/blob/master/handlers/remediation/sensu.rb#L26-L63

On Thu, Jul 2, 2015 at 8:22 AM, Mishal Dholakia >> <mishal....@gmail.com> wrote:
> Hi,
>
> Sensu remediation getting triggered again and again evem when not
> required.
>
> check_display.json:
>
>
> {
>
> "checks": {
>
> "check_display": {
>
> "command": "/etc/sensu/plugins/check-display.rb -p PROC",
>
> "interval": 60,
>
> "handlers": ["remediator"],
>
> "occurrences": 1,
>
> "standalone": true,
>
> "refresh": 60,
>
> "remediation": {
>
> "light_remediation_display": {
>
> "occurrences": [1],
>
> "severities": ["WARNING"]
>
> }
>
> }
>
> },
>
> "light_remediation_display": {
>
> "command": "/etc/sensu/handlers/fixdisplay.rb",
>
> "standalone": true,
>
> "interval": 60,
>
> "publish": false
>
> }
>
> }
>
> }
>
>
> I have tried setting severities as 1,2 "ERROR", OK no change. Is there
> something missing here?
>
>
> --
>
> Mishal