Xymon Mailing List Archive search

Setting client "class" for log file monitoring

13 messages in this thread

list Gary B. · Wed, 23 Aug 2006 11:49:57 -0400 ·
The client by default uses the "uname -s" output, which will be
"linux". If you launch the client with
    ~hobbit/client/runclient.sh --os=rhel3
then it will use the [rhel3] setting. The list --os names is restricted
though, so for a more generic solution you can define your own "classes"
and run the client with a "--class=MYCLASS" option; then it will use
the [MYCLASS] section.
Is there a way to make the "--class=MYCLASS" option permanent when
starting a client?  That is, do you have to specify --class everytime
you use "runclient.sh", such as stopping, starting, restarting, etc?
list Adam Scheblein · Wed, 23 Aug 2006 11:27:42 -0500 ·
Greetings,

I am currently working on implementing a script that will give output the
same as vmstat but for mac.  Does Hobbit create graphs based on what the
client is??

I ask because currently I have the following output coming from the mac:

[vmstat]
procs -----------memory---------- ---swap-- -----io---- --system--
----cpu----
r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs    us sy
id
2  0      0      0      0      0    0    0     0     0    0     0    3 47 49
2  0      0      0      0      0    0    0     0     0    0     0    8 42 49


(I only have r, us, sy and id implemented at the moment)

However, Hobbit server is refusing to make a vmstat graph.  Am I missing
something??

Thanks,
Adam
list Bob Gordon · Wed, 23 Aug 2006 13:05:25 -0700 ·
quoted from Gary B.
On 8/23/06, Gary B. <user-33b796116d5f@xymon.invalid> wrote:
The client by default uses the "uname -s" output, which will be
"linux". If you launch the client with
    ~hobbit/client/runclient.sh --os=rhel3
then it will use the [rhel3] setting. The list --os names is restricted
though, so for a more generic solution you can define your own "classes"
and run the client with a "--class=MYCLASS" option; then it will use
the [MYCLASS] section.
Is there a way to make the "--class=MYCLASS" option permanent when
starting a client?  That is, do you have to specify --class everytime
you use "runclient.sh", such as stopping, starting, restarting, etc?
And as a correllary to this, is there any way to set the class option
remotely?  (I dont have access to several of the systems the client is
running on..)

-- 
--==[ Bob Gordon ]==--
list Henrik Størner · Wed, 23 Aug 2006 22:41:12 +0200 ·
quoted from Bob Gordon
On Wed, Aug 23, 2006 at 01:05:25PM -0700, Bob Gordon wrote:
On 8/23/06, Gary B. <user-33b796116d5f@xymon.invalid> wrote:
The client by default uses the "uname -s" output, which will be
"linux". If you launch the client with
    ~hobbit/client/runclient.sh --os=rhel3
then it will use the [rhel3] setting. The list --os names is restricted
though, so for a more generic solution you can define your own "classes"
and run the client with a "--class=MYCLASS" option; then it will use
the [MYCLASS] section.
Is there a way to make the "--class=MYCLASS" option permanent when
starting a client?  That is, do you have to specify --class everytime
you use "runclient.sh", such as stopping, starting, restarting, etc?
And as a correllary to this, is there any way to set the class option
remotely?  (I dont have access to several of the systems the client is
running on..)
See the CLASS entry in the bb-hosts(5) man-page.


Henrik
list Henrik Størner · Wed, 23 Aug 2006 22:56:31 +0200 ·
quoted from Adam Scheblein
On Wed, Aug 23, 2006 at 11:27:42AM -0500, Scheblein, Adam wrote:
I am currently working on implementing a script that will give output the
same as vmstat but for mac.  Does Hobbit create graphs based on what the
client is??
The Hobbit server will only process the types of data it knows about. 
And for OSX it doesn't know about any vmstat data since I've never seen 
any vmstat data from that type of system.

So first of all, it requires modifying the hobbitd/rrd/do_vmstat.c file
to recognize your vmstat data format and create/update an RRD file.
Second, if you're sending the data as part of the client message then
the hobbitd/client/darwin.c file must have a line added to actually
send the vmstat data to the RRD module.
quoted from Adam Scheblein
I ask because currently I have the following output coming from the mac:

[vmstat]
procs -----------memory---------- ---swap-- -----io---- --system--  ----cpu----
r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs    us sy id
2  0      0      0      0      0    0    0     0     0    0     0    3 47 49
2  0      0      0      0      0    0    0     0     0    0     0    8 42 49

(I only have r, us, sy and id implemented at the moment)
Still, it's a start. Are the other values impossible to get, or haven't
you gotten around to implementing them yet?

To get the graph, add these two items to the hobbitd/rrd/do_vmstat.c file:
First a table describing the vmstat columns - just put it somewhere with
the other tables:

static vmstat_layout_t vmstat_darwin_layout[] = {
        { 0, "cpu_r" },
        { 1, "cpu_b" },
        { -1, "cpu_w" },
        { 2, "mem_swpd" },
        { 3, "mem_free" },
        { 4, "mem_buff" },
        { 5, "mem_cach" },
        { 6, "mem_si" },
        { 7, "mem_so" },
        { 8, "dsk_bi" },
        { 9, "dsk_bo" },
        { 10, "cpu_int" },
        { 11, "cpu_csw" },
        { 12, "cpu_usr" },
        { 13, "cpu_sys" },
        { 14, "cpu_idl" },
        { -1, "cpu_wait" },
        { -1, NULL }
};

Next, in the same file find this bit:
          case OS_DARWIN:
                errprintf("Cannot handle Darwin vmstat from host '%s' \n", hostname);
                return -1;
and replace it with
          case OS_DARWIN:
		layout = vmstat_darwin_layout; break;

Finally, in the hobbitd/client/darwin.c file add this to invoke the
standard vmstat handler from the client data: First a line declaring
a variable for the vmstat data, just after the other declarations:

	char *portsstr;
	char *vmstatstr;  <-- add this line

A bit further down grab the vmstat data:
	portsstr = getdata("ports");
	vmstatstr = getdata("vmstat");	<-- add this line

And finally pass this data to the vmstat module: After the line
	unix_ifstat_report(hostname, clienttype, os, hinfo, fromline, timestr, ifstatstr);
add this line:
	unix_vmstat_report(hostname, clienttype, os, hinfo, fromline, timestr, vmstatstr);


Regards,
Henrik
list Francesco Duranti · Wed, 23 Aug 2006 23:29:00 +0200 ·
Hi, i continue to have a problem with the class ...
I've a class defined in the clientlocal.cfg that check for 2 files.

[servcluster]
log:/var/log/messages:10240
ignore MARK
file:/prodQ8/appl/mounted
file:/collQ8/appl/mounted
clientversion:rhel3_2cpu_drbd 
I've 2 server defined in the bb-hosts that are the same and where the
first file exists and the second one don't exist..
group-compress Internal Cluster
0.0.0.0 itromlx101 #  ntpd ntp ssh !telnet vnc1 CLASS:servcluster
0.0.0.0 itromlx102 #  ntpd ntp ssh !telnet vnc1 CLASS:servcluster

And until here all is working... The file will be checked by the
hobbit-client and the result will go to the server.

Then I have this in the hobbit-clients.cfg
HOST=itromlx102
        FILE /prodQ8/appl/mounted red
        FILE /collQ8/appl/mounted yellow

CLASS=servcluster
        FILE /prodQ8/appl/mounted red
        FILE /collQ8/appl/mounted yellow


The CLASS directive here is completely ignored... The test is reported
yellow on itromlx102 (as per HOST definition) but green on itromlx101. 
Going to itromlx101 in the file:/collQ8/appl/mounted i get [file:/collQ8/appl/mounted]
ERROR: No such file or directory


So the file don't exists but it's reported green

Running hobbitd_client --debug --dump-config I get FILE /prodQ8/appl/mounted red CLASS=servcluster (line: 191)
FILE /collQ8/appl/mounted yellow CLASS=servcluster (line: 192)

I've tried to add --debug to the hobbitd_client but it seems that
nothing regarding file check is in the clientdata.log ...

Am i doing something wrong with class ? 
quoted from Henrik Størner
-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid] Sent: Wednesday, August 23, 2006 10:41 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Setting client "class" for log file monitoring

On Wed, Aug 23, 2006 at 01:05:25PM -0700, Bob Gordon wrote:
On 8/23/06, Gary B. <user-33b796116d5f@xymon.invalid> wrote:
The client by default uses the "uname -s" output, which will be > >> "linux". If you launch the client with
    ~hobbit/client/runclient.sh --os=rhel3 then it will use the > >> [rhel3] setting. The list --os names is restricted though, so for a > >> more generic solution you can define your own "classes"
and run the client with a "--class=MYCLASS" option; then it will > >> use the [MYCLASS] section.
Is there a way to make the "--class=MYCLASS" option permanent when > >starting a client?  That is, do you have to specify --class everytime > >you use "runclient.sh", such as stopping, starting, restarting, etc?

And as a correllary to this, is there any way to set the class option > remotely?  (I dont have access to several of the systems the client is > running on..)
See the CLASS entry in the bb-hosts(5) man-page.


Henrik

list Bob Gordon · Wed, 23 Aug 2006 17:16:19 -0700 ·
On 8/23/06, Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> wrote:

See the CLASS entry in the bb-hosts(5) man-page.
Thanks..  I missed it when I was going through the docs...  ;)

-- 
--==[ Bob Gordon ]==--
list Adam Scheblein · Thu, 24 Aug 2006 08:48:15 -0500 ·
quoted from Henrik Størner
-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid]
Sent: Wednesday, August 23, 2006 3:57 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] vmstat/cpu graphs for OS X

On Wed, Aug 23, 2006 at 11:27:42AM -0500, Scheblein, Adam wrote:
I am currently working on implementing a script that will give output
the
same as vmstat but for mac.  Does Hobbit create graphs based on what the
client is??
The Hobbit server will only process the types of data it knows about.
And for OSX it doesn't know about any vmstat data since I've never seen
any vmstat data from that type of system.

So first of all, it requires modifying the hobbitd/rrd/do_vmstat.c file
to recognize your vmstat data format and create/update an RRD file.
Second, if you're sending the data as part of the client message then
the hobbitd/client/darwin.c file must have a line added to actually
send the vmstat data to the RRD module.
That makes sense (and is also what I suspected was happening
quoted from Henrik Størner

I ask because currently I have the following output coming from the mac:

[vmstat]
procs -----------memory---------- ---swap-- -----io---- --system--  ----
cpu----
r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs    us
sy id
2  0      0      0      0      0    0    0     0     0    0     0    3
47 49
2  0      0      0      0      0    0    0     0     0    0     0    8
42 49
(I only have r, us, sy and id implemented at the moment)
Still, it's a start. Are the other values impossible to get, or haven't
you gotten around to implementing them yet?
Most of the are possible to get, I just have not had time to implement them
yet.  I will get there probably within the next week or 2
quoted from Henrik Størner
To get the graph, add these two items to the hobbitd/rrd/do_vmstat.c file:
First a table describing the vmstat columns - just put it somewhere with
the other tables:

static vmstat_layout_t vmstat_darwin_layout[] = {
        { 0, "cpu_r" },
        { 1, "cpu_b" },
        { -1, "cpu_w" },
        { 2, "mem_swpd" },
        { 3, "mem_free" },
        { 4, "mem_buff" },
        { 5, "mem_cach" },
        { 6, "mem_si" },
        { 7, "mem_so" },
        { 8, "dsk_bi" },
        { 9, "dsk_bo" },
        { 10, "cpu_int" },
        { 11, "cpu_csw" },
        { 12, "cpu_usr" },
        { 13, "cpu_sys" },
        { 14, "cpu_idl" },
        { -1, "cpu_wait" },
        { -1, NULL }
};

Next, in the same file find this bit:
          case OS_DARWIN:
                errprintf("Cannot handle Darwin vmstat from host '%s' \n",
hostname);
                return -1;
and replace it with
          case OS_DARWIN:
		layout = vmstat_darwin_layout; break;

Finally, in the hobbitd/client/darwin.c file add this to invoke the
standard vmstat handler from the client data: First a line declaring
a variable for the vmstat data, just after the other declarations:

	char *portsstr;
	char *vmstatstr;  <-- add this line

A bit further down grab the vmstat data:
	portsstr = getdata("ports");
	vmstatstr = getdata("vmstat");	<-- add this line

And finally pass this data to the vmstat module: After the line
	unix_ifstat_report(hostname, clienttype, os, hinfo, fromline,
timestr, ifstatstr);
add this line:
	unix_vmstat_report(hostname, clienttype, os, hinfo, fromline,
timestr, vmstatstr);
I will give this a shot and let you know how it goes.  Thanks for the HOWTO
for changing the code -- I would have been lost.
Regards,
Henrik

list Adam Scheblein · Thu, 24 Aug 2006 10:53:18 -0500 ·
OK, so I put in the extra code and everything compiled without any issue, I
recompiled both the server and the client with the new code and now vmstat
data is being transmitted and the server is trying to graph the data,
however, it keeps giving me a blank graph and displays nan for the values of
the datapoints on the graph.  Am I missing something??  Will it not graph if
the values do not add up exactly to 100%??

Thanks,
Adam
quoted from Adam Scheblein
-----Original Message-----
From: Scheblein, Adam [mailto:user-de8d51f0c651@xymon.invalid]
Sent: Thursday, August 24, 2006 8:48 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] vmstat/cpu graphs for OS X
-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid]
Sent: Wednesday, August 23, 2006 3:57 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] vmstat/cpu graphs for OS X

On Wed, Aug 23, 2006 at 11:27:42AM -0500, Scheblein, Adam wrote:
I am currently working on implementing a script that will give output
the
same as vmstat but for mac.  Does Hobbit create graphs based on what
the
client is??
The Hobbit server will only process the types of data it knows about.
And for OSX it doesn't know about any vmstat data since I've never seen
any vmstat data from that type of system.

So first of all, it requires modifying the hobbitd/rrd/do_vmstat.c file
to recognize your vmstat data format and create/update an RRD file.
Second, if you're sending the data as part of the client message then
the hobbitd/client/darwin.c file must have a line added to actually
send the vmstat data to the RRD module.
That makes sense (and is also what I suspected was happening

I ask because currently I have the following output coming from the
mac:

[vmstat]
procs -----------memory---------- ---swap-- -----io---- --system--  --
--
cpu----
r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs
us
sy id
2  0      0      0      0      0    0    0     0     0    0     0    3
47 49
2  0      0      0      0      0    0    0     0     0    0     0    8
42 49
(I only have r, us, sy and id implemented at the moment)
Still, it's a start. Are the other values impossible to get, or haven't
you gotten around to implementing them yet?
Most of the are possible to get, I just have not had time to implement
them
yet.  I will get there probably within the next week or 2
To get the graph, add these two items to the hobbitd/rrd/do_vmstat.c
file:
First a table describing the vmstat columns - just put it somewhere with
the other tables:

static vmstat_layout_t vmstat_darwin_layout[] = {
        { 0, "cpu_r" },
        { 1, "cpu_b" },
        { -1, "cpu_w" },
        { 2, "mem_swpd" },
        { 3, "mem_free" },
        { 4, "mem_buff" },
        { 5, "mem_cach" },
        { 6, "mem_si" },
        { 7, "mem_so" },
        { 8, "dsk_bi" },
        { 9, "dsk_bo" },
        { 10, "cpu_int" },
        { 11, "cpu_csw" },
        { 12, "cpu_usr" },
        { 13, "cpu_sys" },
        { 14, "cpu_idl" },
        { -1, "cpu_wait" },
        { -1, NULL }
};

Next, in the same file find this bit:
          case OS_DARWIN:
                errprintf("Cannot handle Darwin vmstat from host '%s'
\n",
hostname);
                return -1;
and replace it with
          case OS_DARWIN:
		layout = vmstat_darwin_layout; break;

Finally, in the hobbitd/client/darwin.c file add this to invoke the
standard vmstat handler from the client data: First a line declaring
a variable for the vmstat data, just after the other declarations:

	char *portsstr;
	char *vmstatstr;  <-- add this line

A bit further down grab the vmstat data:
	portsstr = getdata("ports");
	vmstatstr = getdata("vmstat");	<-- add this line

And finally pass this data to the vmstat module: After the line
	unix_ifstat_report(hostname, clienttype, os, hinfo, fromline,
timestr, ifstatstr);
add this line:
	unix_vmstat_report(hostname, clienttype, os, hinfo, fromline,
timestr, vmstatstr);
I will give this a shot and let you know how it goes.  Thanks for the
HOWTO
for changing the code -- I would have been lost.
Regards,
Henrik

list Henrik Størner · Thu, 24 Aug 2006 23:54:59 +0200 ·
quoted from Adam Scheblein
On Thu, Aug 24, 2006 at 10:53:18AM -0500, Scheblein, Adam wrote:
OK, so I put in the extra code and everything compiled without any issue, I
recompiled both the server and the client with the new code and now vmstat
data is being transmitted and the server is trying to graph the data,
however, it keeps giving me a blank graph and displays nan for the values of
the datapoints on the graph.  Am I missing something??  
Maybe, or I missed something when I wrote up that cookbook for you.
You did restart Hobbit after installing the new hobbitd_rrd and
hobbitd_client modules, I suppose?

It would probably help to get some debugging output from the 
hobbitd_rrd module. Do a "kill -USR2 <hobbitd_rrd PID>" and it will
start logging debugging output to the logfile. The next time your
Mac OS X client sends it's data, you should hopefully get some
info about what it tries to do. Repeat the kill-command to turn off
debugging.

(If you don't get anything in the hobbitd_rrd logfile, it's because the
client module doesnt send anything. So it fails to pickup the fact that
Mac OS X does have vmstat data now).
Will it not graph if the values do not add up exactly to 100%??
It will, it doesn't know anything about these numbers adding up to 100.


Regards,
Henrik
list Adam Scheblein · Fri, 25 Aug 2006 09:05:28 -0500 ·
quoted from Henrik Størner
On Thu, Aug 24, 2006 at 10:53:18AM -0500, Scheblein, Adam wrote:
OK, so I put in the extra code and everything compiled without any
issue, I
recompiled both the server and the client with the new code and now
vmstat
data is being transmitted and the server is trying to graph the data,
however, it keeps giving me a blank graph and displays nan for the
values of
the datapoints on the graph.  Am I missing something??
Maybe, or I missed something when I wrote up that cookbook for you.
You did restart Hobbit after installing the new hobbitd_rrd and
hobbitd_client modules, I suppose?
Yes, I did restart everything multiple times
quoted from Henrik Størner
It would probably help to get some debugging output from the
hobbitd_rrd module. Do a "kill -USR2 <hobbitd_rrd PID>" and it will
start logging debugging output to the logfile. The next time your
Mac OS X client sends it's data, you should hopefully get some
info about what it tries to do. Repeat the kill-command to turn off
debugging.
I have run that now, The strange thing is that I have 2 hobbitd_rrd
processes...  I have run the kill -USR2 on both of the PID's  I will post
the data once I get it
quoted from Henrik Størner
(If you don't get anything in the hobbitd_rrd logfile, it's because the
client module doesnt send anything. So it fails to pickup the fact that
Mac OS X does have vmstat data now).
Will it not graph if the values do not add up exactly to 100%??
It will, it doesn't know anything about these numbers adding up to 100.
Great (I had to do some fuzzy math where it won't always add up to 100%
because rather than rounding I had to just drop the decimal (for now)

Thanks,

Adam
list Adam Scheblein · Fri, 25 Aug 2006 09:54:36 -0500 ·
quoted from Adam Scheblein
It would probably help to get some debugging output from the
hobbitd_rrd module. Do a "kill -USR2 <hobbitd_rrd PID>" and it will
start logging debugging output to the logfile. The next time your
Mac OS X client sends it's data, you should hopefully get some
info about what it tries to do. Repeat the kill-command to turn off
debugging.
I have run that now, The strange thing is that I have 2 hobbitd_rrd
processes...  I have run the kill -USR2 on both of the PID's  I will post
the data once I get it
The error that is coming up is in rrd-status.log and it is 

[date] [time] Host '[hostname]' reports vmstat for an unknown OS

Using UNAME I get the following information:
Uname -a
Darwin [hostname] 8.3.0 Darwin Kernel Version 8.3.0: Mon Oct 3 20:04:04 PDT
2005; root:xnu-792.6.22.obj~2/RELEASE_PPC Power Macintosh powerpc


 Thanks,
 
 Adam
list Adam Scheblein · Mon, 28 Aug 2006 10:22:30 -0500 ·
OK, I found my problem -- I fat fingered part of the C code, once I got that
fixed, everything works without a problem.

Thanks again Henrik!!
quoted from Adam Scheblein

Adam
-----Original Message-----
From: Scheblein, Adam [mailto:user-de8d51f0c651@xymon.invalid]
Sent: Friday, August 25, 2006 9:55 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] vmstat/cpu graphs for OS X
It would probably help to get some debugging output from the
hobbitd_rrd module. Do a "kill -USR2 <hobbitd_rrd PID>" and it will
start logging debugging output to the logfile. The next time your
Mac OS X client sends it's data, you should hopefully get some
info about what it tries to do. Repeat the kill-command to turn off
debugging.
I have run that now, The strange thing is that I have 2 hobbitd_rrd
processes...  I have run the kill -USR2 on both of the PID's  I will
post
the data once I get it
The error that is coming up is in rrd-status.log and it is

[date] [time] Host '[hostname]' reports vmstat for an unknown OS

Using UNAME I get the following information:
Uname -a
Darwin [hostname] 8.3.0 Darwin Kernel Version 8.3.0: Mon Oct 3 20:04:04
PDT
2005; root:xnu-792.6.22.obj~2/RELEASE_PPC Power Macintosh powerpc


 Thanks,

 Adam