[Xymon] xymon-rclient.sh

Jeremy Laidman jlaidman at rebel-it.com.au
Wed Sep 10 03:55:59 CEST 2014


On 10 September 2014 08:15, Galen Johnson <Galen.Johnson at sas.com> wrote:

>  Have you considered using rsync to bring logs to a local folder (IIRC,
> this already requires "passwordless" ssh).
>

That's an interesting idea.

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.

Actually, I've been tinkering with a version that emulates some of the
logfetch processing using shell scripting, but not all of them.

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.

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.

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.

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.

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.

Cheers
Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20140910/bb225ac6/attachment.html>


More information about the Xymon mailing list