How to schedule Heartbeat for every 30th second of minute

Hi Guys,
Can someone help me with configuration of heartbeat for below one:

  • I need to schedule heartbeat run using cron expression for every 30th second but not @every 30secs. (like 10:14:30 ,10:15:30 , 10:16:30 and so on)
    Below is my sample heartbeat configuration which is running on every 30seconds, but i need to skip heartbeat to run at 0th second of every minute

       heartbeat.monitors:
     - type: http
       schedule: '*/30 * * * * *'
       timeout: 10s
       urls: [ "https://sample.com/app/heartbeat.ping" ]
       check.response:
     	status: 200
       fields_under_root: true
       
     heartbeat.scheduler:
       limit: 10
    
     output.console:
       pretty: true
    

Thanks in advance

Cron syntax doesn't support that. Can I ask what the reason is behind running it on the 30th second?

Thanks for reply.
If I need to monitor on single VM then i will use expression like this schedule: '*/30 * * * * '
But I need to run same heartbeat configuration on two different VM's . And each process should not run on same time but need to capture events for every 30seconds
Reason for running same heartbeat configuration on two VM's is to increase the availability of heartbeat process if one goes down with any reason.
So Inorder to accommodate this change, I need to configure as below:
1st vm: schedule: '
* * * *' //which runs on every 0th minute
2nd vm: schedule: '30th second' //As i am running 1st vm on every 0th minute, i need to config on every 30th minute, but If i configure @every 30secs then it will capture 0th minute event too).

Any workarounds would be great help.

Thanks

Since uptime checks are so cheap would it be a problem to run both heartbeats with @every 30s as the schedule?

Hi,
I am able to configure it using below ones and it is working fine

1st vm: schedule '0 */1 * * * * *'
2nd vm: schedule '30 */1 * * * * *'

I hear you regarding running same configuraion on 2 vm's but in my case if health is in alarming condition, then duplicate alerts will be sent to the stakeholders. Anyway thanks for your help

In the future we hope to provide a way to send a single alert in an HA scenario. Sorry we don't have that now.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.