add monitoring script to check errors in logs
When a backup i made without error the output logged is like the following :
using parent snapshot 096ed3f4
scan [/]
[0:20] 32117 directories, 186610 files, 5.074 GiB
scanned 32117 directories, 186610 files in 0:20
[1:00] 100.00% 0B/s 5.074 GiB / 5.074 GiB 218726 / 218727 items 0 errors ETA 0:00
duration: 1:00, 85.62MiB/s
snapshot 5125bb88 saved
The idea is to simple grep the pattern '\s0\serrors\s' and being compliant with nagios like tools :
- if the log file exists and pattern is present in the file, returns 0
- if the log file exists and pattern is not present in the file, return 2
- if the log file does not exists, is not readable, does not contains word
snapshot
, return 3
Edited by Fabien Combernous