Solved

Squid alive ping script

Posted on 2004-03-25
1
396 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
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,…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

749 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