<div dir="ltr">Jeremy,<div><br></div><div>Yes, I used a status message as you described ("client" in place of color) to get my data into the clientlog.  But, as I had seen in a previous post, if I made this a blank for the default message id, this overwrote the entire clientlog.  On the other hand, if I specified a "client" id, it showed up in the clientlog as [<span style="color:rgb(0,0,0);white-space:pre-wrap">collector:client], which, with your information, I was finally able to figure out how to reference.</span></div><div><br></div><div>For example, to reference this...</div><div><span style="color:rgb(0,0,0);white-space:pre-wrap">[collector:mytest]</span><br></div><div><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">client/mytest hostname.example.com.linux client.mytest - This is a client message test
</pre></div><div>I had to use this...<br></div><div class="gmail_extra"><div><span style="font-size:12.8000001907349px">$XYMON $XYMSRV "clientlog </span><a href="http://hostname.example.com/" style="font-size:12.8000001907349px" target="_blank">hostname.example.com</a><span style="font-size:12.8000001907349px"> section=collector:mytest"</span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div></div><div class="gmail_extra"><div><div dir="ltr"><div>I know you mentioned there might be a delay, but if I insert a date in my test message</div><div><br></div><div><div><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">client/mytest hostname.example.com.linux client.mytest - This is a client message test <span style="font-family:arial,sans-serif">Mon Aug 17 11:10:16 EDT 2015</span>
</pre></div><div>I start seeing occasions when the clientlog date, the xymon header date (upper right) on the status page, the first line date on the status page, and this status message date are all exactly the same, down to the second, but other times, 3 of the 4 are the same, but the status message date on the status page still has the previous date/time. Why would this occur?</div><div><br></div><div>The reason I'm asking, the dates I provide in xymon status messages is occasionally different from what's displayed on my graphs.</div><div><br></div><div>ALSO, and I realize this may be for a totally different reason, but why would a history of a service show 4 changes of a status with the same time?  How is that even possible?  I mean, other than a status message being processed from four different places at the same time, of course.</div><div><br></div><div> Thanks!</div></div><div><br></div><div>David</div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div></div></div><div class="gmail_quote">On Mon, Aug 10, 2015 at 11:17 PM, Jeremy Laidman <span dir="ltr"><<a href="mailto:jlaidman@rebel-it.com.au" target="_blank">jlaidman@rebel-it.com.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Can you elaborate on "found a way"?  I'm guessing you sent a status message with testname="mytest" color="client" like so:<div><br></div><div>$XYMON $XYMSRV "status hostname.example.com.mytest client $CLIENTDATA"</div><div><br></div><div>This is a special case to support backwards compatibility.  It's probably better to use a client message like:</div><div><br></div><div>$XYMON $XYMSRV "client/mytest hostname.example.com.$OSTYPE $CLIENTDATA"</div><div><br></div><div>(In both cases, $CLIENTDATA might need to start with a newline.)</div><div><br></div><div>That's all beside the point.  They should both work for you.  But what you end up with is simply an extra section in the clientdata, and that's all.</div><div><br></div><div>What normally happens from here, for things like cpu, disk, memory and so on, is that the xymond_client process parses the client data, works out the status for each (typically against configurations in analysis.cfg) and then creating whatever graphs and status messages are relevant.  The important thing to note here is that xymond_client has special code to handle each and every case; if you want extra client data to be handled, you have to do it yourself, using a server-side script.  None of the code in xymond_client is generic enough to deal with new client data it hasn't been programmed for.</div><div><br></div><div>Let's say you want to write your own code to parse the client data and create your own status messages.  You have a couple of options to do this.  Firstly, you could create a script that uses "xymon clientlog" such as:</div><div><br></div><div>$XYMON $XYMSRV "clientlog <a href="http://hostname.example.com" target="_blank">hostname.example.com</a> section=mytest"</div><div><br></div><div>Try this out using "cpu" and "df" and "free" instead of mytest, to get a feel for it.  You should be able to extract your "[mytest]" section in this way.</div><div><br></div><div>Then, all you need to do is parse the output, and generate your own status (and optionally, data) messages.  You'd run your script every 5 minutes from tasks.cfg or cron.  There will almost certainly be a delay between when the client data message arrives and when your script runs, leading to delays in alerting of up to 5 minutes.</div><div><br></div><div>The second way to do this is to create your own xymond_client module equivalent, attached to a new instance of xymon_channel.  This method allows you to parse the client data message as soon as it arrives, and act accordingly (presumably creating your own data/status messages).  When running xymond_client, you can specify a filter so that you only get the matching messages.  For example, in tasks.cfg you might have:</div><div><br></div><div>[mytest]</div><div>  ENVFILE /bla/bla/xymonserver.cfg</div><div>  NEEDS xymond</div><div>  CMD xymond_channel --channel=client --logfile=$XYMONSERVERLOGS/mytest.log name_of_your_script_here</div><div><br></div><div>Your script will get the whole client data message as soon as it arrives, on standard input.  It's up to your script to parse this any way you need, such as matching hostnames and/or OS types, extracting the [section] you're interested in, separating each message from the next, and making status/data messages according to your needs.  Each message starts with "@@client#..." and ends with "@@".</div><div><br></div><div>Something to try (running as the xymon user):</div><div><br></div><div>xymond_channel --channel=client sed -n '/^\[cpu\]/,/^\[/p'</div><div><br></div><div>This displays only the lines between [df] and the next line that starts with "[".</div><div><br></div><div>Writing your own xymond_channel module is not a trivial task.  I would only entertain this strategy if you needed a fast response time.</div><div><br></div><div>Cheers</div><div>Jeremy</div><div> </div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On 7 August 2015 at 00:26, David Welker <span dir="ltr"><<a href="mailto:dewelker@gmail.com" target="_blank">dewelker@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Okay, in answer to my own question, I finally found, or so I thought, a way to add my client data to the Xymon clientdata, but how do I get it to show up under a specific section?  If I provide a TESTNAME, it ends up under a different collector id - [collector id: mytest].  If I make TESTNAME blank, it doesn't show up at all!<div><br></div><div>Thanks,</div>​<span><font color="#888888"><div>David</div></font></span></div>
<br></div></div>_______________________________________________<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/listinfo/xymon</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div>