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