Scheduling


#1

Need to perform a check once a day at a specified time. Any way to do
this in sensu at the moment.

Ideally, something like the following would be good.

timeOfDay => 08:00,
interval => 60,
runs => 1,


#2

Hey Matt,

For something like this, I’d use the ‘push’ model. You can create a script in any language you want (see simple bash example https://gist.github.com/nstielau/3797054) to push a JSON check representation to the local sensu-client’s port (3030). Then, you can trigger the script with cron, or Jenkins, or have your script sleep and loop. No other client or server configuration is needed (other than a connected client). Make sure you set the handlers and status fields appropriately.

Cheers

···

On Thursday, May 9, 2013 12:09:31 AM UTC-7, Matt wrote:

Need to perform a check once a day at a specified time. Any way to do

this in sensu at the moment.

Ideally, something like the following would be good.

timeOfDay => 08:00,

interval => 60,

runs => 1,


#3

Thanks Nick.

I’ve tried what you suggested and I see the output in the client log, but nothing in the server log.

I sent:

echo ‘{ “handlers”: [“pagerduty”], “name”: “push_woot_test”, “output”: “woot!”, “status”: 1 }’ | nc -w1 127.0.0.1 3030

To see if the message carried through to PD, but nothing appeared in the server log or PD. Do I need to configure the server to expect the test “push_woot_test” ?

Thanks,

Matt

···

On 9 May 2013 16:37, Nick Stielau nick.stielau@gmail.com wrote:

Hey Matt,

For something like this, I’d use the ‘push’ model. You can create a script in any language you want (see simple bash example https://gist.github.com/nstielau/3797054) to push a JSON check representation to the local sensu-client’s port (3030). Then, you can trigger the script with cron, or Jenkins, or have your script sleep and loop. No other client or server configuration is needed (other than a connected client). Make sure you set the handlers and status fields appropriately.

Cheers

On Thursday, May 9, 2013 12:09:31 AM UTC-7, Matt wrote:

Need to perform a check once a day at a specified time. Any way to do
this in sensu at the moment.

Ideally, something like the following would be good.

timeOfDay => 08:00,
interval => 60,
runs => 1,


#4

My bad, used “status”: 2 - works like a charm!

···

On 30 May 2013 14:27, Matt foomatty@gmail.com wrote:

Thanks Nick.

I’ve tried what you suggested and I see the output in the client log, but nothing in the server log.

I sent:

echo ‘{ “handlers”: [“pagerduty”], “name”: “push_woot_test”, “output”: “woot!”, “status”: 1 }’ | nc -w1 127.0.0.1 3030

To see if the message carried through to PD, but nothing appeared in the server log or PD. Do I need to configure the server to expect the test “push_woot_test” ?

Thanks,

Matt

On 9 May 2013 16:37, Nick Stielau nick.stielau@gmail.com wrote:

Hey Matt,

For something like this, I’d use the ‘push’ model. You can create a script in any language you want (see simple bash example https://gist.github.com/nstielau/3797054) to push a JSON check representation to the local sensu-client’s port (3030). Then, you can trigger the script with cron, or Jenkins, or have your script sleep and loop. No other client or server configuration is needed (other than a connected client). Make sure you set the handlers and status fields appropriately.

Cheers

On Thursday, May 9, 2013 12:09:31 AM UTC-7, Matt wrote:

Need to perform a check once a day at a specified time. Any way to do
this in sensu at the moment.

Ideally, something like the following would be good.

timeOfDay => 08:00,
interval => 60,
runs => 1,


#5