<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style style="display: none;" id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style><style id="owaParaStyle" type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
</head>
<body tabindex="0" aria-label="Message body" fpstyle="1" dir="ltr">
<div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif; font-size: 12pt; color: #000000; margin: 0">
Actually, I think this will make my sed command more sane.  I can at least be sure that splitting on the pipe will ensure I have a complete section regardless of whitespace.<br>
<br>
=G=<br>
<br>
<div style="color: rgb(40, 40, 40);" dir="ltr">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> Galen Johnson<br>
<b>Sent:</b> Tuesday, January 14, 2014 10:35 AM<br>
<b>To:</b> Jeremy Laidman<br>
<b>Cc:</b> John Thurston; xymon@xymon.com<br>
<b>Subject:</b> RE: [Xymon] host grepping</font>
<div> </div>
</div>
<div>
<div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:#000000; margin:0">
I'll have a look at that.  However, at first glance, it still requires that you know the hostname of the server that you are monitoring.  This is a bit problematic for amazon hosted servers that all begin with ec2 (^ec2).  I am setting up the NAME to be my
 key for the actual server since most of the servers are not in DNS (apparently zenoss can work with  amazon using tags which I may end up "re-discovering" for myself).  Here is what I ended up doing (yet it's kludgey and could like be done better using an
 awk script but my awk is very rusty)...<br>
<br>
XYMONCFG=$XYMON_HOME/server/bin/xymoncfg<br>
XYMON_NAME=`$XYMONCFG | $GREP $BBHOSTNAME | $SED -e 's/ /\n/g' | grep NAME`<br>
<br>
yes...that is ugly and will likely suck for anything but my particular case.  That's why I was hoping xymongrep could be extended to handle grepping for more than just test names.<br>
<br>
=G=<br>
<br>
<div style="color:rgb(40,40,40)">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> Jeremy Laidman <jlaidman@rebel-it.com.au><br>
<b>Sent:</b> Tuesday, January 14, 2014 12:27 AM<br>
<b>To:</b> Galen Johnson<br>
<b>Cc:</b> John Thurston; xymon@xymon.com<br>
<b>Subject:</b> Re: [Xymon] host grepping</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On 10 January 2014 10:01, Galen Johnson <span dir="ltr">
<<a href="mailto:Galen.Johnson@sas.com" target="_blank">Galen.Johnson@sas.com</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">
Feature request: It would be handy to have xymongrep handle more than just test lookups to save some scripting time.  I think it would be awesome if it was extended to allow you to reference a host and have it return the tests for just that host (especially
 when it may be spread across multiple entries) and allow an argument to get the CLIENT, NAME or other modifier as needed.<br>
</blockquote>
<div><br>
</div>
<div>Does this help:</div>
<div><br>
</div>
<div><font face="courier new, monospace">$ $XYMON $XYMSRV 'hostinfo host=^hostname'</font></div>
<div>
<div><font face="courier new, monospace"><a href="http://hostname.example.com">hostname.example.com</a>|192.168.67.101|testip|delayred=dns:15,conn:15|delayyellow=dns:10,conn:10|dns=SOA:<a href="http://example.com">example.com</a>|TRENDS:*,vmstat:vmstat\pvmstat3</font></div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>From the "xymon" man page:</div>
<div><br>
</div>
<div>
<div><font face="courier new, monospace">       hostinfo [CRITERIA]</font></div>
<div><font face="courier new, monospace">              Retrieves the current configuration of a  host  (i.e.</font></div>
<div><font face="courier new, monospace">              the  hosts.cfg(5) definition). CRITERIA selects which</font></div>
<div><font face="courier new, monospace">              host(s) to report, and is identical to  the  CRITERIA</font></div>
<div><font face="courier new, monospace">              in the xymondboard command.</font></div>
<div><font face="courier new, monospace"><br>
</font></div>
<div><font face="courier new, monospace">              The  response  is one line for each host that matches</font></div>
<div><font face="courier new, monospace">              the CRITERIA, or all hosts if no criteria  is  speci-</font></div>
<div><font face="courier new, monospace">              fied.  The  line  is  composed of a number of fields,</font></div>
<div><font face="courier new, monospace">              separated by a pipe-sign. The first two  fields  will</font></div>
<div><font face="courier new, monospace">              always  be  the  hostname  and  the  IP-address.  The</font></div>
<div><font face="courier new, monospace">              remaining fields - if any - are the hosts.cfg tags in</font></div>
<div><font face="courier new, monospace">              no particular order.</font></div>
<div><br>
</div>
<div>I like this one because a client can query its own configuration remotely, or the test and configuration functions of the Xymon server can (potentially) be distributed.</div>
<div><br>
</div>
<div>J</div>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>