Xymon Mailing List Archive search

How does linecount work?

4 messages in this thread

list Greg L Hubbard · Thu, 24 Aug 2006 15:41:17 -0500 ·
Shirefolk:

I am playing with the nifty new 4.2 features, and was trying to get the
"linecount" function to work.  I *thought* I could maybe use this to
track the number of entries in a file, and perhaps graph over time, but
I am starting to suspect that Henrik meant linecount for something else.

I see where you configure client-local.cfg with:

	linecount:<filename>
	<handle>:<regex>

This should alert the Hobbit agent to start grepping <filename> for
<regex> and somehow bind the count to <handle>?

Then what?  Do you configure something in hobbit-clients.cfg to match
this?

I tried:

	LOG <filename> .* COLOR=GREEN

To see what would happen, but nothing did...

GLH
list Henrik Størner · Thu, 24 Aug 2006 23:48:08 +0200 ·
quoted from Greg L Hubbard
On Thu, Aug 24, 2006 at 03:41:17PM -0500, Hubbard, Greg L wrote:
I am playing with the nifty new 4.2 features, and was trying to get the
"linecount" function to work.  I *thought* I could maybe use this to
track the number of entries in a file, and perhaps graph over time, but
I am starting to suspect that Henrik meant linecount for something else.
No, the general idea was that linecount was a way of doing
    grep blabla myfile | wc -l
and get this into a graph.
quoted from Greg L Hubbard
I see where you configure client-local.cfg with:

	linecount:<filename>
	<handle>:<regex>

This should alert the Hobbit agent to start grepping <filename> for
<regex> and somehow bind the count to <handle>?
Yes. What it ends up doing is putting a section into the client message.
In my test configuration I have this in the client-local.cfg file

   linecount:/var/log/messages
   kbd atkbd.c
   timechg system.time.change

(you can use space to delimit the <handle> from the <regex>, or colon)
which gives me this in the client data:

   [linecount:/var/log/messages]
   kbd: 0
   timechg: 16
Then what?  Do you configure something in hobbit-clients.cfg to match
this?
No, it should actually happen by itself. It generates an RRD file for
each of the linecount "<handle>" values. So in my example, I'll get
these two RRD files:
   lines.,var,log,messages#kbd.rrd
and
   lines.,var,log,messages#timechg.rrd

and if you have the 4.2 default settings for TEST2RRD and GRAPHS, then
this should result in a graph of the linecounts on your "trends" page
for the host.


Regards,
Henrik
list Greg L Hubbard · Thu, 24 Aug 2006 17:03:17 -0500 ·
Those were some good hints!

A) the graphs are there in the trends page -- I just didn't know to go
look there.

B) I am specifying the regex all wrong.

C) Now I know where to look to verify my configuration

GLH 

PS -- I've noticed a number of blemishes in the man pages, etc. -- how
would you like us to suggest corrections, or is there some way we can
help share the load?
quoted from Henrik Størner

-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid] 
Sent: Thursday, August 24, 2006 4:48 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] How does linecount work?

On Thu, Aug 24, 2006 at 03:41:17PM -0500, Hubbard, Greg L wrote:
I am playing with the nifty new 4.2 features, and was trying to get 
the "linecount" function to work.  I *thought* I could maybe use this 
to track the number of entries in a file, and perhaps graph over time,
but I am starting to suspect that Henrik meant linecount for something
else.
No, the general idea was that linecount was a way of doing
    grep blabla myfile | wc -l
and get this into a graph.
I see where you configure client-local.cfg with:

	linecount:<filename>
	<handle>:<regex>

This should alert the Hobbit agent to start grepping <filename> for 
<regex> and somehow bind the count to <handle>?
Yes. What it ends up doing is putting a section into the client message.
In my test configuration I have this in the client-local.cfg file

   linecount:/var/log/messages
   kbd atkbd.c
   timechg system.time.change

(you can use space to delimit the <handle> from the <regex>, or colon)
which gives me this in the client data:

   [linecount:/var/log/messages]
   kbd: 0
   timechg: 16
Then what?  Do you configure something in hobbit-clients.cfg to match 
this?
No, it should actually happen by itself. It generates an RRD file for
each of the linecount "<handle>" values. So in my example, I'll get
these two RRD files:
   lines.,var,log,messages#kbd.rrd
and
   lines.,var,log,messages#timechg.rrd

and if you have the 4.2 default settings for TEST2RRD and GRAPHS, then
this should result in a graph of the linecounts on your "trends" page
for the host.


Regards,
Henrik
list Henrik Størner · Fri, 25 Aug 2006 07:30:58 +0200 ·
quoted from Greg L Hubbard
On Thu, Aug 24, 2006 at 05:03:17PM -0500, Hubbard, Greg L wrote:
PS -- I've noticed a number of blemishes in the man pages, etc. -- how
would you like us to suggest corrections, or is there some way we can
help share the load?
If you haven't tried editing man-pages before, they are really just text
files with some special markup commands in them. So if you can edit the
original file and just correct the text, that will be fine. BTW, if you
edited the hobbitd/hobbitd.8 man-page, then you can test the edits with

    nroff -man hobbitd/hobbitd.8 | more

to see what it would look like.

By far the easiest for me is if you can create a "diff" file between 
the original and the corrected man-page. And if you can do it in the 
"unified" diff format supported by the GNU diff utility, then it's
perfect. Just save the original file before you edit it, then when
you're done editing run

   diff -u originalfile newfile

and send me the output. I've looked through so many diff's that my
brain can see right away what you're changing with the diff, and
that makes it very easy to proof-read before committing your changes.


Regards,
Henrik