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 # Stanislav Sinyagin <ssinyagin@yahoo.com>
10 # Where the RRD files are located. Separate multiple paths with space
11 RRDSTORAGE
=/srv
/torrus
/collector_rrd
13 # Maximum allowed age of an RRD file, in minutes.
16 # Where to send complaints
19 TMPFILE
=/tmp
/rrdup_notify.$$
21 cp /dev
/null
${TMPFILE}
23 for d
in ${RRDSTORAGE}; do
24 find ${d} -name '*.rrd' ! -name '*.old.rrd' \
25 -mmin +${MAXAGE} -print >>${TMPFILE}
28 nLines
=`wc -l ${TMPFILE} | awk '{print $1}'`
30 if test ${nLines} -gt 0; then
32 mail -s "`printf \"Warning: %d aged RRD files\" ${nLines}`" ${NOTIFY}
39 # indent-tabs-mode: nil
40 # perl-indent-level: 4