Xymon Mailing List Archive search

File status information in client-data

10 messages in this thread

list Thomas Kern · Mon, 13 Nov 2006 14:03:48 -0500 ·
I am running on a z/VM 5.1 system and trying to deliver our data to a
hobbit server in a client-data format that hobbit will read & process
without backend changes. This is a locally configured client.

I am working on the 'file', 'logfile' and 'messages' components of our
system. I can get our system log and its status information to hobbit as
well as file status information for other files. The unaltered,
minimally configured hobbit server shows the msgs and files columns
fine, IF there is good data. I am now trying to provide an error
condition, where one of the monitored files does not exist. I found some
syntax for this error condition by running logfetch on a SLES10 system
with a special logfetch.cfg. When I mimic that same syntax in my z/VM
client data file, Hobbit still shows the file as green but with 'No
Data'. I would like the file to be marked Yellow in the hobbit files
display. Must there be a file configuration record in the hobbit server
before it will check for the error condition? 

Here is the piece from my client data file.
[file:/VMSYSU/DFSMS./RMSMASTR.%TODAY]
ERROR: No such file or directory
[file:/DISKACNT/0191/ACCOUNT.$A111306]
type:100000 (file)
mode:640 (-rw-r-----)
linkcount:1
owner:0 (root)
group:3 (sys)
size:6880
clock:1163443363 (2006/11/13-13:42:43)
atime:1163442621 (2006/11/13-13:30:21)
ctime:1163442621 (2006/11/13-13:30:21)
mtime:1163442621 (2006/11/13-13:30:21)
md5:79d5fe932a2784f2650e17a811fb4a17

/Thomas Kern
/XXX-XXX-XXXX
list Henrik Størner · Mon, 13 Nov 2006 22:39:50 +0100 ·
quoted from Thomas Kern
On Mon, Nov 13, 2006 at 02:03:48PM -0500, Kern, Thomas wrote:
client data file, Hobbit still shows the file as green but with 'No
Data'. I would like the file to be marked Yellow in the hobbit files
display. Must there be a file configuration record in the hobbit server
before it will check for the error condition? 
Yes, you need a definition in the hobbit-clients.cfg file for the
"files" column to change colour. Sending the file data in the client
message doesn't do anything until you define the checks that are
relevant for the file in hobbit-clients.cfg


Regards,
Henrik
list Rich Smrcina · Mon, 13 Nov 2006 15:44:49 -0600 ·
Henrik,

Just to clarify, is this still true for a locally administered client (even Linux)?
quoted from Henrik Størner

Henrik Stoerner wrote:
On Mon, Nov 13, 2006 at 02:03:48PM -0500, Kern, Thomas wrote:
client data file, Hobbit still shows the file as green but with 'No
Data'. I would like the file to be marked Yellow in the hobbit files
display. Must there be a file configuration record in the hobbit server
before it will check for the error condition? 
Yes, you need a definition in the hobbit-clients.cfg file for the
"files" column to change colour. Sending the file data in the client
message doesn't do anything until you define the checks that are
relevant for the file in hobbit-clients.cfg


Regards,
Henrik

-- 

Rich Smrcina
VM Assist, Inc.
Phone: XXX-XXX-XXXX
Ans Service:  XXX-XXX-XXXX
user-61add9955ef9@xymon.invalid

Catch the WAVV!  http://www.wavv.org
WAVV 2007 - Green Bay, WI - May 18-22, 2007
list Thomas Kern · Mon, 13 Nov 2006 16:45:43 -0500 ·
Thanks, I will put in a request to the Hobbit admin to add a check for
this test file and see what happens.

/Thomas Kern
/XXX-XXX-XXXX 
quoted from Rich Smrcina
-----Original Message-----
From: user-ce4a2c883f75@xymon.invalid [mailto:user-ce4a2c883f75@xymon.invalid] 
Sent: Monday, November 13, 2006 4:40 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] File status information in client-data

On Mon, Nov 13, 2006 at 02:03:48PM -0500, Kern, Thomas wrote:
client data file, Hobbit still shows the file as green but with 'No
Data'. I would like the file to be marked Yellow in the hobbit files
display. Must there be a file configuration record in the 
hobbit server
before it will check for the error condition? 
Yes, you need a definition in the hobbit-clients.cfg file for the
"files" column to change colour. Sending the file data in the client
message doesn't do anything until you define the checks that are
relevant for the file in hobbit-clients.cfg

Regards,
Henrik
list Henrik Størner · Mon, 13 Nov 2006 23:29:02 +0100 ·
quoted from Rich Smrcina
On Mon, Nov 13, 2006 at 03:44:49PM -0600, Rich Smrcina wrote:
Henrik,

Just to clarify, is this still true for a locally administered client 
(even Linux)?
On a locally admin'ed client, you have the "hobbit-clients.cfg" file
locally. You still need to put a FILE entry into hobbit-clients.cfg to
tell Hobbit what rules should be applied to the file you're checking.
(Should it exist? Or not? Have a certain size? Be owned by "root"?)


Regards,
Henrik
list Thomas Kern · Mon, 13 Nov 2006 23:41:35 -0500 ·
Now comes the twist in this. Rich and I are building a hobbit client for
a NON-Linux platform, so whatever code that reads hobbit-clients.cfg and
determines the rules, doesn't run on our platform. We have to figure out
how to completely mimic the data flow to the server. 

So if a linux server has a hobbit-client.cfg that has a file entry for
/var/log/special and we only care that the file exists, what does the
client-data stream need to contain in the [file:/var/log/special]
section that will signal a hobbit server to mark this as a Yellow
condition? The size and modification date might be other conditions that
people will want to check on our platform.
quoted from Henrik Størner

/Thomas Kern
/XXX-XXX-XXXX 
-----Original Message-----
From: user-ce4a2c883f75@xymon.invalid [mailto:user-ce4a2c883f75@xymon.invalid] 
Sent: Monday, November 13, 2006 5:29 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] File status information in client-data

On Mon, Nov 13, 2006 at 03:44:49PM -0600, Rich Smrcina wrote:
Henrik,

Just to clarify, is this still true for a locally 
administered client 
(even Linux)?
On a locally admin'ed client, you have the "hobbit-clients.cfg" file
locally. You still need to put a FILE entry into hobbit-clients.cfg to
tell Hobbit what rules should be applied to the file you're checking.
(Should it exist? Or not? Have a certain size? Be owned by "root"?)
list Henrik Størner · Tue, 14 Nov 2006 09:30:19 +0100 ·
quoted from Thomas Kern
On Mon, Nov 13, 2006 at 11:41:35PM -0500, Kern, Thomas wrote:
Now comes the twist in this. Rich and I are building a hobbit client for
a NON-Linux platform, so whatever code that reads hobbit-clients.cfg and
determines the rules, doesn't run on our platform. We have to figure out
how to completely mimic the data flow to the server. 

So if a linux server has a hobbit-client.cfg that has a file entry for
/var/log/special and we only care that the file exists, what does the
client-data stream need to contain in the [file:/var/log/special]
section that will signal a hobbit server to mark this as a Yellow
condition? The size and modification date might be other conditions that
people will want to check on our platform.
You should take a look at the printfiledata() routine in
client/logfetch.c - this is where those [file:/foo/bar.baz] data are
generated.

However, that is only part of the picture. What you want to do is really
to build a more-or-less complete Hobbit client message. This begins with
a line that identifies the OS the message is from (see the
~client/tmp/msg.HOSTNAME.txt file on any Hobbit client); this in turn
determines how the data are processed by hobbitd_client. The catch here
is that if your OS name is not recognized, then no processing is done -
even though part of the message might be formatted just like another OS.

So to get your data recognized by Hobbit, you must add the OS to those
recognized, and write a back-end module for hobbitd_client that picks up
those parts of the client message you want to process and sends them
through Hobbit's built-in routines that match the data against the
hobbit-clients.cfg configuration settings. It's not a whole lot of code;
you can copy one of the existing files in the hobbitd/client/ directory,
and use it more or less unchanged for your OS. Then a couple of lines
must be added in hobbitd/hobbitd_client.c to call your new OS module,
and in lib/misc.c to recognize the OS name. I'll be happy to help you
with those bits if you need assistance.


Regards,
Henrik
list Thomas Kern · Tue, 14 Nov 2006 08:55:33 -0500 ·
I will take a look at the logfetch.c to check on what it writes into the
client-data stream. 
If the hobbit server receives a complete client-data stream with file:
status information and a separate status message for machinename.files,
which one gets used for creating the files webpage? 
quoted from Henrik Størner
/Thomas Kern
/XXX-XXX-XXXX 
-----Original Message-----
From: user-ce4a2c883f75@xymon.invalid [mailto:user-ce4a2c883f75@xymon.invalid] Sent: Tuesday, November 14, 2006 3:30 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] File status information in client-data

You should take a look at the printfiledata() routine in
client/logfetch.c - this is where those [file:/foo/bar.baz] data are
generated.

However, that is only part of the picture. What you want to do is really
to build a more-or-less complete Hobbit client message. This begins with
a line that identifies the OS the message is from (see the
~client/tmp/msg.HOSTNAME.txt file on any Hobbit client); this in turn
determines how the data are processed by hobbitd_client. The catch here
is that if your OS name is not recognized, then no processing is done -
even though part of the message might be formatted just like another OS.

So to get your data recognized by Hobbit, you must add the OS to those
recognized, and write a back-end module for hobbitd_client that picks up
those parts of the client message you want to process and sends them
through Hobbit's built-in routines that match the data against the
hobbit-clients.cfg configuration settings. It's not a whole lot of code;
you can copy one of the existing files in the hobbitd/client/ directory,
and use it more or less unchanged for your OS. Then a couple of lines
must be added in hobbitd/hobbitd_client.c to call your new OS module,
and in lib/misc.c to recognize the OS name. I'll be happy to help you
with those bits if you need assistance.
list Henrik Størner · Tue, 14 Nov 2006 17:00:56 +0100 ·
quoted from Thomas Kern
On Tue, Nov 14, 2006 at 08:55:33AM -0500, Kern, Thomas wrote:
If the hobbit server receives a complete client-data stream with file:
status information and a separate status message for machinename.files,
which one gets used for creating the files webpage? 
If both are sent, and the client-data message is recognized and
processed by hobbitd_client, then you will get "random" results.
Internally, the client-data information results in status-messages being
generated, so you would alternately see a status-message generated from
the client-data, and one generated by your own system.

In other words, "don't do that".


Regards,
Henrik
list Thomas Kern · Tue, 14 Nov 2006 11:04:41 -0500 ·
Got it, one or the other. Status message or client-data section but not
both.

/Thomas Kern
/XXX-XXX-XXXX 
-----Original Message-----
From: user-ce4a2c883f75@xymon.invalid [mailto:user-ce4a2c883f75@xymon.invalid] Sent: Tuesday, November 14, 2006 11:01 AM
quoted from Henrik Størner

On Tue, Nov 14, 2006 at 08:55:33AM -0500, Kern, Thomas wrote:
If the hobbit server receives a complete client-data stream with file:
status information and a separate status message for machinename.files,
which one gets used for creating the files webpage? 
If both are sent, and the client-data message is recognized and
processed by hobbitd_client, then you will get "random" results.
Internally, the client-data information results in status-messages being
generated, so you would alternately see a status-message generated from
the client-data, and one generated by your own system.

In other words, "don't do that".