summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/README1
-rwxr-xr-xutil/configure4
-rw-r--r--util/configure.in3
-rwxr-xr-xutil/downreport.in59
-rwxr-xr-xutil/rtrfilter.in2
5 files changed, 68 insertions, 1 deletions
diff --git a/util/README b/util/README
index cecb9df..1a579d6 100644
--- a/util/README
+++ b/util/README
@@ -5,3 +5,4 @@ sources included for convenience.
README This file.
lg looking glass pkg
rtrfilter mail filter for diffs
+downreport Daily report of routers not listed as up in router.db
diff --git a/util/configure b/util/configure
index 8d59fa6..fb8e766 100755
--- a/util/configure
+++ b/util/configure
@@ -620,6 +620,9 @@ PERLV_PATH=$ac_cv_path_PERLV_PATH
EXPECT_PATH=$ac_cv_path_EXPECT_PATH
+MAILPLUS=$rd_cv_MAILPLUS
+
+
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@@ -772,6 +775,7 @@ s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@RD_UTIL_PROGS@%$RD_UTIL_PROGS%g
s%@PERLV_PATH@%$PERLV_PATH%g
s%@EXPECT_PATH@%$EXPECT_PATH%g
+s%@MAILPLUS@%$MAILPLUS%g
CEOF
EOF
diff --git a/util/configure.in b/util/configure.in
index 17f7b4e..c23c556 100644
--- a/util/configure.in
+++ b/util/configure.in
@@ -17,6 +17,9 @@ AC_SUBST(PERLV_PATH)
EXPECT_PATH=$ac_cv_path_EXPECT_PATH
AC_SUBST(EXPECT_PATH)
+MAILPLUS=$rd_cv_MAILPLUS
+AC_SUBST(MAILPLUS)
+
AC_OUTPUT(Makefile $RD_UTIL_PROGS)
# fix permissions on scripts.
diff --git a/util/downreport.in b/util/downreport.in
new file mode 100755
index 0000000..2926c5c
--- /dev/null
+++ b/util/downreport.in
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# Reports the list of routers not listed as 'up'.
+
+# Put this in your crontab to run once a day:
+# 0 0 * * * /where/rancid/lives/util/downreport
+
+# It can optionally
+# take a space list of groups on the command line
+# It will use the list of groups defined in env otherwise.
+
+
+ENVFILE="`dirname $0`../bin/env"
+
+. $ENVFILE
+
+if [ $# -ge 1 ] ; then
+ LIST_OF_GROUPS="$*"
+elif [ "$LIST_OF_GROUPS" = "" ] ; then
+ echo "LIST_OF_GROUPS is empty in $ENVFILE"
+ exit 1
+fi
+
+
+for GROUP in $LIST_OF_GROUPS; do
+ (
+ DIR=$BASEDIR/$GROUP
+ if [ -s $DIR/routers.down ]; then
+ (
+
+ cat << EOM
+
+ The following $GROUP routers are listed as other than up.
+
+ Routers listed as "up" in rancid's router.db are polled several
+times daily. This list is of routers that are not listed as up and therefore
+not polled.
+
+EOM
+
+ cat $DIR/routers.down;
+
+ )
+
+ else
+ (
+
+ cat << EOM
+
+ No routers are down/ticketed for router group $GROUP (yay).
+
+EOM
+
+ )
+ fi
+ ) |\
+ Mail -s "Down router report - $GROUP" @MAILPLUS@admin-$GROUP
+
+done
diff --git a/util/rtrfilter.in b/util/rtrfilter.in
index d1fa45f..8826047 100755
--- a/util/rtrfilter.in
+++ b/util/rtrfilter.in
@@ -133,7 +133,7 @@ sub filter {
sub usage {
print STDERR <<USAGE;
-usage: $me [-h] [-i <perl regex>] [-x <perl regex>] [-f <regex file>] [-u <From: address> [-s <subject>] <mail rcpt> [<rcpt> ...]
+usage: $me [-h] [-i <perl regex>] [-x <perl regex>] [-f <regex file>] [-u <From: address>] [-s <subject>] <mail rcpt> [<rcpt> ...]
-h prints this message
-f file containing perl regex matching router names (mind the cwd())
-i perl regex matching router names (inclusive)