[Xymon] Working : Simple xymonclient on openwrt
Marijn Hofstra
m.hofstra at detamboer.nl
Thu Mar 10 13:34:52 CET 2011
> Hi,
>
> I am happy to say I have a xymon client running on Openwrt.
> I thought other people might find this useful in three ways:
>
> 1) If you are running openwrt you can take this code and run
> a xymon client to monitor your openwrt system.
>
> 2) People using other small unix-like systems can use the
> same design to run a xymon client, even if the code doesn't
> fit exactly.
>
> 3) My approach uses only shell scripts, none of the xymon
> binaries need to be cross compiled. So anyone struggling to
> compile xymon client for a foreign system can use this
> approach; all they need to do is add a few shell scripts and
> they don't need to compile anything.
>
> Details below.
>
> jonty
Thanks alot for the effort, very useful! I've been looking for a way to do this for quite a while, wouldn't have gotten there without your script. I have a bunch of routers running the kamikaze 8.09 openwrt firmware and I needed to fix a few things to xymonclient-linux.sh to get it to work as I wasn't planning on upgrading the firmware anytime soon. I used your modifications to the xymon-4.3.0 version of the script as a basis:
- get the hostname using:
MACHINE=`uci get system. at system[0].hostname`
- change the df command to just:
df
- comment out the "who" command, as it seems this command is not (easily) available on 8.09 (and nobody normally logs into the router anyway)
- install procps using "opkg install procps -force-overwrite" (opkg complained about already-installed packages)
- use the "logread" executable to print the messagelog. As there is some spam in the messagelog I took the liberty to filter out:
- spam generated by the hobbit-client checking the ssh connection
- spam from the cron daemon (there is a bug in the 8.09 cron daemon that causes redundant logging).
It's probably the wrong place to perform this kind of filtering and the filter itself isn't all that accurate as well... If you value your log messages you may want to fix it:).
All the usual stats show up nicely now on the xymon server. I've attached the working version of the scripts for those interested.
Regards,
Marijn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xymonclient-linux.sh
Type: application/octet-stream
Size: 2834 bytes
Desc: xymonclient-linux.sh
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20110310/ff55bb72/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xymonclient.sh
Type: application/octet-stream
Size: 1089 bytes
Desc: xymonclient.sh
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20110310/ff55bb72/attachment-0001.obj>
More information about the Xymon
mailing list