[mrtg] Re: The html time.
Alex van den Bogaerdt
alex at slot.hollandcasino.nl
Fri Oct 13 15:49:32 MEST 2000
benny.he at alcatel.com.cn wrote:
> In my linux server, the html page the mrtg generated has some time
> error.
>
> For instance,
> the html show "The statistics were last updated Saturday, 14 October
> 2000 at 1:00",
>
> But on server, The system time is:
> [mrtg at monsvr bin]$ date
> Sat Oct 14 01:00:47 CST 2000
This indicates that MRTG is not in error. It is showing you the same
time as the server has. Therefore, there's nothing wrong with MRTG.
> And The hardware time is:
> [mrtg at monsvr bin]$ /sbin/clock
> Fri Oct 13 17:05:30 2000 -0.295477 seconds
>
> The real time is 17:05, same as the hardware time.
Now, *this* is an error. First of all, the time is not synchronized.
Not only the hours are wrong, the minutes are also wrong.
You need to understand timezones and the difference between local time
vs. system time. If you run "date", this program will show you a time
that is known as "wall clock" time. The server itself runs in "universal
coordinated time" aka UTC and GMT. Try this:
TZ="" date;date
It should show you the time and date like this:
Fri Oct 13 13:35:54 2000
Fri Oct 13 15:35:54 MET DST 2000
The first time and date are in UTC. The second time and date are the
local time. In your case it will probably show the "correct" time
followed by the "wrong" time.
Then there is the hardware clock built into your computer. It is only
used when booting up the system. This is what you are showing with the
clock command. In your case, the HWclock is running in local time.
This is not necessarily an error but I assume that your linux system
thinks that the HWclock runs UTC time.
Read the manual page for clock or hwclock ("man clock" or "man hwclock")
and make sure you understand it. Then set the hardware clock, read the
current time from that hardware clock into the system time.
You will notice that the MRTG system has problems with this. There
is no way around it, you are messing with the time and this will be
noticed by MRTG. Wait patiently, the error will go away after eight
hours.
If you still have questions on this subject, you should ask them in a
linux-specific group, not the MRTG list.
regards,
--
__________________________________________________________________
/ 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:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://www.ee.ethz.ch/~slist/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the mrtg
mailing list