<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3314" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2>Of course it wasn't the whole script, but it still worked.
:-)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2>I then tweaked it a little to make it work better for our
environment, and added a few features, like the time_total.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2>I haven't implemented a timeout value though, although
that's probably a good idea.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008></SPAN><SPAN
class=269422700-25112008><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2>What you gave me was a skeleton, and after I added a bit of
flesh, I ended up with something quite workable.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2>Which worked great. Thanks :-)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2>Here's one that Henrik might need to address
though.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2>If I use curl to replace the standard http test, then I
can't get it to graph unless I use the NCV feature.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2>However, I am reluctant to try this, because it might break
other HTTP tests that are working well (on internal sites)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2>Is it OK to start graphing this using NCV, or is there a
way to get the custom curl-based http test to inject the data points into the
standard http graphing system?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2>Cheers</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2> Vernon</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=269422700-25112008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Ralph Mitchell
[mailto:ralphmitchell@gmail.com] <BR><B>Sent:</B> Tuesday, 25 November 2008 1:04
AM<BR><B>To:</B> hobbit@hswn.dk<BR><B>Subject:</B> Re: [hobbit] Testing external
web through a proxy<BR></FONT><BR></DIV>
<DIV></DIV>Heh - dude, that wasn't supposed to be the *whole* script...
:)<BR><BR>If that one was useful, here's something that may be a bit
better. I added a timeout for curl, otherwise it'll wait for a long time
if the server doesn't respond. Also, this format produces a message
formatted just like Xymon's internal http test, including the time taken to grab
the headers. You could extract the "Seconds" line to determine if the
response is a bit slow. With a bit more magic in Xymon's configs, you
could even graph it...<BR><BR>Ralph Mitchell<BR><BR>============= cut here
============<BR>#!/bin/sh<BR><BR>TESTHOST=<A
href="http://www.google.com">www.google.com</A><BR>TESTURL=http://$TESTHOST/<BR><BR>TIMEOUT=30<BR><BR>#
Grab *just* the headers, simulating Xymon's builtin http check<BR>MESSAGE=`curl
-x <A
href="http://ourproxy.ourdomain.com:8080">http://ourproxy.ourdomain.com:8080</A>
\<BR> --proxy-anyauth -U hobbituser:hobbitpassword
\<BR> -m $TIMEOUT \<BR> -w
'Seconds: %{time_total}\n' \<BR>
-s -S -L -I $TESTURL | $GREP -v Set-Cookie`<BR><BR>if [ "$?" -eq "0" ];
then<BR> COLOR=green<BR>else<BR> COLOR=red<BR>fi<BR><BR># convert
dots to commas in the hostname<BR>MACHINE=`echo $TESTHOST | $SED -e
's/\./\,/g'<BR><BR>$BB $BBDISP "status $MACHINE.home $COLOR
`date`<BR><BR>$MESSAGE"<BR>============= cut here ============<BR><BR><BR><BR>
<DIV class=gmail_quote>On Sun, Nov 23, 2008 at 9:04 PM, Everett, Vernon <SPAN
dir=ltr><<A
href="mailto:Vernon.Everett@woodside.com.au">Vernon.Everett@woodside.com.au</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>Hi
Ralph</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>This
script works a treat.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN></SPAN><SPAN><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2>Thanks</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2> Vernon</FONT></SPAN></DIV><BR>
<DIV lang=en-us dir=ltr align=left>
<HR>
<FONT face=Tahoma size=2><B>From:</B> Ralph Mitchell [mailto:<A
href="mailto:ralphmitchell@gmail.com"
target=_blank>ralphmitchell@gmail.com</A>] <BR><B>Sent:</B> Saturday, 22
November 2008 12:23 AM<BR><B>To:</B> <A href="mailto:hobbit@hswn.dk"
target=_blank>hobbit@hswn.dk</A><BR><B>Subject:</B> Re: [hobbit] Testing
external web through a proxy<BR></FONT><BR></DIV>
<DIV>
<DIV></DIV>
<DIV class=Wj3C7c>
<DIV></DIV>Looks like your proxy requires authentication via Kerberos or NTLM
or GSS-Negotiate. Dunno if Xymon can do those. Luckily the curl
tool (httpp://<A href="http://curl.haxx.se" target=_blank>curl.haxx.se</A>)
*can* do those... I haven't had to use them, but it should not be too
hard to bang out an ext script to do the check. Something along these
lines:<BR><BR> #!/bin/sh<BR>
curl -x <A href="http://ourproxy.ourdomain.com:8080"
target=_blank>http://ourproxy.ourdomain.com:8080</A>
\<BR>
--proxy-anyauth -U hobbituser:hobbitpassword
\<BR> -s -S -L -o
/dev/null <A href="http://www.google.com/"
target=_blank>http://www.google.com/</A><BR> if [ "$?"
-eq "0" ]; then<BR>
COLOR=green<BR> MESSAGE="Pinged Google
OK"<BR> else<BR>
COLOR=RED<BR> MESSAGE="Failed to reach
Google"<BR> fi<BR> $BB $BBDISP
"status www,google,com.home $COLOR `date`<BR>$MESSAGE"<BR><BR>Obviously that
can be expanded quite a lot... :) Drop it somewhere on your Xymon
server (maybe in server/ext) and set up a block in server/etc/hobbitlaunch.cfg
to fire it off as often as you want. You may need to give the full path
for curl, which is probably /usr/bin/curl.<BR><BR>Ralph Mitchell<BR><BR><BR>
<DIV class=gmail_quote>On Fri, Nov 21, 2008 at 1:30 AM, Everett, Vernon <SPAN
dir=ltr><<A href="mailto:Vernon.Everett@woodside.com.au"
target=_blank>Vernon.Everett@woodside.com.au</A>></SPAN> wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV><FONT face="Arial, sans-serif" size=2>
<DIV>Hi all</DIV>
<DIV> </DIV>
<DIV>I am trying to test our interent connectivity by checking Google
through our proxy.</DIV>
<DIV>(Once I get this right, I want to start testing some of our external
web pages in the same manner)</DIV>
<DIV> </DIV>
<DIV>I have configured this in bb-hosts</DIV>
<DIV><A href="http://0.0.0.0"
target=_blank>0.0.0.0</A> <A
href="http://www.google.com" target=_blank><FONT
color=#0000ff><U>www.google.com</U></FONT></A>
# noconn <A
href="http://hobbituser:hobbitpassword@ourproxy.ourdomain.com:8080/http://www.google.com"
target=_blank><FONT
color=#0000ff><U>http://hobbituser:hobbitpassword@ourproxy.ourdomain.com:8080/http://www.google.com</U></FONT></A></DIV>
<DIV> </DIV>
<DIV>And I get this.</DIV>
<DIV><FONT face="Courier New, monospace"><A
href="http://hobbit/hobbit/gifs/yellow.gif" target=_blank><FONT
color=#0000ff><U>yellow</U></FONT></A> <A href="http://www.google.com.au/"
target=_blank><FONT
color=#0000ff><U>http://www.google.com.au/</U></FONT></A> - Proxy
Authentication Required<BR><BR>HTTP/1.1 407 Proxy Authentication Required (
The ISA Server requires authorization to fulfill the request. Access to the
Web Proxy filter is denied. )<BR>Via: 1.1 <FONT
face="Courier New, monospace">PXYHOSTNAME<BR></FONT>Proxy-Authenticate:
Negotiate<BR>Proxy-Authenticate: Kerberos<BR>Proxy-Authenticate:
NTLM<BR>Connection: Keep-Alive<BR>Proxy-Connection: Keep-Alive<BR>Pragma:
no-cache<BR>Cache-Control: no-cache<BR>Content-Type:
text/html<BR>Content-Length: 4118
<BR><BR>Seconds: 0.02</FONT></DIV>
<DIV><FONT face="Courier New, monospace"></FONT> </DIV>
<DIV>Any assistance appreciated.</DIV>
<DIV> </DIV>
<DIV>Regards</DIV>
<DIV> Vernon</DIV>
<DIV> </DIV></FONT><PRE>NOTICE: This email and any attachments are confidential.
They may contain legally privileged information or
copyright material. You must not read, copy, use or
disclose them without authorisation. If you are not an
intended recipient, please contact us at once by return
email and then delete both messages and all attachments.
</PRE></DIV></BLOCKQUOTE></DIV><BR><PRE>NOTICE: This email and any attachments are confidential.
They may contain legally privileged information or
copyright material. You must not read, copy, use or
disclose them without authorisation. If you are not an
intended recipient, please contact us at once by return
email and then delete both messages and all attachments.
</PRE></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR><pre>
NOTICE: This email and any attachments are confidential.
They may contain legally privileged information or
copyright material. You must not read, copy, use or
disclose them without authorisation. If you are not an
intended recipient, please contact us at once by return
email and then delete both messages and all attachments.
</pre></BODY></HTML>