HealthCheck elements provides the ability to perform boolean based expressions against your healthchecks (AND, OR, and NOT).
In this example we will configure a health check that bring up http on webserver1 if :
- the string STRING1 is matched within the content retrieved via a HTTP GET / from server 192.168.1.20
- the string STRING2 is matched within the content retrieved via a HTTP GET / from server 192.168.1.21
Steps
First of all we create 2 match lists that define the content that you wish to match.
http match-list matchlist1
default down
up simple "STRING1" log
http match-list matchlist2
default down
up simple "STRING2" log
Next we create 2 healthcheck elements and assign the preivouly created matchlists to them.
Once this is done we create an additional healthcheck boolean elment, using our 2 previous healthcheck elements. We then assign the AND based boolean expression to it.
healthck hc1 tcp
dest-ip 192.168.1.20
port http
protocol http
protocol http url "GET /"
protocol http content-match matchlist1
l7-check
healthck hc2 tcp
dest-ip 192.168.1.21
port http
protocol http
protocol http url "GET /"
protocol http content-match matchlist2
l7-check
healthck hcboolean boolean
and hc1 hc2
Our healthcheck boolean is then assigned to our Virutal Server.
server real webserver1 192.168.1.10
port http
port http healthck hcand
port http keepalive
port http url "HEAD /"
server real webserver2 192.168.1.20
port http
port http keepalive
port http url "HEAD /"
Commands
The following commands are especially useful in confirm the status and troubleshooting match-list based health-checks.
- show healthck
- show healthck statistics
- server no-real-l3-check
- server no-periodic-arp
- server no-fast-bringup
- How to Configure a BIND Server on Ubuntu - March 15, 2018
- What is a BGP Confederation? - March 6, 2018
- Cisco – What is BGP ORF (Outbound Route Filtering)? - March 5, 2018
Want to become a networking expert?
Here is our hand-picked selection of the best courses you can find online:
Cisco CCNA 200-301 Certification Gold Bootcamp
Complete Cyber Security Course – Network Security
Internet Security Deep Dive course
Python Pro Bootcamp
and our recommended certification practice exams:
AlphaPrep Practice Tests - Free Trial