<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 14 April 2015 at 06:45, Andrew Rakowski <span dir="ltr"><<a href="mailto:landrew@pnnl.gov" target="_blank">landrew@pnnl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Thanks for the reply Jeremy.  I thought about making a "httphead" test in the protocols.cfg file, and using the "curl" utility to do what BigBrother used to do,</blockquote><div><br></div><div>You would do one or the other.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> but I don't see how to pass the URL to the test.<br></blockquote><div><br></div><div>To use protocols.cfg, you would have to specify it in the protocols.cfg file.  For example:</div><div><br></div><div>[httphead]</div><div>  port 80</div><div>  send "HEAD /xyz/portal/user/anon/js_peid/123456790/panel/Main/template/content\r\nHost: <a href="http://xyz.somewhere.com">xyz.somewhere.com</a>\r\n\r\n"</div><div>  expect "HTTP/1.1 200 OK"</div><div><br></div><div>Actually, my protocols.cfg (and probably the installed version) already had a similar definition as [cuspd] which queries a CUPS protocol print server, which is essentially a web service running on port 631.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Is there some implicit passing of test URL to these protocols.cfg defined tests (like the string from the hosts.cfg file is stuck at the end of the invoked command taken from protocols.cfg?)</blockquote><div><br></div><div>No.  But you can do this with a script.  For example:</div><div><br></div><div>0.0.0.0 xyz-web2 # noconn HTTPHEAD:TIMEOUT=15,URL=<a href="https://xyz.somewhere.com/xyz/portal/user/anon/js_peid/123456789/panel/Main/template/content">https://xyz.somewhere.com/xyz/portal/user/anon/js_peid/123456789/panel/Main/template/content</a></div><div><br></div><div>Then:</div><div><br></div><div><div><div>#!/bin/sh</div><div><br></div><div>[ "$XYMONHOME" ] || exit 1</div><div>TEST=httphead</div><div>CURL=/usr/bin/curl</div><div><br></div><div>$XYMONHOME/bin/xymongrep "HTTPHEAD:*" | sed 's/ *# */ /;s/ dialup//;s/ testip//'|</div><div>        while read IP HOST STRING; do</div><div>                PART=`IFS=":"; set - $STRING; shift; echo "$*"`</div><div>                (</div><div>                        IFS=,</div><div>                        set - $PART</div><div>                        TIMEOUT=15</div><div>                        URL=""</div><div>                        while [ "$1" ]; do</div><div>                                VAR=`IFS="="; set - $1; echo $1`</div><div>                                VAL=`IFS="="; set - $1; shift; echo "$*"`</div><div>                                case "$VAR" in</div><div>                                        TIMEOUT) TIMEOUT="$VAL";;</div><div>                                        URL) URL="$VAL";;</div><div>                                esac</div><div>                                shift</div><div>                        done</div><div>                        RESULT=`$CURL -g -s -S -m 45 -I -k --connect-timeout $TIMEOUT "$URL" 2>&1`</div><div>                        [ $? -eq 0 ] && COL=green || COL=red</div><div>                        #printf "status $HOST.$TEST $COL `date` HEAD status $COL\n\n$RESULT\n" | $XYMON $XYMSRV "@"</div><div>                        printf "status $HOST.$TEST $COL `date` HEAD status $COL\n\n$RESULT\n"</div><div>                )</div><div>        done</div></div></div><div><br></div><div><br></div></div></div></div>