rrdlast - Return the date of the last data sample in an RRD
rrdtool last filename [--daemon address]
The last function returns the UNIX timestamp of the most recent update of the RRD.
The name of the RRD that contains the data.
Address of the rrdcached daemon. If specified, a flush
command is sent to the server before reading the RRD files. This allows rrdtool to return fresh data even if the daemon is configured to cache values for a long time. For a list of accepted formats, see the -l option in the rrdcached manual.
rrdtool last --daemon unix:/var/run/rrdcached.sock /var/lib/rrd/foo.rrd
If the rrdcached daemon is being used, then omit the flush normally send before returning the last update. If you add this option, you get the last time the file on disk was updated; if you have relatively low cache times and are calling this frequently it will preserve the caching benefit
The following environment variables may be used to change the behavior of rrdtool last
:
If this environment variable is set it will have the same effect as specifying the --daemon
option on the command line. If both are present, the command line argument takes precedence.
Russ Wright <rwwright@home.com> Daemon support added by Steve Shipway <steve@steveshipway.org>