From owner-freebsd-net@FreeBSD.ORG Tue Mar 20 03:22:53 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3AD8F16A401 for ; Tue, 20 Mar 2007 03:22:53 +0000 (UTC) (envelope-from ale@seudns.net) Received: from mx1.e-filter.com.br (mx.e-filter.com.br [201.54.26.3]) by mx1.freebsd.org (Postfix) with SMTP id 49C9813C44B for ; Tue, 20 Mar 2007 03:22:51 +0000 (UTC) (envelope-from ale@seudns.net) Received: (qmail 50227 invoked from network); 20 Mar 2007 03:23:28 -0000 Received: from unknown (HELO ?192.168.100.20?) (192.168.100.20) by 0 with SMTP; 20 Mar 2007 03:23:27 -0000 Received-SPF: none (192.168.99.3: domain of ale@seudns.net does not designate permitted sender hosts) Message-ID: <45FF538F.1050405@seudns.net> Date: Tue, 20 Mar 2007 00:22:55 -0300 From: Alexandre Biancalana User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: ifstated behavior X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2007 03:22:53 -0000 Hi list, First, excuse-me by the off-topic message, I asked this on -questions but I don't have any answer. 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