Reg. Health Check Monitoring with MISC_CHECK in Keepalived

Vasulu S <[email protected]> Tue, 28 Aug 2012 23:06:55 +0530
Newsgroups gmane.linux.keepalived.announce
Message-ID <CAHmvUzJh=4n=YaH9rSpPEdtmeaYr+E=2ALVpgzjjL+LZg--KoQ@mail.gmail.com>
--===============7758788838059746721==
Content-Type: multipart/alternative; boundary=047d7b10c94575cc6904c856e38a

--047d7b10c94575cc6904c856e38a
Content-Type: text/plain; charset=ISO-8859-1

Hi,

I want to monitor our application health by using the MISC_CHECK
configuration in keepalived. I have written a test python script f.py that
returns 0 if the application health is good (a file exists) and it returns
1 if the application health is bad (a file does not exists). However, the
keepalived is not initiating the failover to the backup server even in case
of script returning 1.

I have configured the virtual IP address as follows in keepalived.conf:
-----------------

virtual_server 10.102.10.30 45654 {
    delay_loop 3
    lb_algo rr
    lb_kind NAT
    nat_mask 255.255.255.0
    persistence_timeout 50
    protocol TCP

    real_server 10.102.10.29 45654 {
        weight 3
        MISC_CHECK {
                misc_path /root/test/f.py
        }
    }

    real_server 10.102.10.76 45654 {
        weight 3
        MISC_CHECK {
                misc_path /root/test/f.py
        }
    }
    connect_timeout 2
    nb_get_retry 2
    delay_before_retry 1
}

Do I need to do any additional configuration in keepalived.conf?

The failover happens as expected when "ifdown eth1" and "ifup eth1" are
executed on the master server.

Regards,
  --Vasulu S

--047d7b10c94575cc6904c856e38a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,
<br>
<br>I want to monitor our application health by using the MISC_CHECK=20
configuration in keepalived. I have written a test python script f.py=20
that returns 0 if the application health is good (a file exists) and it=20
returns 1 if the application health is bad (a file does not exists).=20
However, the keepalived is not initiating the failover to the backup=20
server even in case of script returning 1.
<br>
<br>I have configured the virtual IP address as follows in keepalived.conf:
<br>-----------------
<br>
<br>virtual_server 10.102.10.30 45654 {
<br>=A0=A0=A0 delay_loop 3
<br>=A0=A0=A0 lb_algo rr
<br>=A0=A0=A0 lb_kind NAT
<br>=A0=A0=A0 nat_mask 255.255.255.0
<br>=A0=A0=A0 persistence_timeout 50
<br>=A0=A0=A0 protocol TCP
<br>
<br>=A0=A0=A0 real_server 10.102.10.29 45654 {
<br>=A0=A0=A0=A0=A0=A0=A0 weight 3
<br>=A0=A0=A0=A0=A0=A0=A0 MISC_CHECK {
<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 misc_path /root/test/f.py
<br>=A0=A0=A0=A0=A0=A0=A0 }
<br>=A0=A0=A0 }
<br>
<br>=A0=A0=A0 real_server 10.102.10.76 45654 {
<br>=A0=A0=A0=A0=A0=A0=A0 weight 3
<br>=A0=A0=A0=A0=A0=A0=A0 MISC_CHECK {
<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 misc_path /root/test/f.py
<br>=A0=A0=A0=A0=A0=A0=A0 }
<br>=A0=A0=A0 }
<br>=A0=A0=A0 connect_timeout 2
<br>=A0=A0=A0 nb_get_retry 2
<br>=A0=A0=A0 delay_before_retry 1
<br>}
<br>
<br>Do I need to do any additional configuration in keepalived.conf?
<br>
<br>The failover happens as expected when &quot;ifdown eth1&quot; and &quot=
;ifup eth1&quot; are=20
executed on the master server.<div><br></div><div>Regards,</div><div>=A0 --=
Vasulu S=A0</div>

--047d7b10c94575cc6904c856e38a--


--===============7758788838059746721==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
--===============7758788838059746721==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Keepalived-announce mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/keepalived-announce

--===============7758788838059746721==--