Cisco IP SLA – check virtual host

On a portable Cisco 819 router I have installed an IP SLA to verify that http://www.onemanearmy.biz/ipsla_check.html is online and reachable.

In the end I am not interested on the outcome, and there are no actions following this IP SLA statement.

It just provides in idea if the internet is reachable.

But it would be possible to add MySQL querys or something similar that will be executed each time this file is polled to do e.g. some kind of cheap trick dyndns.

But there are better solutions for this.(no-ip.com, dyndns.org, …)

The IP SLA consists out of several statements:

1. IP SLA statement

ip sla 20
 http raw http://85.214.27.148
 frequency 60
 http-raw-request
  GET /ipsla_check.html HTTP/1.0\r\n
  Host: www.onemanarmy.biz\r\n
  \r\n
  exit

2. The scheduler

ip sla schedule 20 life forever start-time now

Now if you check your web server logs you can see that this web page is polled every 60 seconds.

#egrep ipsla_check.html /var/log/apache2/access_log

89.124.132.28 - - [26/Jul/2013:10:20:25 +0200] "GET /ipsla_check.html HTTP/1.0" 200 309 "-" "-"
89.124.132.28 - - [26/Jul/2013:10:36:48 +0200] "GET /ipsla_check.html HTTP/1.0" 200 309 "-" "-"
89.124.132.28 - - [26/Jul/2013:10:54:22 +0200] "GET /ipsla_check.html HTTP/1.0" 200 309 "-" "-"
89.124.132.28 - - [26/Jul/2013:10:55:22 +0200] "GET /ipsla_check.html HTTP/1.0" 200 309 "-" "-"
89.124.132.28 - - [26/Jul/2013:10:56:21 +0200] "GET /ipsla_check.html HTTP/1.0" 200 309 "-" "-"
89.124.132.28 - - [26/Jul/2013:10:57:21 +0200] "GET /ipsla_check.html HTTP/1.0" 200 309 "-" "-"
89.124.132.28 - - [26/Jul/2013:10:58:21 +0200] "GET /ipsla_check.html HTTP/1.0" 200 309 "-" "-"
89.124.132.28 - - [26/Jul/2013:10:59:21 +0200] "GET /ipsla_check.html HTTP/1.0" 200 309 "-" "-"

You see now the IP address of this router, the date when the last poll occurred and which file was polled

 

Sources:
Basics of telnet and HTTP – blog.gahooa.com

Configuring IP SLAs HTTP Operations – Cisco.com

 

Leave a Reply

Your email address will not be published. Required fields are marked *