monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Action if checksum did not change


From: jejc
Subject: Re: Action if checksum did not change
Date: Sun, 12 Jun 2022 15:48:03 +0200 (CEST)

Ok, thanks for the details.

I managed to test the situation without checksum, in a safer way.

Any reason why IF CHANGED CHECKSUM does not support the ELSE? Of something like 
IF NOT CHANGED CHECKSUM.

Read you,

J.





----- Mail original -----
De: "Lutz Mader" <lutz.mader@freenet.de>
À: "This is the general mailing list for monit" <monit-general@nongnu.org>
Envoyé: Vendredi 10 Juin 2022 20:41:11
Objet: Re: Action if checksum did not change

Hello Jej,
the short answer to your question, the statements
IF FAILED CHECKSUM support an ELSE but
IF CHANGED CHECKSUM does not
see https://mmonit.com/monit/documentation/monit.html#FILE-CHECKSUM-TEST

A simple sample
check file File with path "/Users/lutz/test.txt"
  if not exist for 3 cycles then unmonitor
  if changed md5 checksum then exec /usr/bin/true
  if failed md5 checksum then exec /usr/bin/true
    else if succeeded then alert

IF CHANGED
All the time the checksum (the file content) will change, an alert will
thrown.

IF FAILED
The checksum will determined when the configuration will be loaded or is
given with EXPECT. If the checksum will changed, an alert will thrown.
You can add an ELSE to define an additional action if the checksum will
succeeded again.

With regards,
Lutz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]