monit-general
[Top][All Lists]
Advanced

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

Re: Monit /etc/hosts


From: Michael Johnson - MJ
Subject: Re: Monit /etc/hosts
Date: Tue, 21 Oct 2014 15:57:39 -0700

It sounds like you are trying to do something that might be better handled in another way.  That being said, according to the monit documentation, you should be able to accomplish your goal.

From https://mmonit.com/monit/documentation/:

General syntax for testing specific value or range:

IF <TEST> THEN ACTION [ELSE IF SUCCEEDED THEN ACTION]

The selected failure action is evaluated each time the <TEST> condition is true. Success action is optional and executed only when the state changes from failure to success. If success action is not set, Monit will send recovery alert by default.



On Tue, Oct 21, 2014 at 2:04 AM, Rui Lapa <address@hidden> wrote:
Hello,

    I need your ideas on a way to achieve a /etc/hosts differentiated scenario.

    I wish to change a record on /etc/hosts based on an ICMP/Telnet test. But there's an issue, I wish to rollback if it fails again.

    I'm thinking of using something like

     check host <HOST> with address <IP>
         if failed icmp type echo count 5 with timeout 5 seconds then exec "<change_hosts>"

    But how to I do the rollback?

Thanks a lot,
    Rui Lapa




--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general



--
Michael Johnson - MJ

reply via email to

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