Mike
Mike

Reputation: 975

RRD print the timestamp of the last valid data

I have a rdd database storing ping response from a wide range of network equipments
How can i print on the graph the timestamp of the last valid entry in the rrd database, so i can see if a host is down when did it went down

I use the folowing to creade the RRD file.

rrdtool create terminal_1.rrd -s 60 \
DS:ping:GAUGE:120:0:65535 \
RRA:AVERAGE:0.5:1:2880

Upvotes: 1

Views: 1458

Answers (1)

Steve Schnepp
Steve Schnepp

Reputation: 4680

Use the lastupdate option of rrdtool.

Another solution exists if you only have one file per host : don't update your RRD if the host is down. You can then see the last updated time with a plain ls or stat as in :

ls -l terminal_1.rrd 
stat --format %Y terminal_1.rrd 

In case you plan to use the caching daemon of RRD, you have to use the last command in order to flush the pending updates.

rrdtool last terminal_1.rrd 

Upvotes: 1

Related Questions