Hi, John Rouillard wrote on 2009-06-09 04:49:40 +0000 [Re: [BackupPC-users] Programatically identifying errors in the log file]: > On Tue, Jun 09, 2009 at 02:21:28AM +0200, Holger Parplies wrote: > > John Rouillard wrote on 2009-06-08 21:27:11 +0000 [[BackupPC-users] > > Programatically identifying errors in the log file]: > > > > > > I am modifying a plugin for nagios to scan the backup logs and verify > > > that the backups completed successfully. [...] I need > > > to count the errors while filtering out certain known (and acceptable) > > > classes of errors. > [...] > > > Is there a better way of identifying true errors in the log files? > > > > Can't you use the error count values from the 'backups' file? > > Nope, because the error count values are counting things that are > acceptable errors in our environment: i.e. the files deleted while > backuppc is running. So I have 49 errors reported for one of the > backups. It's 49 temporary files removed from under backuppc, so the > backup really completed fine as far as we are concerned. It is missing > some files, but that is an acceptable loss. I can't just exclude the > log files as I do want as many of them as it can get, but if some get > removed while backuppc is running that is ok.
then how about counting acceptable errors in the log file and subtracting those from the error count in the 'backups' file? It should be far easier to identify acceptable errors - you are obviously doing that already, if you are distinguishing between removed log files and other removed files. Matching known error messages is unlikely to falsely match other output. Failing to match acceptable errors (changed error messages, newly appearing errors that are acceptable to you) will only point you to the fact that you need to extend your regexp - no harm done. > However if other files are getting removed while backuppc is running > then there is a problem that I have to address, Is there really? If your backup would have been taken slightly later, the files would already have been gone (i.e. also not have been backed up). True, you might have an inconsistent state if the missing files closely relate to some newly appeared or otherwise changed files, but you can't *rely* on disappearing files to notice that. You'd need to back up a snapshot to avoid it. If you already are backing up a snapshot, then disappearing files probably mean something is going seriously wrong, but that is true for log files just as much as any other files :). > so commenting out the > code that reports removed files isn't really a solution (and is also > not something that would be an upstream compatible patch AFAIAC). I agree. Also, keeping the lines in the log might be helpful when tracing down some issue, even if you don't consider them errors. Regards, Holger ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ BackupPC-users mailing list BackupPC-users@lists.sourceforge.net List: https://lists.sourceforge.net/lists/listinfo/backuppc-users Wiki: http://backuppc.wiki.sourceforge.net Project: http://backuppc.sourceforge.net/