Check Extensions

From the documentation it sounds like the check extensions gives the ability for the check script to see the check object, correct? I see a lot of potential in not having to specify everything on the commandline but rather in the object (i.e. different thresholds for different time periods, logic comparing multiple metrics, etc).

How are check extensions configured? Looking at lib/sensu/client.rb it appears the check can’t define a ‘command’ option, but when excluding it the

validate_check() in settings.rb gives an error that it's missing.

Is there an example of how to use this feature?

Hey Brian,

I’m not sure what you mean by “the ability for the check script to see the check object”. If you’re referring to having the check script read the check configuration, that is available through the ‘settings’ helper, see https://github.com/sensu/sensu-plugin/blob/master/lib/sensu-plugin/utils.rb.

Extension are a way to a add check/mutator/handler functionality to Sensu that runs within the Sensu ruby processes themselves, rather than executables that the sensu processes (server, client) invoke by forking. They are useful for high-throughput use-cases.

Hope that helps.

-Nick

···

On Monday, November 18, 2013 9:04:47 AM UTC-8, Brian Boyd wrote:

From the documentation it sounds like the check extensions gives the ability for the check script to see the check object, correct? I see a lot of potential in not having to specify everything on the commandline but rather in the object (i.e. different thresholds for different time periods, logic comparing multiple metrics, etc).

How are check extensions configured? Looking at lib/sensu/client.rb it appears the check can’t define a ‘command’ option, but when excluding it the

validate_check() in settings.rb gives an error that it's missing.

Is there an example of how to use this feature?

The ‘settings’ is exactly what I was looking for. Thanks Nick.