check_http to check a proxy.

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Fri May 14 06:20:01 CEST 2004


On Thu, May 13, 2004 at 08:03:07PM -0700, nagios-users-request at lists.sourceforge.net wrote:

> Subject: RE: [Nagios-users] check_http & proxy
> Date: Thu, 13 May 2004 09:43:46 -0500
> From: "Marc Powell" <marc at ena.com>
> To: "Gregor Bruhin" <gregor.bruhin at netoxygen.ch>,
> 	<nagios-users at lists.sourceforge.net>
> 
> Gregor Bruhin <mailto:gregor.bruhin at netoxygen.ch> wrote:
> > Hi,
> >=20
> > Is check_http proxy compatible ?
> >=20
> > I defined the http_proxy env var but the plugin still fails (timeout)
> > ...=20
> >=20
> > Any ideas ?
> 
> check_http --help.
> 
> I use the following to make sure that our proxies are functioning
> properly. You don't say if you're trying to check the proxy or if you
> must use the proxy to get out but in either case I believe the results
> will be the same --
> 
> define command{
>         command_name    check_proxy
>         command_line    $USER1$/check_http -H www.yahoo.com -I
> $HOSTADDRESS$ --onredirect follow -p 8080 -wt 20 -ct 30 -to 35 -u
> http://www.yahoo.com -s HTML
>         }
> 
> $HOSTADDRESS$ corresponds to the IP of your proxy. You could of course
> hard code the $HOSTADDRESS$ to be your proxy and make the -H and -u
> arguments variable to check other sites via the proxy.
>

If you need to check an authenticated proxy then :-

1 you may be able to use one of the HTTP schemes to pass the password in 
the request or in the environment

HTTP_PROXY=http://Unser:Password@Proxy:Proxy_Port/ or

2 use a proxy aware application such as lynx, or

3 build your own with a web client library (eg Curl) or Class (eg with 
the CPAN module named LWP) or

4 use one of the complete web client Classes from CPAN such as 
WWW:Automate/WWW::Mechanize.

The last approach is useful if you want to check a dynamic web 
service such as a shopping cart application or a database search.

Yours sincerely.
 

-- 
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------

'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'

from Meditation 17, J Donne.


-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list