[rrd-users] time as a counter?
linux at thehobsons.co.uk
Mon Apr 30 21:44:00 CEST 2007
Grant Kelly wrote:
>There are a bunch of weather stations I would like to watch and
>record the last time their data is updated. I have a python script
>which looks at the data and determines the time of the most recent
>data. This time is typically 10-30 minutes behind the actual time. I
>run the script every 10 minutes to update a web page that displays
>the time of the most recent data for each station.
>What I would like to do is add to this script a call to
>rrdtool.update() which will send a unix timestamp to be saved in
>Is this the correct way to create the rrd?
I would suggest that if all you want is "last time we got data" then
rrdtools are not the best way to do it
The goal is to make graphs that show when the stations stopped
updating at expected times, i.e. there would be a flat line since the
'updated' time didn't increase from PDP to PDP. Eventually, I want to
color the area under the line according to some threshold, such as
"red if the station hasn't updated for 6 hours."
If you are plotting something that comes out of the weather stations
(for example temperature) and only update an rrd database when you
have data, then you will naturally get a gap in the graph.
If you did plot time, then you would also find yourself with a gap
(whether you plotted 'time' as an increasing number, or 'rate of
change of time' as a straight horizontal line).
In both cases, this is because when you miss data, the rrd will end
up containing NAN (Not A Number) and the graphing will (by default)
not draw a line at all.
More information about the rrd-users