Solved

Squid alive ping script

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

762 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

21 Experts available now in Live!

Get 1:1 Help Now