"Waiting" status not reported consistently

Issue #953 new
Thomas Smith created an issue

I understand that using every configures a monitor similar to a cronjob. It’s also my understanding that when a monitor is configured this way, its status is reported as Waiting until the first time the job executes; then, its status changes to OK.

It’s my assertion that monit reports this Waiting status inconsistently. And in certain, documented examples, this inconsistency can cause problems.

Specifically, I’m testing using monit in lieu of cron. I know there are some limitations with timing, I’m ok with that.

Using any form of every triggers the monitor to change to a Waiting status if monit is reloaded or restarted or a reboot occurs, etc. When this happens, monit report incorrectly shows that the Waiting services are Initializing, when in fact they’re waiting until their next execution.

In my particular case, and I believe this would apply to most who use monit, no monitors should be in a perpetual status of Initializing. I monitor monit on this premise--that any monitors that aren’t in a status of OK or Unmonitored are having an issue. A status of Waiting indicates a valid state, not an error condition; a status of Initializing would indicate an error condition, even if the monitor didn’t strictly fail, because it shouldn’t be stuck in that state for any reason.

Is there a way to work around this problem? What I’d like to see is something like…

  • Maybe a @reboot option, similar to cron, could inform monit that a particular monitor should be run when the monit service is reloaded or restarted?
  • Maybe an additional row in monit report for Waiting?

If there’s a workaround, I’m open to suggestions. 🙂 I haven’t been able to find one.

Comments (1)

  1. Thomas Smith reporter

    I worked out a workaround for this. I adjusted my monit monitoring script to account for monit report as if there were also a Waiting row (I artificially added it to my monitoring script). Then I compare “initializing” to “waiting”: if there the same, everything is ok; if they’re different, everything may not be ok. This works on the premise that if all other services have initialized and are running, and there’s only one Waiting service, then there will also be only one Initialising service.

    I think it would be great to see this functionality baked into Monit, but this workaround is adequate for me for now. 🙂

    I’m not a C programmer or I would take a stab at offering a pull request.

  2. Log in to comment