summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTar Committer <tar@ocjtech.us>2005-08-15 00:51:41 +0000
committerTar Committer <tar@ocjtech.us>2005-08-15 00:51:41 +0000
commitc0482931956d127b5f09d4a8d72758cd4cb1f097 (patch)
treefb13010367c3c9e3e12dc698233b729d6dd669da
parent96dc4026054df77affedfe50380a661dcdba732a (diff)
downloadrancid-c0482931956d127b5f09d4a8d72758cd4cb1f097.zip
rancid-c0482931956d127b5f09d4a8d72758cd4cb1f097.tar.gz
rancid-c0482931956d127b5f09d4a8d72758cd4cb1f097.tar.xz
Imported from rancid-2.3.2a3.tar.gz.rancid-2.3.2a3
-rw-r--r--CHANGES8
-rw-r--r--FAQ46
-rw-r--r--Makefile.in2
-rw-r--r--README19
-rw-r--r--Todo1
-rw-r--r--bin/Makefile.in2
-rw-r--r--bin/cat5rancid.in35
-rw-r--r--bin/clogin.in74
-rw-r--r--bin/control_rancid.in57
-rw-r--r--bin/rancid-cvs.in37
-rw-r--r--bin/rancid.in49
-rwxr-xr-xconfigure80
-rw-r--r--configure.in29
-rw-r--r--etc/Makefile.am5
-rw-r--r--etc/Makefile.in5
-rw-r--r--etc/rancid.conf.sample.in12
-rw-r--r--include/Makefile.in2
-rw-r--r--include/version.h2
-rw-r--r--include/version.h.in2
-rw-r--r--man/Makefile.in2
-rw-r--r--man/rancid-cvs.133
-rw-r--r--man/rancid-run.115
-rw-r--r--man/rancid.conf.5.in40
-rw-r--r--man/rancid_intro.19
-rw-r--r--man/router.db.511
-rw-r--r--share/Makefile.in2
26 files changed, 468 insertions, 111 deletions
diff --git a/CHANGES b/CHANGES
index 25ad1e9..0ba1786 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,12 @@
2.3.2
+ add subversion support - mostly from Justin Grote
+
+ clogin: support rsh method - partly from James Stahr
+
+ collect show inventory raw on rancid and cat5rancid
+
+ add -ko to cvs diff commands - Michael Shields
+
Add a MAILHEADERS configuration variable for user-defined mail headers
rancid: match HSRP group numbers greater than 1 char wide - Ed Ravin
diff --git a/FAQ b/FAQ
index 2bea477..e3a4283 100644
--- a/FAQ
+++ b/FAQ
@@ -1,4 +1,4 @@
-Frequently Asked Questions about rancid - last updated 20040107.
+Frequently Asked Questions about rancid - last updated 20050813.
This FAQ contains information that may not apply directly to versions of
rancid prior to 2.3. It also contains paths containing tags such as
@@ -235,6 +235,50 @@ A. Certainly, but rancid does not provide such a mechanism natively. Two
Obviously, the first option is the cleanest and most featureful, which is
why the script mention in the second option is not provided.
+Q. For approximately X hosts (configs) what size server should we be
+ considering - speed and data storage?
+A. On modern machines it is unlikely you will have issues with disk space or
+ memory - A heavily laden access router with a complex config won't consume
+ more than a few megabytes of disk space for its configs over several
+ years time (roughly 3 times the sum of all the config or */configs/* over
+ 2 years is a decent approximation).
+
+ Rancid is typically CPU bound if you have adequate network bandwidth.
+ Experience shows rancid takes around 50 Mhz * minutes / device of processing
+ power. This means that a 1Ghz machine can poll:
+
+ 1000 Mhz * 60 (min/hour) / 50(Mhz min / device) = 1200 devices/hour
+
+ That's obviously a ball park estimate which varies with many different
+ factors such as the CPU type and the types of devices on your network.
+
+
+Q. How can I run rancid to make the most efficient use of resources (i.e.
+ run in the shortest amount of time)?
+
+A. You can adjust PAR_COUNT in rancid.conf to achieve maximum efficiency
+ during polling. You can watch the output of the standard unix command
+ vmstat command during polling to determine whether or not the cpu is being
+ wholly utilized - there should be little idle time and no process blocking.
+
+ Another simpler method is to look at the time stamps on the rancid log
+ files, and adjust PAR_COUNT until the least amount of time is taken
+ during polling. Make sure all devices are being polled by rancid before
+ using this method - failing devices can extend the amount of time rancid
+ takes to finish by a *LONG* period and throw your times way off.
+
+ It may help to run rancid niced (man nice) if it will be sharing
+ resources with other processes, as it may eat whatever is available if
+ PAR_COUNT is set high. This is done by changing the crontab to be
+ something like:
+
+ 5 * * * * nice -19 /usr/local/rancid/bin/rancid-run
+
+ If you _do_ share resources with other processes but want rancid to
+ run efficiently, probably the vmstat method above will work better -
+ rancid may take a little longer to run but you won't be stepping on
+ other people's toes.
+
Q. I'm still stuck on this problem. Where can I get more help?
A. A discussion list is available, rancid-discuss@shrubbery.net. You must
be a subscriber to post. Subscribe like this:
diff --git a/Makefile.in b/Makefile.in
index 0f42ead..73b3fe3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -142,6 +142,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
+RCSSYS = @RCSSYS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
SET_MAKE = @SET_MAKE@
@@ -149,6 +150,7 @@ SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
STRIP = @STRIP@
+SVN = @SVN@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@
diff --git a/README b/README
index c5174a9..ae21efc 100644
--- a/README
+++ b/README
@@ -80,6 +80,9 @@ perl5 perl version 5 or greater available from www.cpan.org
expect http://expect.nist.gov/ We highly suggest that you stick to
expect 5.24.1 (or so). This seems to work best. Note that
you need to have the accompanying tcl &/ tk.
+svn Code revision system, an alternative to cvs. Available from
+ http://subversion.tigris.org/tarballs/. Use the configure
+ option --enable-svn to configure for Subversion.
tcl Required by expect.
Bill Fenner (now maintained by others) has a cgi script for interacting
@@ -99,10 +102,10 @@ Quick Installation Guide (an example):
./configure --prefix=/home/rancid
Rancid uses autoconf's "localstatedir" as the location of it's logs,
- CVS respository, and directories where it's groups are placed. The user
- who will run rancid (from cron, etc) will need write access to these
- directories. By default, this is <prefix>/var, or /home/rancid/var
- following the example above.
+ CVS or Subversion respository, and directories where it's groups are
+ placed. The user who will run rancid (from cron, etc) will need write
+ access to these directories. By default, this is <prefix>/var, or
+ /home/rancid/var following the example above.
We realize that this is not optimal, but it follows the standards. We
suggest that this be altered to include the package name, like so:
@@ -160,10 +163,10 @@ Quick Installation Guide (an example):
7) Run rancid-cvs.
This creates all of the necessary directories and config files for
- each of the groups in LIST_OF_GROUPS and imports them into CVS. This
- will also be run each time a new group is added. Do not create the
- directories or CVS repository manually, allow rancid-cvs do it. Also see
- 'man -M <basedir>/man rancid-cvs'.
+ each of the groups in LIST_OF_GROUPS and imports them into CVS (or
+ Subversion). This will also be run each time a new group is added. Do
+ not create the directories or CVS repository manually, allow rancid-cvs
+ do it. Also see 'man -M <basedir>/man rancid-cvs'.
8) For each "group", modify the router.db file in the group directory.
The file is of the form "router:mfg:state" where "router" is
diff --git a/Todo b/Todo
index c955c52..6af136e 100644
--- a/Todo
+++ b/Todo
@@ -54,7 +54,6 @@
this is clouded by the UI mess.
- rancid needs to treat the 3600s like the 7Ks and 12Ks...
Also, need to allow 12012s, and force 700s to not be treated like 7Ks.
-- clogin rsh is munged
- LG should sort routers
- LG {requested} command additions
- show controllers T3 (data)
diff --git a/bin/Makefile.in b/bin/Makefile.in
index 2bcfa3e..ec13f2d 100644
--- a/bin/Makefile.in
+++ b/bin/Makefile.in
@@ -155,6 +155,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
+RCSSYS = @RCSSYS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
SET_MAKE = @SET_MAKE@
@@ -162,6 +163,7 @@ SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
STRIP = @STRIP@
+SVN = @SVN@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@
diff --git a/bin/cat5rancid.in b/bin/cat5rancid.in
index bea31bb..c79fc91 100644
--- a/bin/cat5rancid.in
+++ b/bin/cat5rancid.in
@@ -1,6 +1,6 @@
#! @PERLV_PATH@
##
-## $Id: cat5rancid.in,v 1.43 2005/06/20 21:24:30 heas Exp $
+## $Id: cat5rancid.in,v 1.44 2005/08/14 01:04:07 heas Exp $
##
## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
@@ -666,6 +666,38 @@ sub ShowDiag {
return(0);
}
+# This routine parses "show inventory".
+sub ShowInventory {
+ print STDERR " In ShowInventory: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ return if (/^\s*\^$/);
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ return(-1) if (/command authorization failed/i);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
+
+ chomp;
+
+ # split PID/VID line
+ if (/^(NAME: ".*,) (DESCR: .*)/) {
+ ProcessHistory("INVENTORY","","", sprintf("!%-30s%s\n", $1, $2));
+ next;
+ }
+ if (/^(PID: \w?) *, (VID: .*), (SN: .*)$/) {
+ ProcessHistory("INVENTORY","","", "!$1\n!$2\n!$3\n");
+ next;
+ }
+
+ ProcessHistory("INVENTORY","","","!$_");
+ }
+ ProcessHistory("INVENTORY","","","");
+
+ return(0);
+}
+
# This routine parses "show module"
sub ShowModule {
my($slot);
@@ -1005,6 +1037,7 @@ sub DoNothing {print STDOUT;}
{'dir sup-bootflash:' => 'DirSlotN'},
{'dir sup-microcode:' => 'DirSlotN'},
{'show module' => 'ShowModule'},
+ {'show inventory raw' => 'ShowInventory'},
{'show port ifindex' => 'ShowPortIfindex'},
{'write term all' => 'WriteTerm'},
{'write term' => 'WriteTerm'},
diff --git a/bin/clogin.in b/bin/clogin.in
index d4f27db..d03feb9 100644
--- a/bin/clogin.in
+++ b/bin/clogin.in
@@ -1,6 +1,6 @@
#! @EXPECT_PATH@ --
##
-## $Id: clogin.in,v 1.85 2005/06/14 20:20:43 heas Exp $
+## $Id: clogin.in,v 1.89 2005/08/14 20:18:19 heas Exp $
##
## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
@@ -286,7 +286,7 @@ proc source_password_file { password_file } {
}
# Log into the router.
-# returns: 0 on success, 1 on failure
+# returns: 0 on success, 1 on failure, -1 if rsh was used successfully
proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
global spawn_id in_proc do_command do_script platform
global prompt u_prompt p_prompt e_prompt sshcmd
@@ -321,16 +321,79 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
return 1
}
} elseif ![string compare $prog "rsh"] {
+ global command
+
if { ! $do_command } {
+ if { [llength $cmethod] == 1 } {
+ send_user "\nError: rsh is an invalid method for -x and "
+ send_user "interactive logins\n"
+ }
if { $progs == 0 } {
return 1
}
continue;
}
- if [ catch {spawn rsh -l $user $router} reason ] {
- send_user "\nError: rsh failed: $reason\n"
- return 1
+
+ set commands [split $command \;]
+ set num_commands [llength $commands]
+ set rshfail 0
+ for {set i 0} {$i < $num_commands && !$rshfail} { incr i} {
+ log_user 0
+ set retval [ catch {spawn rsh $user@$router [lindex $commands $i] } reason ]
+ if { $retval } {
+ send_user "\nError: rsh failed: $reason\n"
+ log_user 1; return 1
+ }
+ send_user "$router# [lindex $commands $i]\n"
+
+ # rcmd does not get a pager and no prompts, so we just have to
+ # look for failures & lines.
+ expect {
+ "Connection refused" { catch {close}; wait;
+ send_user "\nError: Connection\
+ Refused ($prog): $router\n"
+ set rshfail 1
+ }
+ -re "(Connection closed by|Connection to \[^\n\r]+ closed)" {
+ catch {close}; wait;
+ send_user "\nError: Connection\
+ closed ($prog): $router\n"
+ set rshfail 1
+ }
+ "Host is unreachable" { catch {close}; wait;
+ send_user "\nError: Host Unreachable:\
+ $router\n"
+ set rshfail 1
+ }
+ "No address associated with" {
+ catch {close}; wait;
+ send_user "\nError: Unknown host\
+ $router\n"
+ set rshfail 1
+ }
+ -re "\b+" { exp_continue }
+ -re "\[\n\r]+" { send_user -- "$expect_out(buffer)"
+ exp_continue
+ }
+ timeout { catch {close}; wait
+ send_user "\nError: TIMEOUT reached\n"
+ set rshfail 1
+ }
+ eof { catch {close}; wait }
+ }
+ log_user 1
+ }
+ if { $rshfail } {
+ if { !$progs } {
+ return 1
+ } else {
+ continue
+ }
}
+ # fake the end of the session for rancid.
+ send_user "$router# exit\n"
+ # return rsh "success"
+ return -1
} else {
send_user "\nError: unknown connection method: $prog\n"
return 1
@@ -731,6 +794,7 @@ foreach router [lrange $argv $i end] {
# Login to the router
if {[login $router $ruser $userpswd $passwd $enapasswd $cmethod $cyphertype]} {
+ # if login failed or rsh was successful, move on to the next device
continue
}
if { $enable } {
diff --git a/bin/control_rancid.in b/bin/control_rancid.in
index c33411e..98bc630 100644
--- a/bin/control_rancid.in
+++ b/bin/control_rancid.in
@@ -1,6 +1,6 @@
#! /bin/sh
##
-## $Id: control_rancid.in,v 1.69 2005/07/07 01:09:08 heas Exp $
+## $Id: control_rancid.in,v 1.71 2005/08/15 00:42:50 heas Exp $
##
## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
@@ -81,6 +81,13 @@ DIR=$BASEDIR/$GROUP
TMP=${TMPDIR:=/tmp}/rancid.$GROUP.$$
trap 'rm -fr $TMP;' 1 2 15
+# RCS system
+RCSSYS=${RCSSYS:=cvs};
+if [ $RCSSYS != "cvs" -a $RCSSYS != "svn" ] ; then
+ echo "$RCSSYS is not a valid value for RCSSYS."
+ exit 1
+fi
+
# the receipient(s) of diffs & mail options
mailrcpt=${mailrcpt:-"@MAILPLUS@${GROUP}${MAILDOMAIN}"}; export mailrcpt
adminmailrcpt=${adminmailrcpt:-"@ADMINMAILPLUS@${GROUP}${MAILDOMAIN}"};
@@ -117,10 +124,10 @@ fi
# do cvs update of router.db in case anyone has fiddled.
cd $DIR
-cvs update router.db > $TMP 2>&1
+$RCSSYS update router.db > $TMP 2>&1
grep "^C" $TMP > /dev/null
if [ $? -eq 0 ] ; then
- echo "There were CVS conflicts during update."
+ echo "There were $RCSSYS conflicts during update."
echo ""
cat $TMP
rm -f $TMP
@@ -241,8 +248,12 @@ then
router=$1
touch $router
- cvs add -ko $router
- cvs commit -m 'new router' $router
+ if [ $RCSSYS = cvs ] ; then
+ cvs add -ko $router
+ else
+ svn add $router
+ fi
+ $RCSSYS commit -m 'new router' $router
echo "Added $router"
done
echo
@@ -265,23 +276,31 @@ rm -f routers.db
trap 'rm -fr $TMP;' 1 2 15
cd $DIR/configs
-# check for 'up' routers missing in cvs. no idea how this happens to some folks
+# check for 'up' routers missing in RCS. no idea how this happens to some folks
for router in `cut -d: -f1 ../routers.up` ; do
- cvs status $router | grep -i 'status: unknown' > /dev/null 2>&1
+ if [ $RCSSYS = cvs ] ; then
+ cvs status $router | grep -i 'status: unknown' > /dev/null 2>&1
+ else
+ svn status $router | grep '^?' > /dev/null 2>&1
+ fi
if [ $? -eq 0 ]; then
touch $router
- cvs add -ko $router
- echo "CVS added missing router $router"
+ if [ $RCSSYS = cvs ] ; then
+ cvs add -ko $router
+ else
+ svn add $router
+ fi
+ echo "$RCSSYS added missing router $router"
fi
done
echo
-# cvs delete configs for routers not listed in routers.up.
-for router in `find . \( -name \*.new -prune -o -name CVS -prune \) -o -type f -print | sed -e 's/^.\///'` ; do
+# delete configs from RCS for routers not listed in routers.up.
+for router in `find . \( -name \*.new -prune -o -name CVS -prune -o -name .svn -prune \) -o -type f -print | sed -e 's/^.\///'` ; do
grep -i "^$router:" ../router.db > /dev/null 2>&1
if [ $? -eq 1 ]; then
rm -f $router
- cvs delete $router
- cvs commit -m 'deleted router' $router
+ $RCSSYS delete $router
+ $RCSSYS commit -m 'deleted router' $router
echo "Deleted $router"
fi
done
@@ -291,7 +310,7 @@ cd $DIR
if [ ! -s routers.up ]
then
# commit router.db
- cvs commit -m updates router.db > /dev/null
+ $RCSSYS commit -m updates router.db > /dev/null
exit;
fi
@@ -379,8 +398,12 @@ done
# Diff the directory and then checkin.
trap 'rm -fr $TMP $TMP.diff $DIR/routers.single;' 1 2 15
cd $DIR
-cvs -f @DIFF_CMD@ | sed -e '/^RCS file: /d' -e '/^--- /d' \
+if [ $RCSSYS = "cvs" ] ; then
+ cvs -f @DIFF_CMD@ -ko | sed -e '/^RCS file: /d' -e '/^--- /d' \
-e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
+else
+ svn diff | sed -e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
+fi
if [ $alt_mailrcpt -eq 1 ] ; then
subject="router config diffs - courtesy of $mailrcpt"
@@ -388,10 +411,10 @@ else
subject="router config diffs"
fi
if [ "X$device" != "X" ] ; then
- cvs commit -m "updates - courtesy of $mailrcpt"
+ $RCSSYS commit -m "updates - courtesy of $mailrcpt"
subject="$GROUP/$device $subject"
else
- cvs commit -m updates
+ $RCSSYS commit -m updates
subject="$GROUP $subject"
fi
diff --git a/bin/rancid-cvs.in b/bin/rancid-cvs.in
index 22d5fd2..a683f49 100644
--- a/bin/rancid-cvs.in
+++ b/bin/rancid-cvs.in
@@ -1,6 +1,6 @@
#! /bin/sh
##
-## $Id: rancid-cvs.in,v 1.16 2004/01/11 03:49:13 heas Exp $
+## $Id: rancid-cvs.in,v 1.17 2005/08/15 00:42:50 heas Exp $
##
## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
@@ -20,7 +20,7 @@
##
#
# Create all of the misc files & dirs needed for each group and import them
-# into CVS.
+# into CVS or Subversion.
#
# rancid-cvs
#
@@ -38,9 +38,20 @@ fi
cd $BASEDIR
+# RCS system
+RCSSYS=${RCSSYS:=cvs};
+if [ $RCSSYS != "cvs" -a $RCSSYS != "svn" ] ; then
+ echo "$RCSSYS is not a valid value for RCSSYS."
+ exit 1
+fi
+
# Top level CVS stuff
if [ ! -d $CVSROOT ]; then
- cvs init
+ if [ $RCSSYS = cvs ]; then
+ cvs -d $CVSROOT init
+ else
+ svnadmin create $CVSROOT
+ fi
fi
# Log dir
@@ -65,15 +76,21 @@ do
if [ ! -d $DIR ]; then
mkdir -p $DIR
cd $DIR
- cvs import -m "$GROUP" $GROUP new rancid
- cd $BASEDIR
- cvs co $GROUP
+ if [ $RCSSYS = cvs ]; then
+ cvs import -m "$GROUP" $GROUP new rancid
+ cd $BASEDIR
+ cvs checkout $GROUP
+ else
+ svn import -m "$GROUP" . file://$CVSROOT/$GROUP
+ cd $BASEDIR
+ svn checkout file://$CVSROOT/$GROUP $GROUP
+ fi
fi
cd $DIR
if [ ! -d configs ]; then
mkdir configs
- cvs add configs
- cvs commit -m 'new' configs
+ $RCSSYS add configs
+ $RCSSYS commit -m 'new' configs
fi
# main files
@@ -88,7 +105,7 @@ do
fi
if [ ! -f router.db ]; then
touch router.db
- cvs add router.db
- cvs commit -m 'new' router.db
+ $RCSSYS add router.db
+ $RCSSYS commit -m 'new' router.db
fi
done
diff --git a/bin/rancid.in b/bin/rancid.in
index 915be60..3183dca 100644
--- a/bin/rancid.in
+++ b/bin/rancid.in
@@ -1,6 +1,6 @@
#! @PERLV_PATH@
##
-## $Id: rancid.in,v 1.190 2005/06/24 16:07:00 heas Exp $
+## $Id: rancid.in,v 1.193 2005/08/14 22:29:29 heas Exp $
##
## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
@@ -148,6 +148,7 @@ sub ShowVersion {
tr/\015//d;
if (/^$prompt/) { $found_version=1; last};
next if(/^(\s*|\s*$cmd\s*)$/);
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
return(0) if ($found_version); # Only do this routine once
@@ -360,6 +361,7 @@ sub ShowRedundancy {
tr/\015//d;
last if(/^$prompt/);
next if(/^(\s*|\s*$cmd\s*)$/);
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
# the pager can not be disabled per-session on the PIX
s/^<-+ More -+>\s*//;
@@ -384,6 +386,7 @@ sub ShowIDprom {
tr/\015//d;
last if(/^$prompt/);
next if(/^(\s*|\s*$cmd\s*)$/);
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
# the pager can not be disabled per-session on the PIX
s/^<-+ More -+>\s*//;
@@ -413,6 +416,7 @@ sub ShowInstallActive {
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
return(1) if /^\s*\^\s*$/;
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
@@ -432,6 +436,7 @@ sub ShowEnv {
if (/^$prompt/) { $found_env=1; last};
next if (/^(\s*|\s*$cmd\s*)$/);
#return(1) if ($type !~ /^7/);
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
return(0) if ($found_env); # Only do this routine once
@@ -539,6 +544,7 @@ sub ShowBoot {
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
return(1) if /^\s*\^\s*$/;
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
return(1) if /Ambiguous command/i;
return(1) if /(Open device \S+ failed|Error opening \S+:)/;
@@ -575,6 +581,7 @@ sub ShowFlash {
next if (/^(\s*|\s*$cmd\s*)$/);
return(1) if ($type =~ /^(12[40]|7)/);
return(1) if /^\s*\^\s*$/;
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
@@ -599,6 +606,7 @@ sub DirSlotN {
next if (/^(\s*|\s*$cmd\s*)$/);
# return(1) if ($type !~ /^(12[40]|7|36)/);
return(1) if /^\s*\^\s*$/;
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
return(1) if /(No such device|Error Sending Request)/i;
return(1) if /\%Error: No such file or directory/;
@@ -732,6 +740,7 @@ sub ShowDiagbus {
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
#return(1) if ($type !~ /^7[05]/);
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
@@ -821,6 +830,7 @@ REDUX: tr/\015//d;
if (/^$prompt/) { $found_diag=1; last};
next if (/^(\s*|\s*$cmd\s*)$/);
# return(1) if ($type !~ /^(12[40]|720|36|26)/);
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
return(0) if ($found_diag); # Only do this routine once
@@ -1022,6 +1032,38 @@ PerlSucks:
return(0);
}
+# This routine parses "show inventory".
+sub ShowInventory {
+ print STDERR " In ShowInventory: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ return if (/^\s*\^$/);
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ return(-1) if (/command authorization failed/i);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
+
+ chomp;
+
+ # split PID/VID line
+ if (/^(NAME: ".*,) (DESCR: .*)/) {
+ ProcessHistory("INVENTORY","","", sprintf("!%-30s%s\n", $1, $2));
+ next;
+ }
+ if (/^(PID: \w?) *, (VID: .*), (SN: .*)$/) {
+ ProcessHistory("INVENTORY","","", "!$1\n!$2\n!$3\n");
+ next;
+ }
+
+ ProcessHistory("INVENTORY","","","!$_");
+ }
+ ProcessHistory("INVENTORY","","","!\n");
+
+ return(0);
+}
+
# This routine parses "show module".
sub ShowModule {
print STDERR " In ShowModule: $_" if ($debug);
@@ -1081,6 +1123,7 @@ sub ShowSpeVersion {
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
return(1) if /^\s*\^\s*$/;
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
@@ -1145,6 +1188,7 @@ sub ShowVTP {
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
return(1) if /^\s*\^\s*$/;
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
#return(1) if ($type !~ /^(2900XL|3500XL|6000)$/);
return(-1) if (/command authorization failed/i);
@@ -1170,6 +1214,7 @@ sub ShowVLAN {
tr/\015//d;
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
# newer releases (~12.1(9)) place the vlan config in the normal
# configuration (write term).
@@ -1192,6 +1237,7 @@ sub WriteTerm {
while (<INPUT>) {
tr/\015//d;
last if(/^$prompt/);
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
@@ -1552,6 +1598,7 @@ sub DoNothing {print STDOUT;}
{'show module' => 'ShowModule'}, # cat 6500-ios
{'show spe version' => 'ShowSpeVersion'},
{'show c7200' => 'ShowC7200'},
+ {'show inventory raw' => 'ShowInventory'},
{'show vtp status' => 'ShowVTP'},
{'show vlan' => 'ShowVLAN'},
{'show running-config' => 'WriteTerm'},
diff --git a/configure b/configure
index ec1428a..c88aca6 100755
--- a/configure
+++ b/configure
@@ -310,7 +310,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP U ANSI2KNR MK_LCLSTATEDIR_TRUE MK_LCLSTATEDIR_FALSE CONF_INSTALL_TRUE CONF_INSTALL_FALSE MAILPLUS ADMINMAILPLUS DIRNAME DIFF DIFF_CMD SENDMAIL TAR PERLV_PATH PERLV EXPECT_PATH PING_PATH LG_PING_CMD CVS COMM FIND GREP ID MKDIR RSH SORT SSH TELNET TOUCH ENV_PATH LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP U ANSI2KNR MK_LCLSTATEDIR_TRUE MK_LCLSTATEDIR_FALSE CONF_INSTALL_TRUE CONF_INSTALL_FALSE RCSSYS MAILPLUS ADMINMAILPLUS DIRNAME DIFF DIFF_CMD SENDMAIL TAR PERLV_PATH PERLV EXPECT_PATH PING_PATH LG_PING_CMD CVS SVN COMM FIND GREP ID MKDIR RSH SORT SSH TELNET TOUCH ENV_PATH LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -853,6 +853,7 @@ Optional Features:
install time (default: yes)
--enable-conf-install enable install of sample .conf files in sysconfdir
(default: yes)
+ --enable-svn enable use of subversion instead of cvs
--enable-mail-plus enable mail to rancid+ addresses, instead of rancid-
--enable-adminmail-plus enable mail to rancid-admin+ addresses, instead of
rancid-admin-
@@ -4997,8 +4998,7 @@ else
fi
-# Check if user wants us to create LOCALSTATEDIR. If it's a package-system,
-# they might create it themselves for book-keeping sake; eg: NetBSD
+# Check if user wants us to install sample configurations into the sysconfdir.
echo "$as_me:$LINENO: checking whether to install sample .conf files in sysconfdir" >&5
echo $ECHO_N "checking whether to install sample .conf files in sysconfdir... $ECHO_C" >&6
# Check whether --enable-conf-install or --disable-conf-install was given.
@@ -5028,6 +5028,30 @@ else
fi
+# Configure for subversion revision control system instead of CVS.
+echo "$as_me:$LINENO: checking whether subversion" >&5
+echo $ECHO_N "checking whether subversion... $ECHO_C" >&6
+# Check whether --enable-svn or --disable-svn was given.
+if test "${enable_svn+set}" = set; then
+ enableval="$enable_svn"
+ if test "$enable_svn" = yes; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ RCSSYS="svn"
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ RCSSYS="cvs"
+fi
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ RCSSYS="cvs"
+
+fi;
+
+rd_cv_RCSSYS=$RCSSYS
+
# Check for a preference for using mail addresses like rancid+group
# instead of the standard rancid-group
echo "$as_me:$LINENO: checking whether mail addresses should be in the rancid+ form" >&5
@@ -5595,7 +5619,8 @@ rd_cv_lg_ping_cmd=$LG_PING_CMD
ENV_PATH="`dirname $PERLV_PATH`:`dirname $EXPECT_PATH`:`dirname $SENDMAIL`"
ENV_PATH="$ENV_PATH:`dirname $DIRNAME`:`dirname $DIFF`"
-# Extract the first word of "cvs", so it can be a program name with args.
+if test $RCSSYS = "cvs" ; then
+ # Extract the first word of "cvs", so it can be a program name with args.
set dummy cvs; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
@@ -5635,7 +5660,50 @@ else
echo "${ECHO_T}no" >&6
fi
-ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_CVS`"
+ ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_CVS`"
+else
+ # Extract the first word of "svn", so it can be a program name with args.
+set dummy svn; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_SVN+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $SVN in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_SVN="$SVN" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_SVN="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_path_SVN" && ac_cv_path_SVN="no"
+ ;;
+esac
+fi
+SVN=$ac_cv_path_SVN
+
+if test -n "$SVN"; then
+ echo "$as_me:$LINENO: result: $SVN" >&5
+echo "${ECHO_T}$SVN" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_SVN`"
+fi
# Extract the first word of "comm", so it can be a program name with args.
set dummy comm; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -6858,6 +6926,7 @@ s,@MK_LCLSTATEDIR_TRUE@,$MK_LCLSTATEDIR_TRUE,;t t
s,@MK_LCLSTATEDIR_FALSE@,$MK_LCLSTATEDIR_FALSE,;t t
s,@CONF_INSTALL_TRUE@,$CONF_INSTALL_TRUE,;t t
s,@CONF_INSTALL_FALSE@,$CONF_INSTALL_FALSE,;t t
+s,@RCSSYS@,$RCSSYS,;t t
s,@MAILPLUS@,$MAILPLUS,;t t
s,@ADMINMAILPLUS@,$ADMINMAILPLUS,;t t
s,@DIRNAME@,$DIRNAME,;t t
@@ -6871,6 +6940,7 @@ s,@EXPECT_PATH@,$EXPECT_PATH,;t t
s,@PING_PATH@,$PING_PATH,;t t
s,@LG_PING_CMD@,$LG_PING_CMD,;t t
s,@CVS@,$CVS,;t t
+s,@SVN@,$SVN,;t t
s,@COMM@,$COMM,;t t
s,@FIND@,$FIND,;t t
s,@GREP@,$GREP,;t t
diff --git a/configure.in b/configure.in
index 588ab80..ab63ac4 100644
--- a/configure.in
+++ b/configure.in
@@ -74,8 +74,7 @@ fi],
])
AM_CONDITIONAL([MK_LCLSTATEDIR], [test "${enable_mk_localstatedir}" = yes])
-# Check if user wants us to create LOCALSTATEDIR. If it's a package-system,
-# they might create it themselves for book-keeping sake; eg: NetBSD
+# Check if user wants us to install sample configurations into the sysconfdir.
AC_MSG_CHECKING([whether to install sample .conf files in sysconfdir])
AC_ARG_ENABLE(conf-install,
AS_HELP_STRING([--enable-conf-install], [enable install of sample .conf files in sysconfdir (default: yes)]),
@@ -89,6 +88,23 @@ fi],
])
AM_CONDITIONAL([CONF_INSTALL], [test "${enable_conf_install}" = yes])
+# Configure for subversion revision control system instead of CVS.
+AC_MSG_CHECKING([whether subversion])
+AC_ARG_ENABLE(svn,
+ AS_HELP_STRING([--enable-svn], [enable use of subversion instead of cvs]),
+[if test "$enable_svn" = yes; then
+ AC_MSG_RESULT(yes)
+ RCSSYS="svn"
+else
+ AC_MSG_RESULT(no)
+ RCSSYS="cvs"
+fi],
+[AC_MSG_RESULT(no)
+ RCSSYS="cvs"
+])
+AC_SUBST(RCSSYS)
+rd_cv_RCSSYS=$RCSSYS
+
# Check for a preference for using mail addresses like rancid+group
# instead of the standard rancid-group
AC_MSG_CHECKING([whether mail addresses should be in the rancid+ form])
@@ -238,8 +254,13 @@ rd_cv_lg_ping_cmd=$LG_PING_CMD
ENV_PATH="`dirname $PERLV_PATH`:`dirname $EXPECT_PATH`:`dirname $SENDMAIL`"
ENV_PATH="$ENV_PATH:`dirname $DIRNAME`:`dirname $DIFF`"
-AC_PATH_PROG(CVS,cvs,no)
-ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_CVS`"
+if test $RCSSYS = "cvs" ; then
+ AC_PATH_PROG(CVS,cvs,no)
+ ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_CVS`"
+else
+ AC_PATH_PROG(SVN,svn,no)
+ ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_SVN`"
+fi
AC_PATH_PROG(COMM,comm,no)
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_COMM`"
AC_PATH_PROG(FIND,find,no)
diff --git a/etc/Makefile.am b/etc/Makefile.am
index 8b566c0..73b3c3a 100644
--- a/etc/Makefile.am
+++ b/etc/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
## A Makefile.in is supplied, in case you do not have automake.
-## $Id: Makefile.am,v 1.12 2005/02/12 00:08:18 heas Exp $
+## $Id: Makefile.am,v 1.13 2005/08/14 23:35:13 heas Exp $
##
## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
@@ -70,7 +70,8 @@ auto_edit = sed \
-e 's,@sysconfdir\@,$(sysconfdir),g' \
-e 's,@EXPECT_PATH\@,$(EXPECT_PATH),g' \
-e 's,@PERLV_PATH\@,$(PERLV_PATH),g' \
- -e 's,@ENV_PATH\@,$(ENV_PATH),g'
+ -e 's,@ENV_PATH\@,$(ENV_PATH),g' \
+ -e 's,@RCSSYS\@,$(RCSSYS),g'
lg.conf.sample: Makefile $(srcdir)/lg.conf.sample.in
rm -f lg.conf.sample lg.conf.sample.tmp; \
diff --git a/etc/Makefile.in b/etc/Makefile.in
index de060b1..f625e2f 100644
--- a/etc/Makefile.in
+++ b/etc/Makefile.in
@@ -116,6 +116,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
+RCSSYS = @RCSSYS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
SET_MAKE = @SET_MAKE@
@@ -123,6 +124,7 @@ SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
STRIP = @STRIP@
+SVN = @SVN@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@
@@ -181,7 +183,8 @@ auto_edit = sed \
-e 's,@sysconfdir\@,$(sysconfdir),g' \
-e 's,@EXPECT_PATH\@,$(EXPECT_PATH),g' \
-e 's,@PERLV_PATH\@,$(PERLV_PATH),g' \
- -e 's,@ENV_PATH\@,$(ENV_PATH),g'
+ -e 's,@ENV_PATH\@,$(ENV_PATH),g' \
+ -e 's,@RCSSYS\@,$(RCSSYS),g'
all: all-am
diff --git a/etc/rancid.conf.sample.in b/etc/rancid.conf.sample.in
index 2a51249..c09de01 100644
--- a/etc/rancid.conf.sample.in
+++ b/etc/rancid.conf.sample.in
@@ -12,20 +12,24 @@ umask 027
# Under BASEDIR (i.e.: --localstatedir), there will be a "logs" directory for
# the logs from rancid and a directory for each group of routers defined in
# LIST_OF_GROUPS (below). In addition to these, there will be a "CVS"
-# directory which is the cvs repository.
+# directory which is the cvs (or Subversion) repository.
#
-# Use a full path (no sym-links) for BASEDIR. Some versions of CVS seem to
-# dislike sym-links.
+# Use a full path (no sym-links) for BASEDIR.
#
TMPDIR=/tmp; export TMPDIR
# Be careful changing this, it affects CVSROOT below.
BASEDIR=@localstatedir@; export BASEDIR
PATH=@bindir@:@ENV_PATH@; export PATH
-# Location of the CVS repository. Be careful changing this.
+# Location of the CVS/SVN repository. Be careful changing this.
CVSROOT=$BASEDIR/CVS; export CVSROOT
# Location of log files produced by rancid-run(1).
LOGDIR=$BASEDIR/logs; export LOGDIR
#
+# Select which RCS system to use, "cvs" (default) or "svn". Do not change
+# this after CVSROOT has been created with rancid-cvs. Changing between these
+# requires manual conversions.
+RCSSYS=@RCSSYS@; export RCSSYS
+#
# if NOPIPE is set, temp files will be used instead of a cmd pipe during
# collection from the router(s).
#NOPIPE=YES; export NOPIPE
diff --git a/include/Makefile.in b/include/Makefile.in
index 1fca9b6..c31b905 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -112,6 +112,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
+RCSSYS = @RCSSYS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
SET_MAKE = @SET_MAKE@
@@ -119,6 +120,7 @@ SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
STRIP = @STRIP@
+SVN = @SVN@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@
diff --git a/include/version.h b/include/version.h
index 976d99d..c51c1ae 100644
--- a/include/version.h
+++ b/include/version.h
@@ -4,6 +4,6 @@
/* pkg version */
char package[] = "rancid";
-char version[] = "2.3.2a2";
+char version[] = "2.3.2a3";
#endif
diff --git a/include/version.h.in b/include/version.h.in
index 976d99d..c51c1ae 100644
--- a/include/version.h.in
+++ b/include/version.h.in
@@ -4,6 +4,6 @@
/* pkg version */
char package[] = "rancid";
-char version[] = "2.3.2a2";
+char version[] = "2.3.2a3";
#endif
diff --git a/man/Makefile.in b/man/Makefile.in
index c7415a2..2bcf956 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -113,6 +113,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
+RCSSYS = @RCSSYS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
SET_MAKE = @SET_MAKE@
@@ -120,6 +121,7 @@ SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
STRIP = @STRIP@
+SVN = @SVN@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@
diff --git a/man/rancid-cvs.1 b/man/rancid-cvs.1
index 2cb34bd..3149ad1 100644
--- a/man/rancid-cvs.1
+++ b/man/rancid-cvs.1
@@ -1,29 +1,26 @@
.\"
.hys 50
-.TH "rancid-cvs" "1" "7 Jan 2004"
+.TH "rancid-cvs" "1" "13 August 2005"
.SH NAME
-rancid-cvs \- initialize CVS and rancid group files and directories
+rancid-cvs \- initialize CVS or Subversion and rancid group files and directories
.SH SYNOPSIS
.B rancid-cvs
[group [group ...]]
.SH DESCRIPTION
.B rancid-cvs
-is a
-.IR sh (1)
-script to create the directories,
-.BR router.db (5),
-and
-.BR cvs (1)
-directories necessary for a rancid group.
+creates the directories and
+.BR router.db (5)
+for each rancid group and handles the revision control system (CVS or
+Subversion) set-up.
+It must be run after installation and whenever a rancid group is added.
.\"
.PP
.B rancid-cvs
reads
.BR rancid.conf (5)
-to configure itself. Then proceeds with the initialization first of the
-.BR cvs (1)
-repository, if necessary, and then for each of the rancid groups listed on
-the command-line or those in the variable
+to configure itself, then proceeds with the initialization.
+First of the CVS or Subversion repository, if necessary, and then for each
+of the rancid groups listed on the command-line or those in the variable
.I LIST_OF_GROUPS
from
.BR rancid.conf (5),
@@ -33,11 +30,10 @@ if the argument is omitted.
Running
.B rancid-cvs
for groups which already exist will not cause problems. If the group's
-directory already exists, the
-.BR cvs (1)
-import will be skipped, and if it's
+directory already exists, the import into the revision control system
+will be skipped, and if it's
.BR router.db (5)
-already exists, it will be left as-is.
+already exists, it will not be altered.
.\"
.PP
The best method for adding groups is add the group name to
@@ -51,4 +47,5 @@ to do it.
.SH "SEE ALSO"
.BR cvs (1),
.BR rancid.conf (5),
-.BR router.db (5)
+.BR router.db (5),
+.BR svn (1)
diff --git a/man/rancid-run.1 b/man/rancid-run.1
index bbb56a2..f6ebe23 100644
--- a/man/rancid-run.1
+++ b/man/rancid-run.1
@@ -1,6 +1,6 @@
.\"
.hys 50
-.TH "rancid-run" "1" "7 Jan 2004"
+.TH "rancid-run" "1" "13 August 2005"
.SH NAME
rancid-run \- run rancid for each of the groups
.SH SYNOPSIS
@@ -107,13 +107,12 @@ Directory to hold temporary and lock files.
.SH ERRORS
If rancid fails to run or collect a device's configuration, the particular
group's log file (mentioned above) should be consulted. Any errors produced
-by
-.BR cvs (1)
-or any of the rancid scripts should be included there, whether they be a
-botched cvs tree, login authentication failure, rancid configuration error,
-etc. If the log file produces no clues, the next debugging step should be
-run the commands manually. For example, can the user who runs rancid login
-to the device with 'clogin hostname', and so on.
+by the revision control system (CVS or Subversion) or any of the rancid
+scripts should be included there, whether they be a botched cvs tree, login
+authentication failure, rancid configuration error, etc.
+If the log file produces no clues, the next debugging step should be run the
+commands manually. For example, can the user who runs rancid login to the
+device with 'clogin hostname', and so on.
.BR
.SH FILES
.TP
diff --git a/man/rancid.conf.5.in b/man/rancid.conf.5.in
index 4a86364..e89568a 100644
--- a/man/rancid.conf.5.in
+++ b/man/rancid.conf.5.in
@@ -1,8 +1,8 @@
.\"
-.\" $Id: rancid.conf.5.in,v 1.14 2005/07/07 01:09:13 heas Exp $
+.\" $Id: rancid.conf.5.in,v 1.15 2005/08/15 00:41:51 heas Exp $
.\"
.hys 50
-.TH "rancid.conf" "5" "5 July 2005"
+.TH "rancid.conf" "5" "13 August 2005"
.SH NAME
rancid.conf \- rancid environment configuration file
.SH DESCRIPTION
@@ -32,10 +32,12 @@ The following variables are used (listed alphabetically):
.B BASEDIR
BASEDIR is the directory where
.B rancid-run's
-log directory and where the CVS repository and rancid collection group
-directories will be placed. Its value is configure's localstatedir and
-should be modified if rancid is moved to a new location in the file
-system without re-installing from the distribution.
+log directory, the revision control system's repository, and rancid group
+directories will be placed.
+.sp
+Its value is configure's localstatedir and should be modified if rancid is
+moved to a new location in the file system without re-installing from the
+distribution.
.sp
Default: @localstatedir@
.\"
@@ -44,8 +46,9 @@ Default: @localstatedir@
.IR cvs (1)
and
.IR rancid-cvs (1)
-use this environment variable to locate the CVS repository. It should
-not be necessary to alter it.
+use this environment variable to locate the CVS repository.
+In some cases, and for Subversion, it is used as an argument to commands.
+It should not be necessary to alter it.
.sp
Default: $BASEDIR/CVS
.\"
@@ -152,10 +155,11 @@ this is not set.
If set,
.IR rancid (1)
will use temporary files to save the output from the router and then read
-these to build the file which will be saved in CVS. Otherwise, an IPC
-pipe will be used. We have found that the buffering mechanisms used in
-perl and expect are heinous. Using temporary files may result in a noticeable
-improvement in speed. By default, this is not set.
+these to build the file which will be saved in CVS (or Subversion).
+Otherwise, an IPC pipe will be used. We have found that the buffering
+mechanisms used in perl and expect are heinous.
+Using temporary files may result in a noticeable improvement in speed.
+By default, this is not set.
.\"
.TP
.B OLDTIME
@@ -196,6 +200,18 @@ Its value is set by configure. Should it be necessary to modify PATH,
note that it must include @bindir@.
.\"
.TP
+.B RCSSYS
+Sets which revision control system is in use.
+Valid values are
+.B cvs
+for CVS
+or
+.B svn
+for Subversion.
+.sp
+Default: cvs
+.\"
+.TP
.B TERM
Some Unix utilities require TERM, the terminal type, to be set to a sane
value. Some clients, such as
diff --git a/man/rancid_intro.1 b/man/rancid_intro.1
index 52d54e6..c00e428 100644
--- a/man/rancid_intro.1
+++ b/man/rancid_intro.1
@@ -1,8 +1,8 @@
.\"
-.\" $Id: rancid_intro.1,v 1.28 2004/01/13 21:52:44 heas Exp $
+.\" $Id: rancid_intro.1,v 1.29 2005/08/15 00:41:51 heas Exp $
.\"
.hys 50
-.TH "rancid_intro" "1" "7 Jan 2004"
+.TH "rancid_intro" "1" "13 August 2005"
.SH NAME
rancid_intro \- introduction to the Really Awesome New Cisco confIg Differ
.SH INTRODUCTION
@@ -40,7 +40,8 @@ will also include any differences of the device list in the group's
configuration file,
.IR "router.db".
.PP
-Lastly, all the updated files are checked into the CVS repository.
+Lastly, all the updated files are checked into the revision control system
+(CVS or Subversion).
.PP
Additional utilities, including a looking glass, come with rancid. See
rancid's share directory (
@@ -89,7 +90,7 @@ below or follow the basic instructions included in the README file.
See http://www.shrubbery.net/rancid for information on new versions,
mail lists, etc.
.SH "ADDING NEW GROUPS"
-Follow this procdure for adding new groups:
+Follow this procedure for adding new groups:
.TP
o
Update the
diff --git a/man/router.db.5 b/man/router.db.5
index 8261556..2b9d654 100644
--- a/man/router.db.5
+++ b/man/router.db.5
@@ -1,6 +1,6 @@
.\"
.hys 50
-.TH "router.db" "5" "7 Jan 2004"
+.TH "router.db" "5" "13 August 2005"
.SH NAME
router.db \- rancid group configuration file
.SH DESCRIPTION
@@ -160,12 +160,9 @@ file, then
.B rancid
will clean up by removing the device's config file from
\fI$BASEDIR/<group>/configs\fR.
-The
-.IR cvs (1)
-information for the device will be moved to
-.IR cvs (1)'s
-Attic directory (using
-.IR "cvs delete").
+The device will be removed from the revision control system.
+It is possible, in most cases, to resurrect or check-out copies of
+deleted device configurations.
.PP
.SH FILES
.ta \w'xBASEDIR/<group>/router.db 'u
diff --git a/share/Makefile.in b/share/Makefile.in
index 13e51db..b9d183d 100644
--- a/share/Makefile.in
+++ b/share/Makefile.in
@@ -123,6 +123,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
+RCSSYS = @RCSSYS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
SET_MAKE = @SET_MAKE@
@@ -130,6 +131,7 @@ SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
STRIP = @STRIP@
+SVN = @SVN@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@