local sensu check

If I fire of a check on a local machine to localhost:3030, usually
with cron for scheduling. Is there any way to set the handler? at the
moment the server sends to the default handler.

Thanks,

Matt

Matt,

Check out this gist for an example. The “handlers” key maps to the array of handlers you want to run.

Hope that helps,

Jake

···

On Wed, Jan 29, 2014 at 1:46 PM, Matt foomatty@gmail.com wrote:

If I fire of a check on a local machine to localhost:3030, usually

with cron for scheduling. Is there any way to set the handler? at the

moment the server sends to the default handler.

Thanks,

Matt

You should be able to set the handler in the json you are sending to
localhost:3030

As far as I can tell the data of the "check" part doesn't strip the
handler part in any way, kinda jut publishes the result as-is after
adding the client name:
https://github.com/sensu/sensu/blob/master/lib/sensu/socket.rb#L34

So setting the handler according to the check part of the hash like:
http://sensuapp.org/docs/0.12/events

Should work.

···

On Wed, Jan 29, 2014 at 5:46 AM, Matt <foomatty@gmail.com> wrote:

If I fire of a check on a local machine to localhost:3030, usually
with cron for scheduling. Is there any way to set the handler? at the
moment the server sends to the default handler.

Thanks,

Matt

Of course guys, yep I can write it to the socket.
sock.write "{ \"handlers\": [\"#{handler}\"], \"name\": \"#{name}\",
\"output\": \"#{msg}\", \"status\": #{status} }"

···

On 30 January 2014 04:01, Kyle Anderson <kyle@xkyle.com> wrote:

You should be able to set the handler in the json you are sending to
localhost:3030

As far as I can tell the data of the "check" part doesn't strip the
handler part in any way, kinda jut publishes the result as-is after
adding the client name:
https://github.com/sensu/sensu/blob/master/lib/sensu/socket.rb#L34

So setting the handler according to the check part of the hash like:
http://sensuapp.org/docs/0.12/events

Should work.

On Wed, Jan 29, 2014 at 5:46 AM, Matt <foomatty@gmail.com> wrote:

If I fire of a check on a local machine to localhost:3030, usually
with cron for scheduling. Is there any way to set the handler? at the
moment the server sends to the default handler.

Thanks,

Matt