[hobbit] Setting client "class" for log file monitoring
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?
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
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.
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
-----Original Message----- From: Henrik Stoerner [mailto:henrik at hswn.dk] Sent: Wednesday, August 23, 2006 3:57 PM To: hobbit at hswn.dk 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
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
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
-----Original Message----- From: Scheblein, Adam [mailto:adam.scheblein at marquette.edu] Sent: Thursday, August 24, 2006 8:48 AM To: hobbit at hswn.dk Subject: RE: [hobbit] vmstat/cpu graphs for OS X
-----Original Message----- From: Henrik Stoerner [mailto:henrik at hswn.dk] Sent: Wednesday, August 23, 2006 3:57 PM To: hobbit at hswn.dk 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
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
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
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
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
(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
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
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!!
Adam
-----Original Message----- From: Scheblein, Adam [mailto:adam.scheblein at marquette.edu] Sent: Friday, August 25, 2006 9:55 AM To: hobbit at hswn.dk 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
On 8/23/06, Gary B. <gmbfly98 at gmail.com> 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 ]==--
On Wed, Aug 23, 2006 at 01:05:25PM -0700, Bob Gordon wrote:
On 8/23/06, Gary B. <gmbfly98 at gmail.com> 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
participants (4)
-
adam.scheblein@marquette.edu
-
gmbfly98@gmail.com
-
henrik@hswn.dk
-
rgordonjr@gmail.com