<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 10 September 2014 08:15, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:#000000;margin:0">
Have you considered using rsync to bring logs to a local folder (IIRC, this already requires "passwordless" ssh).</div></div></blockquote><div><br></div><div>That's an interesting idea.</div><div><br></div><div>I'd prefer to not have to transfer to and store the logs on the Xymon server, as this can be a significant traffic burden if the logfiles rotate often.  This is one of the reasons that client-side processing is attractive (to me).  After all, I could simply use syslog to transfer the log messages in real-time.</div><div><br></div><div>Actually, I've been tinkering with a version that emulates some of the logfetch processing using shell scripting, but not all of them.<br></div><div><br></div><div>There are 2 main functions that need to be emulated.  First, logfetch has to keep track of where it last looked at the logfile.  This can be done with wc (to capture current log size) and tail or dd (to simulate "seek").  Second, it applies the ignore and trigger terms from the local-client.cfg file, which we can do with egrep.</div><div><br></div><div>But then it gets significantly more complicated.  It has to handle checksum checks, "dir" directives, "linecount" (which is a multi-line configuration block), all of which require a bit of scripting gymnastics.  When I realised that I would also need to handle backticks, I decided it was becoming almost an exercise in demonstrating how much a lowly shell script could accomplish, regardless of how sensible it was to do so.</div><div><br></div><div>Nevertheless, at the risk of increasing run-times and complicating the code, I implemented a new version that supports many of the features of logfetch.  What's missing is the state processing for "log" files (it sends the whole log every time), and handling of "trigger" and "ignore".  I even have backticks working OK.  There are probably some assumptions, which mean the new features might not work properly on some flavours of UNIX, but so far it seems to be working OK on some Solaris clients.</div><div><br></div><div>I don't think it would take a lot of work to get the statefulness working.  But it's time I don't have just at the moment, nor do I have a need for this feature at present.</div><div><br></div><div>I'll upload version 0.6 to the website in the next few hours.  If anyone wants to hack on it, they're welcome to do so, and submit patches.</div><div><br></div><div>Cheers</div><div>Jeremy</div><div><br></div></div></div></div>