Re: Neither success nor failure?

Steven Christensen <[email protected]> Sun, 23 Mar 2025 19:59:16 -0400
Newsgroups gmane.comp.monitoring.monit.general
Message-ID <CAPf-+Sf6Fbma2Ry0PzoDTRnZqsejjU+Q-YMD-ysiv6i8cUc46w@mail.gmail.com>
--0000000000001b3dd006310b47cf
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

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=E2=80=AFAM Tino Hendricks via This is the gene=
ral
mailing list for monit <[email protected]> wrote:

> Hi Steven,
>
> the only thing coming to my mind if you can=E2=80=99t handle this in the =
script
> you=E2=80=99re 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]>:
>
> =EF=BB=BF
> 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!
>
>

--0000000000001b3dd006310b47cf
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Following up on this for closure, I ended up doing somethi=
ng which included dependencies.<div><br></div><div>1) Created a check for t=
he DNS lookup, with a noalert. It simply succeeds or fails on whether the D=
NS lookup works.</div><div>2) Created the actual checking procedure, which =
has a &quot;depends&quot; on #1.</div><div><br></div><div>I had to add a &q=
uot;for 3 cycles&quot; on #2 because it looks like Monit doesn&#39;t actual=
ly 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 Mon=
it reports. So the number 3 allowed me to effectively &quot;pause&quot; the=
 checks for #2 based on whether the DNS was working.</div><div><br></div><d=
iv>Thanks for all the help!</div></div><br><div class=3D"gmail_quote gmail_=
quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Mar 13, 2025=
 at 3:08=E2=80=AFAM Tino Hendricks via This is the general mailing list for=
 monit &lt;<a href=3D"mailto:[email protected]">monit-general@nongnu=
.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex"><div dir=3D"auto"><div dir=3D"ltr"></div><div dir=3D"ltr">Hi Steven,</d=
iv><div dir=3D"ltr"><br></div><div dir=3D"ltr">the only thing coming to my =
mind if you can=E2=80=99t handle this in the script you=E2=80=99re using is=
</div><div dir=3D"ltr"><br></div><div dir=3D"ltr"><a href=3D"https://mmonit=
.com/monit/documentation/monit.html#SERVICE-DEPENDENCIES" target=3D"_blank"=
>https://mmonit.com/monit/documentation/monit.html#SERVICE-DEPENDENCIES</a>=
</div><div dir=3D"ltr"><br></div><div dir=3D"ltr">Like, depending on a test=
 for working DNS.=C2=A0</div><div dir=3D"ltr"><br></div><div dir=3D"ltr">Ch=
eers!</div><div dir=3D"ltr"><br></div><div dir=3D"ltr">Tino</div><div dir=
=3D"ltr"><br><blockquote type=3D"cite">Am 13.03.2025 um 05:23 schrieb Steve=
n Christensen &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">steve=
[email protected]</a>&gt;:<br><br></blockquote></div><blockquote type=3D"cite"><div=
 dir=3D"ltr">=EF=BB=BF<div dir=3D"ltr">Hi All, I have a use case I am not s=
ure Monit can handle. I looked at the document and tried keywords in this m=
ailing list, but nothing came up.<div><br></div><div>I have a script which =
checks another node for some information, and then reports success or failu=
re (via exit code).The script works fine in Monit.</div><div><br></div><div=
>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&#39;t know=
 whether the information would have resulted in a success or failure,=C2=A0=
to report to Monit.=C2=A0</div><div><br></div><div>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/fail=
ure state until it the next time it is able to definitively report a true o=
r false status?</div><div><br></div><div>Thanks!</div><div><br></div></div>
</div></blockquote></div></blockquote></div>

--0000000000001b3dd006310b47cf--