<div dir="ltr"><div>Took the quotes out, had to change the space to \x20 to get it to show in the info page.</div><div><br></div><div>So, server/etc/hosts.cfg is now essentially the same as yours, but with the <:</div><div>192.168.1.4   <a href="http://xxxx.yyyy.com">xxxx.yyyy.com</a>        # cont;<a href="http://xxxx.yyyy.com/test.html">http://xxxx.yyyy.com/test.html</a>;<a\x20href=\x22foo/bar\x22></div><div><br></div><div>source of the info page looks like this:</div><div><div><tr><th align=left>Content checks:</th><td align=left></div><div><a href="<a href="http://xxxx.yyyy.com/test.html">http://xxxx.yyyy.com/test.html</a>"><a href="http://xxxx.yyyy.com/test.html">http://xxxx.yyyy.com/test.html</a></a>&nbsp; must return '<a href="foo/bar">'<br></div><div></td></tr></div></div><div><br></div><div>test.html contains:</div><div>     <a href="foo/bar"><br></div><div><br></div><div>content test shows green.  In test.html, changed foo to fop, test went red.  Changed < to dot, test went red.</div><div><br></div><div>Maybe the parser is broken in your version and fixed in mine, or vice versa??  I'm running  Xymon 4.3.28-rc2 on CentOS 7.</div><div><br></div><div>Ralph Mitchell</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 6, 2017 at 1:45 PM, John Thurston <span dir="ltr"><<a href="mailto:john.thurston@alaska.gov" target="_blank">john.thurston@alaska.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">With eager fingers, I went to adjust my hosts.cfg, and .. ... no diff. I've tried both single and double quotes. Single quotes caused nothing to be parsed from the cont= tag. Double quotes made no difference in behavior.<br>
<br>
Maybe this is another oddity stemming from my ancient OS and underlying libraries. (Solaris 10)<br>
<br>
Do you see the behavior I described if you _don't_ wrap in quotes?<span class=""><br>
<br>
--<br>
   Do things because you should, not just because you can.<br>
<br>
John Thurston    <a href="tel:907-465-8591" value="+19074658591" target="_blank">907-465-8591</a><br>
<a href="mailto:John.Thurston@alaska.gov" target="_blank">John.Thurston@alaska.gov</a><br>
Department of Administration<br>
State of Alaska<br>
<br></span><span class="">
On 10/6/2017 9:21 AM, Ralph Mitchell wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Did you try quoting the entire 'cont;URL;[expected_data]" string?<br>
<br>
I just tried this:<br>
<br></span>
192.168.1.4   <a href="http://xxxx.yyyy.com" rel="noreferrer" target="_blank">xxxx.yyyy.com</a> <<a href="http://xxxx.yyyy.com" rel="noreferrer" target="_blank">http://xxxx.yyyy.com</a>>        #<br>
"cont;<a href="http://xxxx.yyyy.com/test.html" rel="noreferrer" target="_blank">http://xxxx.yyyy.com/tes<wbr>t.html</a> <<a href="http://xxxx.yyyy.com/test.html" rel="noreferrer" target="_blank">http://xxxx.yyyy.com/test.htm<wbr>l</a>>;<a<span class=""><br>
href=\x22foo/bar\x22>"<br>
<br>
and the page source for the "info" column shows:<br>
<br>
<tr><th align=left>Content checks:</th><td align=left><br>
<a href="<a href="http://xxxx.yyyy.com/test.html" rel="noreferrer" target="_blank">http://xxxx.yyyy.com/tes<wbr>t.html</a><br></span>
<<a href="http://xxxx.yyyy.com/test.html" rel="noreferrer" target="_blank">http://xxxx.yyyy.com/test.htm<wbr>l</a>>"><a href="http://xxxx.yyyy.com/test.html" rel="noreferrer" target="_blank">http://xxxx.yyyy.com/test.<wbr>html</a><span class=""><br>
<<a href="http://xxxx.yyyy.com/test.html" rel="noreferrer" target="_blank">http://xxxx.yyyy.com/test.htm<wbr>l</a>></a>&nbsp; must return '<a<br>
href="foo/bar">'<br><br>
</td></tr><br>
<br>
so you can see it picked up the whole  '<a href="foo/bar">' string.  The<br>
test.html file on the server contains nothing but the opening and<br>
closing html/body tags, and the match string.  If I change "foo" to<br>
"fod" in test.html, the match fails and if I change the leading "<" to a<br>
comma, the match also fails<br>
<br>
      <a href="http://xxxx.yyyy.com/test.html" rel="noreferrer" target="_blank">http://xxxx.yyyy.com/test.html</a> - Testing URL yields:<br>
<br>
      ,a href="foo/bar"><br>
<br>
Ralph Mitchell<br>
<br>
<br>
On Wed, Oct 4, 2017 at 4:55 PM, John Thurston <<a href="mailto:john.thurston@alaska.gov" target="_blank">john.thurston@alaska.gov</a><br></span><div><div class="h5">
<mailto:<a href="mailto:john.thurston@alaska.gov" target="_blank">john.thurston@alaska.g<wbr>ov</a>>> wrote:<br>
<br>
    I'm fighting with the correct escaping and encoding for http content<br>
    checks using the "cont=" tag:<br>
<br>
        cont[=COLUMN];URL;[expected_da<wbr>ta_regexp|#digesttype:digest]<br>
          This tag is used to specify a http/https check, where it is also<br>
          checked that specific content is present in the server response.<br>
<br>
    . . .<br>
<br>
          The regex is pre-processed for backslash "\" escape<br>
        sequences.  . .<br>
<br>
<br>
    I can't find the expression to match the string:<br>
       <a href="foo/bar"><br>
    (Which I hope your email client isn't going to try to render as html!)<br>
<br>
    The closest I can manage is:<br>
      a\x20href=\x22foo/bar\x22><br>
<br>
    Where \x20 is an ASCII space, and \x22 is a double-quote<br>
<br>
    If I put a leading \x3D (which is an equal-sign), that renders in<br>
    the search string and obviously doesn't match my supplied content.<br>
    If, however, I put a leading \x3C (which is the less-than sign) the<br>
    rest of the expression is eaten and is not rendered. I've tried<br>
    leading the \x3C with \x5C (which is a backslash), with no effect.<br>
<br>
    I also tried leading with \x5C\x78\x33\x43 (which is \x3C), which<br>
    renders as such, but does not match my string.<br>
<br>
    The upshot is, I can match enough of my string to be unique on my<br>
    page. But it seems like something isn't right in the regex escaping<br>
    and cleansing for this test. The supplied string should be accepted<br>
    as a string, but the "<" seems to be interpreted during the parsing<br>
    instead.<br>
<br>
    Can anyone else find a way to use a "<" in the regex of the cont= test?<br>
<br>
<br>
    --<br>
       Do things because you should, not just because you can.<br>
<br></div></div>
    John Thurston    <a href="tel:907-465-8591" value="+19074658591" target="_blank">907-465-8591</a> <tel:<a href="tel:907-465-8591" value="+19074658591" target="_blank">907-465-8591</a>><br>
    <a href="mailto:John.Thurston@alaska.gov" target="_blank">John.Thurston@alaska.gov</a> <mailto:<a href="mailto:John.Thurston@alaska.gov" target="_blank">John.Thurston@alaska.g<wbr>ov</a>><span class=""><br>
    Department of Administration<br>
    State of Alaska<br>
</span></blockquote><div class="HOEnZb"><div class="h5">
______________________________<wbr>_________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com" target="_blank">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" rel="noreferrer" target="_blank">http://lists.xymon.com/mailman<wbr>/listinfo/xymon</a><br>
</div></div></blockquote></div><br></div>