<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Thank you Jeremy. Allow me to clarify a few things.<br>
<br>
I'm not a good sh script guy so I might need you to hold my hand on a few things.<br>
<br>
The actual wget call is:<br>
 wget --post-file=SentinelCompReport.xml --header="Content-Type: text/xml" --header="SOAPAction: \"http://tlo.com/ComprehensivePersonSearch\"" -O - http://<some vip>/BobService.asmx<br>
<br>
On the previous email, I put 'xxx.com' instead of tlo.com in the wget call because I didn't want to broadcast my domain name to the world but I don't mind anymore -- so every wget call with have "http://tlo.com/ComprehensivePersonSearch"<br>
but on the last http url call it should have the vip of where I'm sending this xml to; for example "http://vip from bb-host file/BobServices.asmx"<br>
<br>
So, If had this in my bb-host file:<br>
10.218.160.150   server1 #foo<br>
10.218.160.151   server2 #foo<br>
<br>
The first wget call should look like:<br>
 wget --post-file=SentinelCompReport.xml --header="Content-Type: text/xml" --header="SOAPAction: \"http://tlo.com/ComprehensivePersonSearch\"" -O - http://10.218.160.150/BobService.asmx<br>
<br>
>From your script, it said "wget ... --header="SOAPAction: \"http://$1/ComprehensivePersonSearch\" -O - http://$2/BobService.asmx" But I'm guessing since we don't need to change the url for "http://tlo.com/ComprehensivePersonSearch\"<br>
we don't need the $1, correct?<br>
<br>
Also, your script indicated "$BBHOME/bin/bbhostgrep foo | while read IP HOSTNAME OTHER; do" but HOSTNAME is not what I have defined in bb-hosts, I'm using aliases; for example, 10.218.160.150 is mapped to alias called server1 so I can't use<br>
the alias for HOSTNAME because this command won't work "$BB $BBDISP "status $HOSTNAME.$TESTNAME $COL `date` $MSG", am I correct to assume this?<br>
<br>
So, if my assumptions are correct, how should I correct this script you wrote to reflect my environment. Thanks again, sir.<br>
<br>
Rod<br>
<br>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF525998"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Xymon [xymon-bounces@xymon.com] on behalf of Jeremy Laidman [jlaidman@rebel-it.com.au]<br>
<b>Sent:</b> Wednesday, August 06, 2014 9:39 AM<br>
<b>To:</b> Rod Simioni<br>
<b>Cc:</b> xymon@xymon.com<br>
<b>Subject:</b> Re: [Xymon] xymon-rclient<br>
</font><br>
</div>
<div></div>
<div>
<p dir="ltr">OK, so this is what I'd do.</p>
<p dir="ltr">> subpage vips VIPS<br>
> 10.218.160.150   server1 #foo<br>
> 10.218.160.150   server2 #foo</p>
<p dir="ltr">The "foo" would not normally be needed, but let's assume that you want your script to work out what hosts to probe. So we'll leave it in.</p>
<p dir="ltr">> I want to send xml through this call:<br>
><br>
> wget --post-file=SentinelCompReport.xml --header="Content-Type: text/xml" --header="SOAPAction: \"<a href="http://xxx.com/ComprehensivePersonSearch\" target="_blank">http://xxx.com/ComprehensivePersonSearch\</a>"" -O -
<a href="http://VIP/BobService.asmx" target="_blank">http://VIP/BobService.asmx</a></p>
<p dir="ltr">I'd put this in a script like so:</p>
<p dir="ltr">#!/bin/sh</p>
<p dir="ltr">TESTNAME="foo"<br>
REGEX="some regex"</p>
<p dir="ltr">do_fetch() {<br>
    wget ... --header="SOAPAction: \"http://$1/ComprehensivePersonSearch\" -O - http://$2/BobService.asmx<br>
}</p>
<p dir="ltr">$BBHOME/bin/bbhostgrep foo | while read IP HOSTNAME OTHER; do<br>
    if do_fetch $HOSTNAME $IP | grep "$REGEX" > /dev/null ; then<br>
        COL=green<br>
        MSG="Test for $TESTNAME is OK"<br>
    else<br>
        COL=red<br>
        MSG="Test for $TESTNAME failed"<br>
    fi<br>
    $BB $BBDISP "status $HOSTNAME.$TESTNAME $COL `date` $MSG"<br>
done</p>
<p dir="ltr">This is from memory and hasn't been tested, but should give you the gist.</p>
<p dir="ltr">J<br>
</p>
</div>
</div>
</div>
</body>
</html>