[rrd-users] Re: Time in Graphs and Last update not working right.

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Sat Nov 3 11:52:10 MET 2001


Massimiliano Balsamo wrote:

> Hi to all,
> one month ago I installed MRTG to monitor routers, squid proxy,
> roundtrip time to.., it was great . I decided to move to rrd and I tried
> 14all and now the generic.cgi from Steve Shipway, ok they do what I want
> 
> exept both show
> 
> Last update: Fri Nov 2 16:30:29 2001
> 
> while in my host's  date is:
> 
> Fri Nov  2 21:32:20 GMT 2001
>
> time and date before moving to rrdtool were right.

Were they?  You say the time is set to GMT but you are located
in Italy?  While this is not a problem per se it does make me
feel that it isn't correct.

First things first.  The time on your computer as shown with the
command "date" is in local time.  If you use the '-u' switch to
this command it will show UTC time.  As daylight saving doesn't
apply anymore in Europe, your local time should be one hour ahead
of UTC.  You should get similar results from the next command:

[userprompt]$ date;date -u
Sat Nov  3 11:35:42 CET 2001
Sat Nov  3 10:35:42 UTC 2001

If you're not located in Italy you may need to apply another time
offset to this example but the basic principles stay:  Wall clock
time (as shown in the first line) and internal time (last line)
usually differ (except for British people without suffering from
daylight saving).

Every computer on the world that uses this mechanism (unix computers,
maybe others to) should show the same internal time.

If you change the time zone (for instance, you're logging in from
australia and would like to see times in your local time), the
internal time doesn't change while the wall clock time does.

Most likely a similar thing happens to you.  The cgi program is
started with a different (and wrong for your location) time zone.
When you want to change that I guess (I don't know the program)
that you can use the environment provided by apache.  If that
environment doesn't contain the time zone settings (or wrong
time zone settings) you'd expect to see the problems you see.

Try the following small cgi program, place it in your servers
cgi-bin directory, mode 755.

   #!/bin/bash
   echo 'Content-type: text/plain'
   echo
   date
   date -u

Start it from the command line and from a browser.  If it gives
the same results then my assumptions above were wrong.

Don't forget to remove the test program after using it!

cheers,
-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+
| Technical questions sent directly to me will be nuked. Use the list. | 
+----------------------------------------------------------------------+
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |
+----------------------------------------------------------------------+

--
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