BB Unix Network Monitor - Message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: {bb} Extract information from LaRRD



On Fri, 2006-10-20 at 14:08, Mick Ohrberg wrote:
> Hello, brothers and sisters.
> 
> I am, in the name of appeasing upper mgmt and their hunger for "purdy
> pitchers", extracting information about filesystems (for trending)
> using a conglomerate of sh/ksh scripting and PHP with a PDFifier. It
> works well functionally, but I'm realizing that my method of
> extracting data is flawed.
> 
> Instead of going into a long explanation on how I'm currently doing it
> (which I KNOW is FAR from efficent, but mgmt said "now", so what do
> you do?), I'll put it this way:
> 
> Currently, if you use a URL similar to this:
> 
> http://<bbserver>/cgi-bin/larrd-grapher.cgi?host=<hostname>&service=disk&
> disk_part=6..11
> 
> you get 6 file systems listed. If I want ONE single filesystem, I do
> the following:
> 
> http://<bbserver>/cgi-bin/larrd-grapher.cgi?host=<hostname>&service=disk&
> disk_part=6..6
> 
> However - how do I reliably (and in a script) link that '6' graph back
> to a real filesystem? If I look in ${BBHOME}/bbvar/rrd, I can see that
> (again, in this particular case), the 6th <hostname>.disk* file
> corresponds to the correct picture (the filename and the image agrees
> on filesystem name), but that doesn't always seem to be the case. Is
> there a more reliable way of linking that number to a file system
> name?

I think that the order, as presented in the Larrd graphs, is just
"dictionary sort" order. The fly in the ointment is that the root
filesystem is actually in a file like host.name.net.disk,root.rrd
so it appears out of place.

However, it would probably (eventually) be simpler to go straight
to the "rrd" files and use rrdtool to create the graphs that you
need. On the command line, it would look something like this:

  rrdtool graph /tmp/testimg.png --end now --start end-48h --title
  "host.name.net Disk Utilization - Percent Used Last 48 Hours"
  --width 576 -v "% Full" -u 100 -a PNG DEF:ds0=/usr/local/bb/bbvar/
  rrd/host.name.net.disk,usr.rrd:pct:AVERAGE LINE2:ds0#0000FF:/usr
  COMMENT: GPRINT:ds0:"LAST:            \: %5.1lf (cur)"
  GPRINT:ds0:"MAX: \: %5.1lf (max)" GPRINT:ds0:"MIN: \: %5.1lf (min)"
  GPRINT:ds0:"AVERAGE: \: %5.1lf (avg)\n" COMMENT:"Fri Oct 20 19-14-32
  2006"

Note that this needs to be all on one line.

If you know Perl, you could even use the RRDs Perl module then cut
and paste the relevant sections out of the larrd-grapher.cgi script.

Cheers, Phil.



-- 
Failure is not an option.  It comes bundled with your Microsoft
product. (Ferenc Mantfeld)

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
subscribe bb-digest in the BODY of the message.


Home | Main Index | Thread Index