IP SLA monitor response from a local web proxy and dns with email alert

The following example was used to verify the performance of a rather flakey web proxy or multiple. The following solution was used from an 1861 router with multiple versions testing 6 websites across two proxy servers. In the event of the proxy slowing down the router sends out an alert email identifying that its running slow on that request. Get a full example here: http://wp.me/p223az-4m or read below for a breakdown:

!
!
!# CREATE THE SLA ID #

ip sla monitor 100

!# IDENTIFY THE TYPE OF SLA AND WHAT TO REQUEST EG: HTTP USING A LOCAL DNS AND PROXY WITHOUT WEB CACHING THE CONTENT

type http operation get url http://www.cisco.com/ name-server cache disable proxy http:///

!# HOW OFTEN TO CARRY OUT THE SERVICE LEVEL CHECK #

freq 60

!# THE TIME AN SLA WAITS FOR A RESPONSE FROM ITS REQUEST IN MILLISECONDS #

timeout 1000

!# THE UPPER LEVEL THRESHOLD FOR THE USE OF NETWORK MONITORING #

threshold 3000

!# USER DEFINED IDENTIFIER THAT CAN BE USED IN CONJUNCTION WITH SNMP OR OTHER TOOLS #

tag IWSVA-50

!# START THE MONITOR RUNNING #

ip sla monitor schedule 101 life forever start-time now
!
!
!# USE A TRACK TO MONITOR AND SET A LOGG MESSAGE #

track 101 rtr 101 state

!# DELAY BEFORE CREATING THE ALERT IN SECONDS#

delay down 5
!
!
!# DEFINE THE EMAIL SERVER, SENDER AND RE

event manager environment _email_to noc@test.net
event manager environment _email_from router@ip-sla.local
!
!
!# CREATE EEM SCRIPT TO CARRY OUT FUNCTION, DEFINE SCRIPT ID #

event manager applet PROXY_100_LATENCY_ALERT

!# DEFINE PARAMETERS TO ACT UPON IF THE TRACK FAILS #

event syslog pattern “%TRACKING-5-STATE: 100 rtr 100 state Up->Down”

!# SET ACTION UPON FAILURE TO WRITE TO LOG #

action 1.0 syslog msg “SLOW PROXY SERVICE”

!# SET ACTION UPON LOG ALERT TI SEND EMAIL WITH CONTENT AND SUBJECT #

action 1.1 mail server “$_email_server” to “$_email_to” from “$_email_from” subject “Latency Alert” body “Web Proxy CISCO Latency Alert”
!
!

tweak accordingly

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s