<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
<!--
@font-face
        {font-family:Calibri}
@font-face
        {font-family:Tahoma}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
span.EmailStyle17
        {font-family:"Calibri","sans-serif";
        color:#1F497D}
.MsoChpDefault
        {font-family:"Calibri","sans-serif"}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
-->
</style><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" lang="EN-US" link="blue" vlink="purple">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Look on the front page of xymonton.org.  There is a link to a "clientless" xymon client (xymon-rclient) that might do what you are looking for.<br>
<br>
=G=<br>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF784051"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Xymon [xymon-bounces@xymon.com] on behalf of Kevin King [kc6ovd@gmail.com]<br>
<b>Sent:</b> Tuesday, August 27, 2013 10:38 AM<br>
<b>To:</b> 'Jeremy Laidman'; 'KING, KEVIN'; xymon@xymon.com<br>
<b>Subject:</b> Re: [Xymon] Serial alarm feeds<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Jeremy,</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">This is good food for thought. I think I might need to run this as an external script. That way I can pass the host information, (I have more than one of
 these) Then I should be able to enter a hostname in the </span>logfetch-special.cfg file. I then could do this for almost any collector that cannot use a local client.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I seem to remember we had a tool like this way back in the BB days, I ether found something or I modified bb. Wish I still had that server! I built many a tool for BB. That is when I was on top of my game, I am a retread in this admin stuff.
 I look at some of the stuff I wrote in the early 2000s and I say wow nice code, what does it do?
</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thanks for the kick start!</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">-Kevin<span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> Xymon [mailto:xymon-bounces@xymon.com]
<b>On Behalf Of </b>Jeremy Laidman<br>
<b>Sent:</b> Tuesday, August 27, 2013 12:14 AM<br>
<b>To:</b> KING, KEVIN; xymon@xymon.com<br>
<b>Subject:</b> Re: [Xymon] Serial alarm feeds</span></p>
<p class="MsoNormal"> </p>
<div>
<div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">On 27 August 2013 13:31, KING, KEVIN <<a href="mailto:KK1051@att.com" target="_blank">KK1051@att.com</a>> wrote:</p>
<p class="MsoNormal">No no snmp. It is a very closed system. The messages we get are out of a serial port to a term server.</p>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">:-(</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-right:0in">
<p class="MsoNormal">I guess I do not know the client tool then. How can I save the files on my xymon server and use entries  in the client config and alert rules to make if show up under the correct server?  Maybe I am getting myself stuck in the mud, but
 if the file is on the xymon host how can I process it like it was on the client?</p>
</blockquote>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">A server is almost always also a client.  You should have the Xymon server name in hosts.cfg, yes?  Also, the Xymon server can be listed in client-local.cfg and analysis.cfg.  Just create appropriate entries
 in those two files for the server and the logfile, and it will report the errors as they appear.</p>
</div>
<div>
<p class="MsoNormal">The down-side to this is that the errors are assigned to the Xymon server.  If you want them assigned to the device name instead, then you will probably have to do something a bit more complex, such as writing a custom script on the Xymon
 server to do the log analysis and reporting.  I don't see a way that you can do this with the built-in log monitoring features.</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Hmm, here's an idea.  You could create a script that simply replicates the log file into a client message, which would be a substitute for the client-local.cfg entry.  So then you'd be able to use the standard "LOG" definitions in analysis.cfg
 to match whatever you want.</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">The easiest way to do this, I think, would be to run a second copy of logfetch on the Xymon server (the standard one is usually run from xymonclient.sh, from the [xymonclient] section of tasks.cfg).  The logfetch tool requires a configuration
 file and a state file as parameters.  Normally the config file is simply extracted from client-local.cfg and pushed to the client during the client message interaction, but you can simply create your own.  For example (untested), create in $XYMONTMP the file
 logfetch-special.cfg, containing the following:</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">log:/var/log/mylogfile:10240</p>
</div>
<div>
<p class="MsoNormal">    ignore THIS</p>
</div>
<div>
<p class="MsoNormal">    ignore THAT</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Then add the following into tasks.cfg or a new file in tasks.d:</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">[xymonclient-special]</p>
</div>
<div>
<p class="MsoNormal">    NEEDS xymond</p>
</div>
<div>
<p class="MsoNormal">    ENVFILE $XYMONCLIENTHOME/etc/xymonclient.cfg</p>
</div>
<div>
<p class="MsoNormal">    LOGFILE $XYMONCLIENTLOGS/xymonclient-special.log</p>
</div>
<div>
<p class="MsoNormal">    INTERVAL 5m</p>
</div>
<div>
<p class="MsoNormal">    CMD sh -c '( printf "eagle.example.com.eagle eagle\n[msgs:/var/log/mylogfile]\n"; $XYMONCLIENTHOME/bin/logfetch $XYMONTMP/logfetch-special.cfg $XYMONTMP/logfetch-special.status ) | $XYMON $XYMSRV "@"'</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">This creates a header, using the device's hostname, and a [msgs:] section for the logfile being monitored.  Then it uses logfetch to get the latest bunch of lines from the logfile, and filter out any "ignore" entries from the config file
 logfetch-special.cfg.  Finally, all of this is piped into an instance of xymon that creates a client message and sends it to the server.</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">The end result is a client message that should start to generate a "msgs" dot against the device name (assuming you added the device name into hosts.cfg - probably with a "noping" tag).  If this works, you can then start using analysis.cfg
 to have the Xymon server parse the log file from the client data.</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">This is all a bit kludgy.  You might prefer to extract the CMD bit into a separate script, and just put the script name after the CMD keyword.</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">J</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>