[rrd-users] Re: --set-tz patch for rrdtool graph
Tobias Oetiker
oetiker at ee.ethz.ch
Sat Mar 10 23:56:32 MET 2001
Today Jason Fesler wrote:
|
| This patch will add a new argument to the "rrdtool graph" command
| called "--set-tz". It takes one argument - one of the form
| PST8PDT or GMT, etc. See "man environ" for how the TZ environment
| variable works.
|
| This patch was created, since setting $ENV{"TZ"} in perl and then
| using RRDs.pm was not adequate to affect rrdtool's sense of local time.
can you elaborate on why it should make a differenze if you set the
TZ environemnt variable in perl or in a shared library loaded into
perl ...
confused
tobi
|
| Blame can be sent to jfesler at gigo.com ..
|
|
| *** rrdtool-1.0.28/src/rrd_graph.c Wed Sep 13 23:04:00 2000
| --- rrdtool-1.0.28jf/src/rrd_graph.c Sat Mar 10 10:31:14 2001
| ***************
| *** 2646,2651 ****
| --- 2646,2658 ----
| return inp;
| }
|
| + void set_time_zone(char *s) {
| + char buf[256];
| + sprintf(buf,"TZ=%s",s);
| + putenv(buf);
| + }
| +
| +
| int
| rrd_graph(int argc, char **argv, char ***prdata, int *xsize, int *ysize)
| {
| ***************
| *** 2717,2722 ****
| --- 2724,2730 ----
| {"alt-y-grid", no_argument, 0, 257 },
| {"alt-autoscale", no_argument, 0, 258 },
| {"alt-autoscale-max", no_argument, 0, 259 },
| + {"set-tz", required_argument, 0, 260 },
| {0,0,0,0}};
| int option_index = 0;
| int opt;
| ***************
| *** 2730,2735 ****
| --- 2738,2747 ----
| break;
|
| switch(opt) {
| + case 260:
| + /* "tz" */
| + set_time_zone(optarg);
| + break;
| case 257:
| im.extra_flags |= ALTYGRID;
| break;
|
|
--
______ __ _
/_ __/_ / / (_) Oetiker, Timelord & SysMgr @ EE-Dept ETH-Zurich
/ // _ \/ _ \/ / TEL: +41(0)1-6325286 FAX:...1517 ICQ: 10419518
/_/ \.__/_.__/_/ oetiker at ee.ethz.ch http://ee-staff.ethz.ch/~oetiker
--
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