Certificate Validity Tests: operator

Issue #1003 new
Matt Viverette created an issue

Greater Than Sign (U+003E) should be changed to Less Than Sign (U+003C) in the Monit configuration and in the Notification emails.

Configuration line:

and certificate valid > 30 days

Monit Notification email example:

certificate expiry in 29 days matches check limit [valid > 30 days].

Technically the certificate is valid less than 30 days and therefore [valid < 30 days].

The fact that this sign is reversed makes configuring Monit extremely confusing, and the Notification emails are also confusing for operations staff.

The documentation also needs to be changed here to reflect the fix.

Comments (3)

  1. Tildeslash repo owner

    I agree it is confusing. The test is however used in the context of “if failed <conditions> then <action>”, where it make sense:

      if failed
          port 443
          protocol https
          and certificate valid > 30 days
      then alert
    

    If the test would be missing the negation (“failed”), then the opposite sign would make sense.

  2. Lutz Mader

    Hello Matt,
    a comment only,
    this is a problem of using/applying De Morgan's law.
    Based on the comment you can change the "and" to "or" and remove "failed".

    Unfortunately the "or", "and" are ignored and used for human readabiliy only like some other word (see https://mmonit.com/monit/documentation/monit.html#THE-MONIT-CONTROL-FILE).

    And based on the Resource Tests a "if" without "failed" is useful, but does not make the configuration more easy to read, I think
    (see https://mmonit.com/monit/documentation/monit.html#RESOURCE-TESTS).

    On the other hand "if failed" is used sometimes only and was changed in the past sometimes, but this became a endless discussion (see https://bitbucket.org/tildeslash/monit/issues/971).

    With regards,
    Lutz

  3. Log in to comment