"repeat" exec option is limited to 255 cycles, then overruns.

Issue #817 duplicate
Ivan Pesin created an issue

Hello,

repeat exec option in monit is limited to 255, and then overruns:

# cat /etc/monit.d/system
check system tpa01.rewcons.net
...
  if uptime > 90 days then exec /usr/local/bin/slack-monit repeat every 750 cycles
    else if succeeded then exec /usr/local/bin/slack-monit

# monit -v | grep Uptime
 Uptime               = if greater than 7776000 second(s) then exec '/usr/local/bin/slack-monit' repeat every 208 cycle(s) else if succeeded then exec '/usr/local/bin/slack-monit'

# sed -i 's/every 720/every 300/' /etc/monit.d/system
# monit -v | grep Uptime
 Uptime               = if greater than 7776000 second(s) then exec '/usr/local/bin/slack-monit' repeat every 44 cycle(s) else if succeeded then exec '/usr/local/bin/slack-monit'

# sed -i 's/every 300/every 255/' /etc/monit.d/system
# monit -v | grep Uptime
 Uptime               = if greater than 7776000 second(s) then exec '/usr/local/bin/slack-monit' repeat every 255 cycle(s) else if succeeded then exec '/usr/local/bin/slack-monit'

# monit -V
This is Monit version 5.25.1
Built with ssl, with ipv6, with compression, with pam and with large files
Copyright (C) 2001-2017 Tildeslash Ltd. All Rights Reserved.

# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)

Couple of issues here:

  1. Overrun happens quietly, no error messages
  2. Maximum of 255 is not specified in man page
  3. 255 cycles is not really enough for certain sensible reminders. For example, we run monit with 60 sec interval, and would like the uptime reminder (and some other) appear once per day. That means once per 1440 cycles. Is it possible to change uint8_t to something larger?

https://bitbucket.org/tildeslash/monit/src/e9e458ae169c1155cdcd9ca956c0cb4b8d5614f9/src/monit.h?at=master#monit.h-483

Thank you!

Comments (2)

  1. Log in to comment