Squid outage fail-over
If you run wccp through a Cisco router and your Squid Cache falls over the router will fail over to serving pages directly.
Seamless fail-over is good but
So you may never notice that your Squid proxy has stopped responding. So you lose the benefit of the Squid cache and increased your demand on your Internet Link.
How do you check if Squid is responding?
Run squidclient against the Squid Server and check for a correct return value!
What to do
Assuming you are running Windows XP Pro as the monitoring workstation and you have admin access. Do the following:
- Install Cygwin and the Cygwin squid package.
- Then create a batch file and call it from Windows Scheduler several times a day (e.g. 9AM 12PM 3PM 6PM )
- The batch file will email a warning when it doesn’t get a correct response.
Here is a sample batch file. Obviously you would edit to your taste.
@echo off rem Tell the batch file where to find your squidclient software set PATH=c:\cygwin\bin;%PATH% rem Cygwin squidclient set SQUIDCLIENT=squidclient.exe rem SMTP Server IP Address set SMTPSERVER=10.20.30.1 rem This is any URL that is likely to be up most of the time set URL=http://www.google.com.au rem This is the squid proxy's ip address set HOST=10.20.30.250 rem The TO and FROM email addresses set TOADDRemail@example.com set FROMADDRfirstname.lastname@example.org %SQUIDCLIENT% -h %HOST% %URL% if not %ERRORLEVEL%. == 0. ( rem -h is generate headers rem -b is the body, -a is the subject bmail -h -s %SMTPSERVER% -t %TOADDR% -f %FROMADDR% -b "%DATE% %TIME% The squid proxy server %HOST% failed to respond" -a "%DATE% %TIME% %SQUIDCLIENT% returned an error" )
bmail is available here
A better way
If you can afford a monitoring server. You would be better off running Nagios. But the above solution provides a heads up without having to configure a full blown Nagios install.