Skip to content

Match: timediff

Plugin name match_timediff
Status supported
Since 4.6
Copyright 2008–2009 Florian octo Forster
License GPLv2
Configuration collectd.conf(5)

Description

The TimeDiff match compares the time of values against the time it considers to be “now” and matches those values where the times differ more than a given threshold. It is intended to be used on server instances to filter out values from machines with a wrong time setting. Since the timestamp in RRD files must be ever increasing, inserting only one value with a timestamp far in the future causes big problems. The purpose of this match is to prevent exactly this problem.

Synopsis

 LoadPlugin "timediff"
 <Chain "PreCache">
   <Rule "check_time">
     <Match "timediff">
       Future  300
       Past   3600
     </Match>
     Target "stop"
   </Rule>
   Target "continue"
 </Chain>

Dependencies

  • none

History

The TimeDiff match has been available since version-4.6.

Configuration

Configuration options · from collectd.conf(5)

See this section in the full configuration reference

Matches values that have a time which differs from the time on the server.

This match is mainly intended for servers that receive values over the network plugin and write them to disk using the rrdtool plugin. RRDtool is very sensitive to the timestamp used when updating the RRD files. In particular, the time must be ever increasing. If a misbehaving client sends one packet with a timestamp far in the future, all further packets with a correct time will be ignored because of that one packet. What's worse, such corrupted RRD files are hard to fix.

This match lets one match all values outside a specified time range (relative to the server's time), so you can use the stop target (see below) to ignore the value, for example.

Available options:

Future Seconds
Matches all values that are ahead of the server's time by Seconds or more seconds. Set to zero for no limit. Either Future or Past must be non-zero.
Past Seconds
Matches all values that are behind of the server's time by Seconds or more seconds. Set to zero for no limit. Either Future or Past must be non-zero.

Example:

<Match "timediff">
  Future  300
  Past   3600
</Match>

This example matches all values that are five minutes or more ahead of the server or one hour (or more) lagging behind.