Xymon Mailing List Archive search

Feature request: OS support for GNU/kFreeBSD

list Henrik Størner
Mon, 28 Jan 2008 12:29:02 +0100
Message-Id: <user-dea035aaea1a@xymon.invalid>

On Fri, Jan 25, 2008 at 11:23:45PM +0100, Axel Beckert wrote:
I tried to get hobbit compiling and running on Debian
GNU/kFreeBSD[1]. Getting it to compile was quite easy, getting it run,
too, but getting it work isn't[2].

  [1] http://www.debian.org/ports/kfreebsd-gnu/
  [2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=458417

Getting the client run needed some more files to exist. Now I've got
an ugly but running client sending data to my hobbit
server. Unfortunately the server drops it with the message

2008-01-25 22:41:09 No client backend for OS 'gnu/kfreebsd' sent by [...]
As I would expect it to do. The Hobbit server needs to know how the data
sent by the GNU/kFreeBSD client is formatted, in order for it to extract
the information it uses to check the client state against the
configuration thresholds.
Adding a new OS in general isn't difficult with hobbit on the client
side, you just copy some shell script, perhaps edit it and it
works. With GNU/kFreeBSD it looks a little bit different:

  14/0/0 root at c-metisse:pts/ttyp3 22:49:51 [~] # uname -o
  GNU/kFreeBSD
Hobbit actually uses "uname -s". On my Linux system this gives "Linux",
whereas "uname -o" returns "GNU/Linux".
The solution suggested by the GNU/kFreeBSD developers for this problem
is to replace all slashes in the output of "uname -o" with
underscores
This is easily fixed by changing the "tr" command in client/runclient.sh,
client/hobbitclient.sh and the various build/*.sh scripts to do this
conversion.

Hernik: How do you think that problem is solved best from your view as
hobbit developer?
The uname output isn't used that much in Hobbit. In most of the code 
it is immediately transformed into an enumerated value - OS_LINUX,
OS_FREEBSD etc. - and that is what Hobbit uses throughout all of the
server-side code. This transformation happens in the lib/misc.c code.
The few places - shell scripts - that uses uname output directly can
be modified as per your developer recommendation.

I'll send You a patch does this, and also creates a basic client inter-
preter which assumes that the data looks like the Linux data. You need
to modify the hobbitd/client/gnukfreebsd.c file to make it work with the 
data you get from your client. There are also some - probably slight - 
modifications needed for the hobbitd/rrd/do_{if,net,vm}stat.rrd files 
to recognize data from OS_GNUKFREEBSD labeled hosts, and of course the
client-side script is missing.

The patch is on top of the current snapshot. Please send me whatever
modifications you do to make Hobbit work on this platform.


Regards,
Henrik

PS: I know RMS is keen on the "GNU/whatever" thing, but personally I've
always found the use of filesystem special characters in such names to 
be a major design blunder. But now it's here, so we have to live with
it.