Xymon Mailing List Archive search

Help with hobbitd_channel and hobbitd_filestore

5 messages in this thread

list Taylor Lewick · Fri, 30 Oct 2009 08:35:08 -0500 ·
Hey all. 

I want to process the CPU pages for our Windows hosts to see if a given
process exceeds a certain memory size.

I wrote a perl script to do this against the files in
/home/hobbit/data/hostdata

But that directory only contains files that are a day old, or state
change files, and I'd like my program to work against data that is
closer to real time, i.e. a few minutes old is fine.

So I tried running from the command line as user hobbit:
./hobbitd_channel --channel=data
--log=/home/hobbit/data/logs/clientcpu.log  hobbitd_filestore --data
--only=cpu

And in the clientcpu.log I just see entry after entry of:
009-10-30 08:26:47 Our child has failed and will not talk to us: Channel
data, PID 28876, cause Bad file descriptor

Anyone have any idea what I'm doing wrong, or how I go about using
hobbit_channel and hobbit_filestore correctly?

FYI, running ./bbcmd hobbitd_channel --channel=client cat >
/home/hobbit/data/logs/clientlogs.log
Works, but it just runs in a continuous loop and is giving me all status
messages for all clients, so its really not that helpful...

Thanks,
Taylor
list Taylor Lewick · Fri, 30 Oct 2009 10:58:08 -0500 ·
I think this is a problem with hobbitd_filestore getting/reading the
correct file
I changed the hobbitd_channel command to: ./hobbitd_channel
--channel=client --log=/home/hobbit/data/logs/logfile.txt
get_channel_data.pl

The get_channel_data.pl was a very simple perl script I wrote just to
see if it was getting data from Standard Input.  And it worked.
The perl script is just:

#!/usr/bin/pl
$FH="/home/hobbit/data/logs/clientchannel.log":
open (OUTFILE, ">$FH");

while ( <STDIN> ) {
    chomp $_;
    print OUTFILE "$_\n";
}
close (OUTFILE);

So clientchannel.log has the output I'd expect to see.  And the logfile
is no longer being populated with "Our child has failed and will not
talk to us... Cause bad file descriptor" messages

The only similar post I could find on this was the following thread,
http://www.hswn.dk/hobbiton/2006/08/msg00326.html
But that was back a few years and was for someone who was running on
AIX, and it looked inconclusive.

FYI, I'm running hobbit 4.2.0 on a Suse 10.2 server.
list Taylor Lewick · Fri, 30 Oct 2009 11:16:45 -0500 ·
More digging, this stems from the fact that I was passing
channel=client, and hobbit_filestore doesn't support the client channel,
at least in the version I have, i.e. 4.2.0
I just tried running: bbcmd hobbitd_channel --channel=data
--log=/home/hobbit/data/logs/clientcpu.log hobbitd_filestore --data and
that did work.  

So now it's a question of, how do I get hobbitd_filestore to work with
hobbit_channel --channel=client?  Modify hobbitd_filestore.c?
quoted from Taylor Lewick


-----Original Message-----
From: Taylor Lewick 
Sent: Friday, October 30, 2009 10:58 AM
To: 'user-ae9b8668bcde@xymon.invalid'
Subject: RE: Help with hobbitd_channel and hobbitd_filestore

I think this is a problem with hobbitd_filestore getting/reading the
correct file
I changed the hobbitd_channel command to: ./hobbitd_channel
--channel=client --log=/home/hobbit/data/logs/logfile.txt
get_channel_data.pl

The get_channel_data.pl was a very simple perl script I wrote just to
see if it was getting data from Standard Input.  And it worked.
The perl script is just:

#!/usr/bin/pl
$FH="/home/hobbit/data/logs/clientchannel.log":
open (OUTFILE, ">$FH");

while ( <STDIN> ) {
    chomp $_;
    print OUTFILE "$_\n";
}
close (OUTFILE);

So clientchannel.log has the output I'd expect to see.  And the logfile
is no longer being populated with "Our child has failed and will not
talk to us... Cause bad file descriptor" messages

The only similar post I could find on this was the following thread,
http://www.hswn.dk/hobbiton/2006/08/msg00326.html
But that was back a few years and was for someone who was running on
AIX, and it looked inconclusive.

FYI, I'm running hobbit 4.2.0 on a Suse 10.2 server.
list Taylor Lewick · Fri, 30 Oct 2009 11:35:06 -0500 ·
Final update, for me at least.

I can get at the data I want by running:  ./bb 127.0.0.1 "hobbitdlog
hostname.cpu"  

I'd like to know if there is a "better" way to get this, or more
"correct" way, but this will work for me...
quoted from Taylor Lewick

-----Original Message-----
From: Taylor Lewick 
Sent: Friday, October 30, 2009 11:17 AM
To: 'user-ae9b8668bcde@xymon.invalid'
Subject: RE: Help with hobbitd_channel and hobbitd_filestore

More digging, this stems from the fact that I was passing
channel=client, and hobbit_filestore doesn't support the client channel,
at least in the version I have, i.e. 4.2.0
I just tried running: bbcmd hobbitd_channel --channel=data
--log=/home/hobbit/data/logs/clientcpu.log hobbitd_filestore --data and
that did work.  

So now it's a question of, how do I get hobbitd_filestore to work with
hobbit_channel --channel=client?  Modify hobbitd_filestore.c?


-----Original Message-----
From: Taylor Lewick 
Sent: Friday, October 30, 2009 10:58 AM
To: 'user-ae9b8668bcde@xymon.invalid'
Subject: RE: Help with hobbitd_channel and hobbitd_filestore

I think this is a problem with hobbitd_filestore getting/reading the
correct file
I changed the hobbitd_channel command to: ./hobbitd_channel
--channel=client --log=/home/hobbit/data/logs/logfile.txt
get_channel_data.pl

The get_channel_data.pl was a very simple perl script I wrote just to
see if it was getting data from Standard Input.  And it worked.
The perl script is just:

#!/usr/bin/pl
$FH="/home/hobbit/data/logs/clientchannel.log":
open (OUTFILE, ">$FH");

while ( <STDIN> ) {
    chomp $_;
    print OUTFILE "$_\n";
}
close (OUTFILE);

So clientchannel.log has the output I'd expect to see.  And the logfile
is no longer being populated with "Our child has failed and will not
talk to us... Cause bad file descriptor" messages

The only similar post I could find on this was the following thread,
http://www.hswn.dk/hobbiton/2006/08/msg00326.html
But that was back a few years and was for someone who was running on
AIX, and it looked inconclusive.

FYI, I'm running hobbit 4.2.0 on a Suse 10.2 server.
list Henrik Størner · Wed, 4 Nov 2009 09:56:08 +0000 (UTC) ·
In <user-8780f94e6492@xymon.invalid> "Taylor Lewick" <user-ccbabb0b3ab0@xymon.invalid> writes:
More digging, this stems from the fact that I was passing
channel=3Dclient, and hobbit_filestore doesn't support the client =
channel,
at least in the version I have, i.e. 4.2.0
I just tried running: bbcmd hobbitd_channel --channel=3Ddata
--log=3D/home/hobbit/data/logs/clientcpu.log hobbitd_filestore --data =
and
that did work. =20
So now it's a question of, how do I get hobbitd_filestore to work with
hobbit_channel --channel=3Dclient?  Modify hobbitd_filestore.c?
hobbitd_filestore was only intended as a compatibility module for
people migrating from Big Brother. Since BB didn't have the concept
of "client data", there is no support for logging client data via
hobbitd_filestore.

I would advise against logging all client data to disk files - 
unless you have a small setup (only a few hosts) it will cause
a lot of disk I/O and generally make your Xymon server very busy.
Much better to have your custom handler work directly from the 
data that is fed to it via STDIN from hobbitd_channel.


Regards,
Henrik