<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 27 August 2013 13:31, KING, KEVIN <span dir="ltr"><<a href="mailto:KK1051@att.com" target="_blank">KK1051@att.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">


No no snmp. It is a very closed system. The messages we get are out of a serial port to a term server.</blockquote><div><br></div><div>:-(</div><div> </div><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">


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?</blockquote></div><div class="gmail_extra"><br></div>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.<br>


<br></div><div class="gmail_extra">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.</div>


<div class="gmail_extra"><br></div><div class="gmail_extra">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.</div>


<div class="gmail_extra"><br></div><div class="gmail_extra">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:</div>


<div class="gmail_extra"><br></div><div class="gmail_extra">log:/var/log/mylogfile:10240</div><div class="gmail_extra">    ignore THIS</div><div class="gmail_extra">    ignore THAT</div><div class="gmail_extra"><br></div>


<div class="gmail_extra">Then add the following into tasks.cfg or a new file in tasks.d:</div><div class="gmail_extra"><br></div><div class="gmail_extra">[xymonclient-special]</div><div class="gmail_extra">    NEEDS xymond</div>


<div class="gmail_extra">    ENVFILE $XYMONCLIENTHOME/etc/xymonclient.cfg</div><div class="gmail_extra">    LOGFILE $XYMONCLIENTLOGS/xymonclient-special.log</div><div class="gmail_extra">    INTERVAL 5m<br></div><div class="gmail_extra">


    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 "@"'</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">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.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">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.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">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.</div><div class="gmail_extra">

<br></div><div class="gmail_extra">J<br></div><div class="gmail_extra"><br></div>
</div>