Following up on this for closure, I ended up doing something which included
dependencies.

1) Created a check for the DNS lookup, with a noalert. It simply succeeds
or fails on whether the DNS lookup works.
2) Created the actual checking procedure, which has a "depends" on #1.

I had to add a "for 3 cycles" on #2 because it looks like Monit doesn't
actually execute the process checks in an order based on depends
statements. Also, there looks to be a one check lag between the actual
results and what Monit reports. So the number 3 allowed me to effectively
"pause" the checks for #2 based on whether the DNS was working.

Thanks for all the help!

On Thu, Mar 13, 2025 at 3:08 AM Tino Hendricks via This is the general
mailing list for monit <[email protected]> wrote:

> Hi Steven,
>
> the only thing coming to my mind if you can’t handle this in the script
> you’re using is
>
> https://mmonit.com/monit/documentation/monit.html#SERVICE-DEPENDENCIES
>
> Like, depending on a test for working DNS.
>
> Cheers!
>
> Tino
>
> Am 13.03.2025 um 05:23 schrieb Steven Christensen <[email protected]>:
>
> 
> Hi All, I have a use case I am not sure Monit can handle. I looked at the
> document and tried keywords in this mailing list, but nothing came up.
>
> I have a script which checks another node for some information, and then
> reports success or failure (via exit code).The script works fine in Monit.
>
> But due to some dodgy DNS service, sometimes when the script tries to get
> information from the other node, the DNS lookup fails. So we don't know
> whether the information would have resulted in a success or failure, to
> report to Monit.
>
> My question: Is there a way to tell Monit during that script check
> interval that the results of the check are indeterminate, that it should
> maintain the previous success/failure state until it the next time it is
> able to definitively report a true or false status?
>
> Thanks!
>
>

Reply via email to