From owner-freebsd-questions@FreeBSD.ORG Wed Mar 14 19:06:30 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5738B16A402 for ; Wed, 14 Mar 2007 19:06:30 +0000 (UTC) (envelope-from biancalana@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.236]) by mx1.freebsd.org (Postfix) with ESMTP id 12A2813C459 for ; Wed, 14 Mar 2007 19:06:29 +0000 (UTC) (envelope-from biancalana@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so279310wxc for ; Wed, 14 Mar 2007 12:06:29 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=HHAJP35GIzN2QjvgA5K3jcfgEX7PyJogUdrYwTmBkwUmxJ7ruPNZEuKsMrHq69PDqi100llt6fwtJyI7dPqGlit4z6mmTDpYvCu1UbvUiOprk3WEioiHcRGxUI9uzLkQEN7S13+bKU/2swV6lPZLEDjWl7S9f3pgndYydjQaSjU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=IkNUY0bnfcGDK0+U1jobkGDn9Zgc1Pci3KTBbRGIuaW3w9to6+XrxWvn+jBo8C+vjM4WO86vBLTfkfQ/DrR8cCPdxqbqQOAIEin3t1+iI3+btJtJC/AOOwd+B/pQHwWEjMiKeXNqWY5jB3bgSgsZp3Ac6wwb05JLnBgpLD9zJ2w= Received: by 10.90.104.14 with SMTP id b14mr7692779agc.1173897440567; Wed, 14 Mar 2007 11:37:20 -0700 (PDT) Received: by 10.48.164.13 with HTTP; Wed, 14 Mar 2007 11:37:20 -0700 (PDT) Message-ID: <8e10486b0703141137rde7b516ufb14f06221792c65@mail.gmail.com> Date: Wed, 14 Mar 2007 15:37:20 -0300 From: "Alexandre Biancalana" To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: ifstated check commands behavior X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2007 19:06:30 -0000 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