Sensu Go - cron job with execute every 10 seconds

Hi,

I’m using the sensu go and want to build some cron check running every 10 seconds,
is there a way to implement it?

As references:
I find two ways for running a cron job based on second, does any of these is workable? If not, I’m willing to contribute to implement this feature in the source code.
way1:
command: “helloworld.rb”
cron: “* 11-17 * * * (sleep 10)”
way2:
command: “cnt=0; while(( $cnt < 6 )); do helloworld.rb; sleep 10; ((cnt++)); done”
cron: "* 11-17 * * * "

Hope get your feedback and suggestion, sensu goer! Thank you!

Hi @melw

Is there any reason why you can’t use interval scheduling (https://docs.sensu.io/sensu-go/latest/reference/checks/#interval-scheduling) with a 10 seconds interval?

Thanks!

1 Like