[rrd-users] VRULEs marking midnight(s) (was "Re: vertical lines")

Dave Plonka plonka at doit.wisc.edu
Tue Jul 18 17:54:16 MEST 2000


On Mon, Jul 17, 2000 at 02:20:12PM +0200, Hahn, Michael {GY-O~Mannheim} wrote:
> 
> does any1 know how to draw vertical lines every 00:00 on every day in a rrdtool graph?

You just need to use VRULE as described in the rrdgraph man page.

> what i want to do:
> having a x-grid with a label every 2h and a red vertical line on the day-change (00:00).

E.g. 'VRULE:963810000#FF0000:Hey, it's midnight at UTC-0500!'

Since I thought this was an interesting question I hacked up the
attached script called "midnights", to generate the VRULE statements
for a date range of your choosing.

The script tries to handle daylight-savings time, leap years and such
appropriately.

E.g. (this is being run in CST6CDT, currently UTC-0500):

   $ midnights -v 1999/02/28 1999/03/01
   'VRULE:920181600#FF0000' # Sun Feb 28 00:00:00 1999
   'VRULE:920268000#FF0000' # Mon Mar  1 00:00:00 1999
   $ midnights -v 2000/02/28 2000/03/01
   'VRULE:951717600#FF0000' # Mon Feb 28 00:00:00 2000
   'VRULE:951804000#FF0000' # Tue Feb 29 00:00:00 2000
   'VRULE:951890400#FF0000' # Wed Mar  1 00:00:00 2000

Note that, rather than running the calculations in this script once for
each invocation of "rrdtool graph" (such as every 5 minutes), you
should probably use it to "precalculate" all the midnight values once a
day, for perhaps the past year, then pass all the resulting VRULE
arguments to all graph commands.

Dave

-- 
plonka at doit.wisc.edu  http://net.doit.wisc.edu/~plonka  ARS:N9HZF  Madison, WI


-- Attached file removed by Listar and put at URL below --
-- Type: text/plain
-- Size: 1k (1718 bytes)
-- URL : http://www.ee.ethz.ch/~slist/pantomime/midnights


--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list