boukeversteegh / pptpd-monitor

Tool for monitoring PPTPD (VPN) connections and traffic
67 stars 28 forks source link

Previous year entries show up as current year #2

Open boukeversteegh opened 11 years ago

boukeversteegh commented 11 years ago

Logs only contain Months and Days, not years. Right now, pptpd-monitor assumes all entries are from this year, which leads to incorrect last-seen date.

A possible solution is to look at the creation/modifcation dates of the logfiles, but this is not watertight at all (logs do cross year boundaries).

boukeversteegh commented 11 years ago

Dates increase monotonically. When dates jump back, a year should be added. logfiles' mtime could be used for anchoring. If the month+date for first entry in the log is before its reported mtime, it must be assumed that there weren't any log entries in the year of its creation, so a year should be added directly. This is a plausible scenario if the logfile was created near the end of a year.

I will implement this algorithm soon.