diff options
author | Tar Committer <tar@ocjtech.us> | 2001-04-09 07:32:33 +0000 |
---|---|---|
committer | Tar Committer <tar@ocjtech.us> | 2001-04-09 07:32:33 +0000 |
commit | 0e84b727786a16ade28bb081742e5c39c33ed7fa (patch) | |
tree | 12ee1a75666c0af32ecc7fbdc05c3a5833fb6fb8 /util | |
parent | b88919bea4b222a616adbdd2b82fc262a14afc8d (diff) | |
download | rancid-0e84b727786a16ade28bb081742e5c39c33ed7fa.tar.gz rancid-0e84b727786a16ade28bb081742e5c39c33ed7fa.tar.xz rancid-0e84b727786a16ade28bb081742e5c39c33ed7fa.zip |
Imported from rancid-2.2b.tar.gz.rancid-2.2b
Diffstat (limited to 'util')
-rw-r--r-- | util/README | 1 | ||||
-rwxr-xr-x | util/configure | 4 | ||||
-rw-r--r-- | util/configure.in | 3 | ||||
-rwxr-xr-x | util/downreport.in | 59 | ||||
-rwxr-xr-x | util/rtrfilter.in | 2 |
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) |