Date: Wed, 14 Mar 2007 15:37:20 -0300 From: "Alexandre Biancalana" <biancalana@gmail.com> To: freebsd-questions@freebsd.org Subject: ifstated check commands behavior Message-ID: <8e10486b0703141137rde7b516ufb14f06221792c65@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
Hi list,
  I'm trying to setup ifstated to check two links and if some go down, do
some actions like change pf rules and machine's route.
  My doubt is about the execution order/repetition of the states body of
ifstated.conf, in all configs that I tried just the last check is executed
always, follow and example:
ifstated.conf:
==============================
loglevel debug
ping1 = '( "ping -q -c 1 -t 3 www.site1.com > /dev/null" every 10 ) '
ping2 = '( "ping -q -c 1 -t 3 www.site2.com > /dev/null" every 10 ) '
state one {
        if ! ( $ping1 && $ping2 ) {
                set-state two
        }
}
state two {
        init {
                run "logger -p console.notice -t ifstated 'Restarting
network !'"
        }
        if ( $ping && $ping2 ) {
                set-state one
        }
}
==============================
# ifstated -dv
ping1 = "( "ping -q -c 1 -t 3 www.site1.com > /dev/null" every 10 ) "
ping2 = "( "ping -q -c 1 -t 3 www.site2.com > /dev/null" every 10 ) "
ifstated: initial state: one
ifstated: changing state to one
ifstated: running ping -q -c 1 -t 3 www.site1.com > /dev/null
ifstated: running ping -q -c 1 -t 3 www.site2.com > /dev/null
ifstated: started
ifstated: changing state to two
ifstated: running ping -q -c 1 -t 3 www.site1.com > /dev/null
ifstated: running ping -q -c 1 -t 3 www.site2.com > /dev/null
ifstated: running ping -q -c 1 -t 3 www.site2.com > /dev/null
ifstated: running ping -q -c 1 -t 3 www.site2.com > /dev/null
As you can see, after change state ifstated execute only the *last* check
command of the statement (ping2) forever....
This is the expected behavior ?
I'm running 6-STABLE + ifstated-20050505 (instaled via
/usr/ports/net/ifstated)
Thanks for any help.
Alexandre
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8e10486b0703141137rde7b516ufb14f06221792c65>
