Solved

Squid alive ping script

Posted on 2004-03-25
1
391 Views
Last Modified: 2011-09-20
I'm running a squid proxy server and I need a script or tool which can ping a website through the proxy to see if the proxy is running right. When the ping fails it should send an email to a specific address. I wrote already one but it only can ping ips and DNS. I already tried web-o-ping but it won't run on my redhat box.
0
Comment
Question by:timan72
1 Comment
 
LVL 12

Accepted Solution

by:
stefan73 earned 500 total points
ID: 10676868
Hi timan72,
You could use a Perl script:

use LWP;
use LWP::UserAgent;

my $ua = LWP::UserAgent->new();
$ua->proxy(http  => 'http://your_squid:8080');
$ua->timeout(15); # Set it to appropriate value

my $res=$ua->request(HTTP::Request->new(GET => ($url)));

unless ($res->is_success) {
    print STDERR "Site is dead\n";
    return;
}

Make sure squid does not cache the page you retrieve.


Cheers,

Stefan
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now