From 74e058c8a010ef6feb539248a550d0bb169c1e94 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 27 Dec 2010 00:04:44 +0000 Subject: import torrus 1.0.9 --- torrus/scripts/rrdup_notify.sh | 42 ++++++++++++++++ torrus/scripts/xml/extract-skeleton.xsl | 87 +++++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 torrus/scripts/rrdup_notify.sh create mode 100644 torrus/scripts/xml/extract-skeleton.xsl (limited to 'torrus/scripts') diff --git a/torrus/scripts/rrdup_notify.sh b/torrus/scripts/rrdup_notify.sh new file mode 100644 index 000000000..baa8f450d --- /dev/null +++ b/torrus/scripts/rrdup_notify.sh @@ -0,0 +1,42 @@ +#!/bin/sh +# +# Periodically check if there are RRD files not updated by collector, +# and email the warning message. +# *.old.rrd files are ignored + +# $Id: rrdup_notify.sh,v 1.1 2010-12-27 00:04:04 ivan Exp $ +# Stanislav Sinyagin +# + +# Where the RRD files are located. Separate multiple paths with space +RRDSTORAGE=/srv/torrus/collector_rrd + +# Maximum allowed age of an RRD file, in minutes. +MAXAGE=60 + +# Where to send complaints +NOTIFY=root + +TMPFILE=/tmp/rrdup_notify.$$ + +cp /dev/null ${TMPFILE} + +for d in ${RRDSTORAGE}; do + find ${d} -name '*.rrd' ! -name '*.old.rrd' \ + -mmin +${MAXAGE} -print >>${TMPFILE} +done + +nLines=`wc -l ${TMPFILE} | awk '{print $1}'` + +if test ${nLines} -gt 0; then + cat ${TMPFILE} | \ + mail -s "`printf \"Warning: %d aged RRD files\" ${nLines}`" ${NOTIFY} +fi + +rm ${TMPFILE} + +# Local Variables: +# mode: shell-script +# indent-tabs-mode: nil +# perl-indent-level: 4 +# End: diff --git a/torrus/scripts/xml/extract-skeleton.xsl b/torrus/scripts/xml/extract-skeleton.xsl new file mode 100644 index 000000000..863cbbdfd --- /dev/null +++ b/torrus/scripts/xml/extract-skeleton.xsl @@ -0,0 +1,87 @@ + + + + + + + + + + + + This file is a result of extract-skeleton.xsl template + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.1