Solved

Squid alive ping script

Posted on 2004-03-25
1
390 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

863 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

28 Experts available now in Live!

Get 1:1 Help Now