3 # Periodically check if there are RRD files not updated by collector,
4 # and email the warning message.
5 # *.old.rrd files are ignored
7 # $Id: rrdup_notify.sh,v 1.1 2010-12-27 00:04:04 ivan Exp $
8 # Stanislav Sinyagin <ssinyagin@yahoo.com>
11 # Where the RRD files are located. Separate multiple paths with space
12 RRDSTORAGE=/srv/torrus/collector_rrd
14 # Maximum allowed age of an RRD file, in minutes.
17 # Where to send complaints
20 TMPFILE=/tmp/rrdup_notify.$$
22 cp /dev/null ${TMPFILE}
24 for d in ${RRDSTORAGE}; do
25 find ${d} -name '*.rrd' ! -name '*.old.rrd' \
26 -mmin +${MAXAGE} -print >>${TMPFILE}
29 nLines=`wc -l ${TMPFILE} | awk '{print $1}'`
31 if test ${nLines} -gt 0; then
33 mail -s "`printf \"Warning: %d aged RRD files\" ${nLines}`" ${NOTIFY}
40 # indent-tabs-mode: nil
41 # perl-indent-level: 4