├── debian ├── compat ├── rancid-git.examples ├── rancid-cgi.examples ├── rancid-cgi.docs ├── rancid-cgi.dirs ├── rancid-git.dirs ├── rancid-git.docs ├── rancid-git.links ├── rancid-cgi.logrotate ├── rancid-git.cron.d ├── watch ├── rancid-git.preinst ├── rancid-cgi.preinst ├── changelog ├── rancid-cgi.apache2 ├── rancid-cgi.cron ├── rancid-cgi.postinst ├── rancid-git.postinst ├── control ├── README.Debian ├── rules └── copyright ├── man ├── agmrancid.1 ├── alogin.1 ├── arancid.1 ├── arrancid.1 ├── avologin.1 ├── avorancid.1 ├── blogin.1 ├── bntlogin.1 ├── bntrancid.1 ├── brancid.1 ├── cat5rancid.1 ├── cssrancid.1 ├── elogin.1 ├── erancid.1 ├── f10rancid.1 ├── f5rancid.1 ├── flogin.1 ├── fnlogin.1 ├── fnrancid.1 ├── francid.1 ├── hlogin.1 ├── hrancid.1 ├── htlogin.1 ├── htrancid.1 ├── jerancid.1 ├── jlogin.1 ├── jrancid.1 ├── mrancid.1 ├── mrvlogin.1 ├── mrvrancid.1 ├── mtlogin.1 ├── mtrancid.1 ├── nlogin.1 ├── nrancid.1 ├── nslogin.1 ├── nsrancid.1 ├── nxrancid.1 ├── pflogin.1 ├── pfrancid.1 ├── prancid.1 ├── rivlogin.1 ├── rivrancid.1 ├── rrancid.1 ├── srancid.1 ├── tlogin.1 ├── tntlogin.1 ├── tntrancid.1 ├── trancid.1 ├── urancid.1 ├── vlogin.1 ├── vrancid.1 ├── xrancid.1 ├── xrrancid.1 ├── zrancid.1 ├── zyrancid.1 ├── telcorancid.1 ├── ubnt-es-rancid.1 ├── control_rancid.1 ├── rancid-cvs.1 ├── lg_intro.1.in ├── par.1 ├── rancid-run.1 ├── rancid.1 ├── rancid_intro.1 ├── Makefile.am ├── router.db.5 ├── lg.conf.5.in └── clogin.1 ├── rel-eng ├── packages │ ├── rancid-git │ └── .readme └── tito.props ├── BUGS ├── acinclude.m4 ├── include ├── version.h ├── version.h.in ├── Makefile.am └── config.h.in ├── INSTALL ├── .travis.yml ├── share ├── index.html ├── README.misc ├── lgnotes.html ├── rancid-cvspurge.in ├── Makefile.am ├── downreport.in ├── rancid.spec ├── getipacctg ├── rtrfilter.in └── cisco-reload.exp ├── bin ├── rugged ├── rancid-fe.in ├── rancid-run.in ├── ucsrancid.in ├── Makefile.am ├── rancid_par.in └── rancid-cvs.in ├── README.git ├── Makefile.am ├── .gitignore ├── COPYING ├── update-spec.sh ├── UPGRADING ├── mkinstalldirs ├── cloginrc.sample ├── README.lg ├── etc ├── rancid.conf.sample.in ├── Makefile.am └── lg.conf.sample.in ├── Todo └── missing /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /man/agmrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/alogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/arancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/arrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/avologin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/avorancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/blogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/bntlogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/bntrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/brancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/cat5rancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/cssrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/elogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/erancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/f10rancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/f5rancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/flogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/fnlogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/fnrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/francid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/hlogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/hrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/htlogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/htrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/jerancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/jlogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/jrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/mrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/mrvlogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/mrvrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/mtlogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/mtrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/nlogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/nrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/nslogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/nsrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/nxrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/pflogin.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/pfrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/prancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/rivlogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/rivrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/rrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/srancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/tlogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/tntlogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/tntrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/trancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/urancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/vlogin.1: -------------------------------------------------------------------------------- 1 | .so man1/clogin.1 2 | -------------------------------------------------------------------------------- /man/vrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/xrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/xrrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/zrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/zyrancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/telcorancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /man/ubnt-es-rancid.1: -------------------------------------------------------------------------------- 1 | .so man1/rancid.1 2 | -------------------------------------------------------------------------------- /rel-eng/packages/rancid-git: -------------------------------------------------------------------------------- 1 | 2.3.8-0 / 2 | -------------------------------------------------------------------------------- /BUGS: -------------------------------------------------------------------------------- 1 | See the the file Todo for known bugs. 2 | -------------------------------------------------------------------------------- /debian/rancid-git.examples: -------------------------------------------------------------------------------- 1 | cloginrc.sample 2 | -------------------------------------------------------------------------------- /acinclude.m4: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS=no-dependencies foreign 2 | -------------------------------------------------------------------------------- /debian/rancid-cgi.examples: -------------------------------------------------------------------------------- 1 | debian/rancid-cgi.apache2 2 | debian/rancid-cgi.cron 3 | -------------------------------------------------------------------------------- /debian/rancid-cgi.docs: -------------------------------------------------------------------------------- 1 | BUGS 2 | CHANGES 3 | FAQ 4 | Todo 5 | README.lg 6 | share/lgnotes.html 7 | -------------------------------------------------------------------------------- /debian/rancid-cgi.dirs: -------------------------------------------------------------------------------- 1 | etc/rancid 2 | usr/share/man/man5 3 | usr/share/man/man1 4 | usr/lib/cgi-bin/lg 5 | var/cache/rancid-cgi 6 | -------------------------------------------------------------------------------- /debian/rancid-git.dirs: -------------------------------------------------------------------------------- 1 | etc/rancid 2 | usr/bin 3 | var/lib/rancid 4 | usr/lib/rancid/bin 5 | var/log/rancid 6 | usr/share/man/man1 7 | usr/share/man/man5 8 | -------------------------------------------------------------------------------- /debian/rancid-git.docs: -------------------------------------------------------------------------------- 1 | BUGS 2 | CHANGES 3 | FAQ 4 | README 5 | Todo 6 | UPGRADING 7 | share/README.misc 8 | share/cisco-load.exp 9 | share/cisco-reload.exp 10 | -------------------------------------------------------------------------------- /debian/rancid-git.links: -------------------------------------------------------------------------------- 1 | var/log/rancid var/lib/rancid/logs 2 | usr/lib/rancid/bin var/lib/rancid/bin 3 | usr/lib/rancid/bin/rancid-run /usr/bin/rancid-run 4 | -------------------------------------------------------------------------------- /include/version.h: -------------------------------------------------------------------------------- 1 | #ifndef VERSION_H 2 | 3 | #define VERSION_H 4 | 5 | /* pkg version */ 6 | char package[] = "rancid"; 7 | char version[] = "2.3.9"; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /include/version.h.in: -------------------------------------------------------------------------------- 1 | #ifndef VERSION_H 2 | 3 | #define VERSION_H 4 | 5 | /* pkg version */ 6 | char package[] = "rancid"; 7 | char version[] = "2.3.9"; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /debian/rancid-cgi.logrotate: -------------------------------------------------------------------------------- 1 | /var/log/rancid/lg.log { 2 | create 0640 www-data www-data 3 | missingok 4 | weekly 5 | rotate 7 6 | compress 7 | delaycompress 8 | notifempty 9 | } 10 | -------------------------------------------------------------------------------- /rel-eng/packages/.readme: -------------------------------------------------------------------------------- 1 | the rel-eng/packages directory contains metadata files 2 | named after their packages. Each file has the latest tagged 3 | version and the project's relative directory. 4 | -------------------------------------------------------------------------------- /rel-eng/tito.props: -------------------------------------------------------------------------------- 1 | [globalconfig] 2 | default_builder = tito.builder.Builder 3 | default_tagger = tito.tagger.VersionTagger 4 | changelog_do_not_remove_cherrypick = 0 5 | changelog_format = %s (%ae) 6 | -------------------------------------------------------------------------------- /debian/rancid-git.cron.d: -------------------------------------------------------------------------------- 1 | # run config differ hourly 2 | #1 * * * * rancid /usr/bin/rancid-run 3 | # clean out config differ logs 4 | #50 23 * * * rancid find /var/log/rancid -type f -mtime +2 -exec rm {} \; 5 | -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | version=3 2 | 3 | opts=uversionmangle=s/\.(tar.*|tgz|zip|gz|bz2)$//i;s/a/~a/;s/rc/~rc/,pasv \ 4 | ftp://ftp.shrubbery.net/pub/rancid/rancid-(\d+[.0-9abrc]+)\.(tar.*|tgz|zip|gz|bz2|) debian uupdate 5 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | On Ubuntu/Debian: 2 | 3 | apt-get install debhelper dpatch expect build-essential autoconf \ 4 | automake 5 | 6 | cd rancid-git 7 | automake --add-missing 8 | autoreconf -fm 9 | dpkg-buildpackage -uc -rfakeroot 10 | cd .. 11 | dpkg -i rancid*.deb 12 | -------------------------------------------------------------------------------- /debian/rancid-git.preinst: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # preinst script for rancid 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # To remove old bad env link 9 | if [ -h /etc/rancid/env ]; then 10 | rm /etc/rancid/env 11 | fi 12 | 13 | 14 | # dh_installdeb will replace this with shell code automatically 15 | # generated by other debhelper scripts. 16 | 17 | #DEBHELPER# 18 | 19 | exit 0 20 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: c 3 | compiler: gcc 4 | before_install: 5 | - sudo apt-get update -qq 6 | install: 7 | - sudo apt-get install -y -qq expect perl openssh-client adduser perl inetutils-ping cvs subversion po-debconf telnet automake git passwd 8 | script: 9 | - autoreconf -fmi 10 | - ./configure 11 | - make 12 | - sudo make install 13 | branches: 14 | only: 15 | - master 16 | - integrate 17 | -------------------------------------------------------------------------------- /debian/rancid-cgi.preinst: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # preinst script for rancid 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # To remove old bad env link 9 | if [ -h /etc/rancid/lg.conf ]; then 10 | rm /etc/rancid/lg.conf 11 | fi 12 | if [ -e /etc/rancid/apache.conf ]; then 13 | rm /etc/rancid/apache.conf 14 | fi 15 | 16 | 17 | # dh_installdeb will replace this with shell code automatically 18 | # generated by other debhelper scripts. 19 | 20 | #DEBHELPER# 21 | 22 | exit 0 23 | -------------------------------------------------------------------------------- /share/index.html: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /bin/rugged: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect -f 2 | # This script tftp's into a host and retrieves the config file. 3 | # You need the expect package in order for this to work. 4 | 5 | # Assigns host variable from argument used with commit.sh 6 | set host [lindex $argv 0] 7 | 8 | # Establishes TFTP session. 9 | spawn tftp $host 10 | sleep 1 11 | 12 | # Expect the prompt "tftp>". 13 | expect "tftp>" 14 | sleep 1 15 | 16 | # Retrieve config file, rename it to the hostname and place it in this directory. 17 | send "get config.csv /var/lib/rancid/access/configs/$host.new\r" 18 | sleep 1 19 | send "quit" 20 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | rancid-git (2.3.9-5) unstable; urgency=low 2 | [ Egor Miadzvedzeu ] 3 | * Unofficial package 4 | * Added Huawei config 5 | 6 | -- Egor Miadzvedzeu Thu, 21 Jul 2016 15:38:26 -0400 7 | rancid-git (2.3.9-4) unstable; urgency=low 8 | 9 | [ Vincent Bernat ] 10 | * Unofficial package. 11 | 12 | [ Jesse Norell ] 13 | * Added support for Telco Systems T5C (telco) 14 | * Added support for ZyXel switches (zyxel) 15 | * Added support for pfSense (pfsense) 16 | * Added support for Ubiquiti EdgeSwitch (ubnt-es) 17 | * Added support for Ubiquiti AirOS radios and ToughSwitch (ubnt) 18 | * Updated looking glass (rancid-cgi). 19 | 20 | -- Vincent Bernat Sat, 13 Feb 2016 11:17:37 +0100 21 | -------------------------------------------------------------------------------- /debian/rancid-cgi.apache2: -------------------------------------------------------------------------------- 1 | # Minimal config to enable the RANCID based looking glass to function. 2 | # Do not run this wide open on the Internet! 3 | # Recommended that you configure this vhost with SSL and password protection. 4 | 5 | AddHandler cgi-script .cgi 6 | 7 | ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 8 | 9 | AllowOverride None 10 | Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 11 | Order allow,deny 12 | Allow from all 13 | 14 | 15 | Alias /lg/lgnotes.html /usr/share/doc/rancid-cgi/lgnotes.html 16 | 17 | Alias /lg /usr/lib/cgi-bin/lg 18 | 19 | AllowOverride None 20 | Options ExecCGI SymLinksIfOwnerMatch 21 | order deny,allow 22 | deny from all 23 | # Add your IP address here: 24 | allow from 127.0.0.1 25 | 26 | 27 | -------------------------------------------------------------------------------- /share/README.misc: -------------------------------------------------------------------------------- 1 | share/rancid includes some utilities that either don't seem to belong 2 | in (i.e.: not part of the core pkg), contributed sources, or 3 | sources included for convenience/example. 4 | 5 | README.misc This file. 6 | downreport Daily report of routers not listed as up in router.db 7 | getipacctg Get and sort show ip accounting output from cisco router 8 | rtrfilter Procmail mail filter for diffs 9 | 10 | --------------- 11 | rtrfilter can be used to filter rancid diffs to avoid sending unwanted 12 | diffs to certain recipient(s) or diffs which those recipient(s) should 13 | not see without the need to create separate or duplicate group(s). 14 | 15 | /etc/aliases e.g.: 16 | 17 | rancid-foo: engineering, 18 | customer-ops-foo 19 | # 20 | # only send diffs for the SJC routers (aka. *.sjc.shrubbery.net) 21 | customer-ops-foo: "| /usr/local/rancid/share/rancid/rtrfilter -i '\.sjc\.' -s 'sjc router diffs' customer-ops" 22 | # 23 | customer-ops: jimbob, 24 | sally 25 | -------------------------------------------------------------------------------- /debian/rancid-cgi.cron: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # /etc/cron.hourly/rancid-cgi: update rancid-cgi config files from rancid configuration 5 | # 6 | 7 | # destination filenames to be created 8 | CLOGINRC=/etc/rancid/cloginrc 9 | ROUTERDB=/etc/rancid/router.db 10 | OWNER='www-data:www-data' 11 | 12 | # this is an awk regex to select devices from router.db for matching vendors 13 | VENDOR_REGEX='cisco|juniper|foundry' 14 | 15 | # config source 16 | RANCID_DIR=`awk -F: '$1 ~ /^rancid$/ { print $6 }' /etc/passwd` 17 | 18 | if [ ! -d ${RANCID_DIR} ] 19 | then 20 | echo "Cannot determine rancid home directory, exiting." 2>&1 21 | exit 1 22 | fi 23 | 24 | if [ -f ${RANCID_DIR}/.cloginrc ] 25 | then 26 | cp ${RANCID_DIR}/.cloginrc ${CLOGINRC} 27 | chown ${OWNER} ${CLOGINRC} 28 | chmod 640 ${CLOGINRC} 29 | fi 30 | 31 | if (wc -l ${RANCID_DIR}/*/router.db 2>&1 >/dev/null) 32 | then 33 | awk -F: "\$2 ~ /${VENDOR_REGEX}/ { print \$0 }" ${RANCID_DIR}/*/router.db > ${ROUTERDB} 34 | chown ${OWNER} ${ROUTERDB} 35 | chmod 640 ${ROUTERDB} 36 | fi 37 | 38 | -------------------------------------------------------------------------------- /man/control_rancid.1: -------------------------------------------------------------------------------- 1 | .\" 2 | .hys 50 3 | .TH "control_rancid" "1" "5 October 2006" 4 | .SH NAME 5 | control_rancid \- run rancid for devices of a group 6 | .SH SYNOPSIS 7 | .B control_rancid 8 | [\fB\-V\fR] [\c 9 | .BI \-m\ \c 10 | mail_rcpt]\ \c 11 | [\c 12 | .BI \-r\ \c 13 | device_name]\ \c 14 | group 15 | .SH DESCRIPTION 16 | .B control_rancid 17 | is a 18 | .IR sh (1) 19 | script to parse a group's 20 | .BR router.db (5), 21 | run rancid for each of the devices, possibly re-run rancid for devices 22 | that failed collection, e-mail diffs, and e-mail error reports. 23 | .\" 24 | .PP 25 | .\" 26 | The command-line options are as follows: 27 | .TP 28 | .B \-V 29 | Prints package name and version strings. 30 | .TP 31 | .B \-m mail_rcpt 32 | Specify the recipient of diff mail, which is normally rancid-. The 33 | argument may be a single address, multiple comma separated addresses, or 34 | .B \-m 35 | may be specified multiple times. 36 | .\" 37 | .TP 38 | .B \-r device_name 39 | Specify the name, as it appears in the router.db, of a particular device 40 | to collect and generate diffs for. The device must be marked "up". 41 | .sp 42 | The 43 | .B \-r 44 | option alters the subject line of the diff mail. It will begin 45 | with / rather than just the group name alone. 46 | .\" 47 | .PP 48 | .B control_rancid 49 | is normally (and best) run via 50 | .BR rancid-run (1) 51 | which provides a locking mechanism on a group basis and saves output 52 | in a log file for each group. 53 | .\" 54 | .SH "SEE ALSO" 55 | .BR rancid-run (1), 56 | .BR rancid.conf (5), 57 | .BR router.db (5) 58 | -------------------------------------------------------------------------------- /man/rancid-cvs.1: -------------------------------------------------------------------------------- 1 | .\" 2 | .hys 50 3 | .TH "rancid-cvs" "1" "10 June 2013" 4 | .SH NAME 5 | rancid-cvs \- initialize CVS, Subversion or Git and rancid group files and 6 | directories 7 | .SH SYNOPSIS 8 | .B rancid-cvs 9 | [\fB\-V\fR] [group [group ...]] 10 | .SH DESCRIPTION 11 | .B rancid-cvs 12 | creates the directories and 13 | .BR router.db (5) 14 | for each rancid group and handles the revision control system (CVS, 15 | Subversion or Git) set-up. 16 | It must be run after installation and whenever a rancid group is added. 17 | .\" 18 | .PP 19 | .B rancid-cvs 20 | reads 21 | .BR rancid.conf (5) 22 | to configure itself, then proceeds with the initialization. 23 | First of the CVS, Subversion or Git repository, if necessary, and then for each 24 | of the rancid groups listed on the command-line or those in the variable 25 | .I LIST_OF_GROUPS 26 | from 27 | .BR rancid.conf (5), 28 | if the argument is omitted. 29 | .\" 30 | .PP 31 | Running 32 | .B rancid-cvs 33 | for groups which already exist will not cause problems. If the group's 34 | directory already exists, the import into the revision control system 35 | will be skipped, and if it's 36 | .BR router.db (5) 37 | already exists, it will not be altered. 38 | .\" 39 | .PP 40 | .\" 41 | The command-line options are as follows: 42 | .TP 43 | .B \-V 44 | Prints package name and version strings. 45 | .\" 46 | .PP 47 | The best method for adding groups is add the group name to 48 | .I LIST_OF_GROUPS 49 | in 50 | .BR rancid.conf (5), 51 | then run 52 | .B rancid-cvs. Do not create the directories manually, allow rancid-cvs 53 | to do it. 54 | .\" 55 | .SH "SEE ALSO" 56 | .BR cvs (1), 57 | .BR rancid.conf (5), 58 | .BR router.db (5), 59 | .BR svn (1), 60 | .BR git (1) 61 | -------------------------------------------------------------------------------- /README.git: -------------------------------------------------------------------------------- 1 | This file contains additional information regarding the use of Git with RANCID 2 | along with some suggested use cases. 3 | 4 | 5 | git v git-remote for RCSSYS 6 | --------------------------- 7 | git commits all changes to a local repository in $BASEDIR/var/.git 8 | 9 | git-remote will push the master branch to all remotes. You can have as many 10 | remotes as you like. Rancid will loop through and push to them all. There are 11 | a few things that need to be setup in order for this to work seamlessly. 12 | 13 | Perform these steps before running bin/rancid-run: 14 | 15 | 1) Add remotes to $BASEDIR/var 16 | 17 | git remote add [name] [url] 18 | Example: git remote add origin git@gitlab.acme.com:user/rancit.git 19 | 20 | 2) Generate SSH keys for the rancid user and place the public key on the 21 | remote for silent pushing via ssh. 22 | 23 | ssh-keygen -t rsa 24 | cat ~/.ssh/id_rsa.pub | \ 25 | ssh git@gitlab.acme.com "cat - >> ~/.ssh/authorized_keys" 26 | 27 | Or simply copy and paste the contents of ~/.ssh/id_rsa.pub to the 28 | authorized_keys file or the web interface on the remote (if you are 29 | using GitLab or the like). 30 | 31 | 3) Perform inital push to each remote 32 | 33 | git push -u [remote name] master 34 | 35 | 4) Set $RCSSYS to git-remote in $BASEDIR/etc/rancid.conf 36 | If there are no remotes configured and $RCRSYS is set to git-remote, 37 | rancid will behave as if there are no remotes and only commit to 38 | the local repo in $BASEDIR/var/.git. 39 | 40 | 41 | git-remote Use Cases 42 | -------------------- 43 | 44 | ---- Distributed Collectors ---- 45 | 46 | ---- Distributed "Central" Repositories ---- 47 | 48 | 49 | -------------------------------------------------------------------------------- /debian/rancid-cgi.postinst: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # postinst script for rancid-cgi 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | . /usr/share/debconf/confmodule 9 | db_version 2.0 10 | 11 | # summary of how this script can be called: 12 | # * `configure' 13 | # * `abort-upgrade' 14 | # * `abort-remove' `in-favour' 15 | # 16 | # * `abort-deconfigure' `in-favour' 17 | # `removing' 18 | # 19 | # for details, see http://www.debian.org/doc/debian-policy/ or 20 | # the debian-policy package 21 | # 22 | # quoting from the policy: 23 | # Any necessary prompting should almost always be confined to the 24 | # post-installation script, and should be protected with a conditional 25 | # so that unnecessary prompting doesn't happen if a package's 26 | # installation fails and the `postinst' is called with `abort-upgrade', 27 | # `abort-remove' or `abort-deconfigure'. 28 | 29 | 30 | 31 | case "$1" in 32 | configure) 33 | if [ -d /var/log/rancid ]; then 34 | touch /var/log/rancid/lg.log 35 | chown www-data:www-data /var/log/rancid/lg.log 36 | fi 37 | if [ -d /var/cache/rancid ]; then 38 | chown www-data:www-data /var/cache/rancid 39 | fi 40 | ;; 41 | 42 | abort-upgrade|abort-remove|abort-deconfigure) 43 | 44 | ;; 45 | 46 | *) 47 | echo "postinst called with unknown argument \`$1'" >&2 48 | exit 1 49 | ;; 50 | esac 51 | 52 | 53 | db_stop 54 | 55 | # dh_installdeb will replace this with shell code automatically 56 | # generated by other debhelper scripts. 57 | 58 | #DEBHELPER# 59 | 60 | exit 0 61 | 62 | 63 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | ## A Makefile.in is supplied, in case you do not have automake. 3 | 4 | ## $Id: Makefile.am 2286 2011-02-16 18:27:13Z heas $ 5 | ## 6 | ## Copyright (C) 1997-2008 by Terrapin Communications, Inc. 7 | ## All rights reserved. 8 | ## 9 | ## This software may be freely copied, modified and redistributed 10 | ## without fee for non-commerical purposes provided that this license 11 | ## remains intact and unmodified with any RANCID distribution. 12 | ## 13 | ## There is no warranty or other guarantee of fitness of this software. 14 | ## It is provided solely "as is". The author(s) disclaim(s) all 15 | ## responsibility and liability with respect to this software's usage 16 | ## or its effect upon hardware, computer systems, other software, or 17 | ## anything else. 18 | ## 19 | ## Except where noted otherwise, rancid was written by and is maintained by 20 | ## Henry Kilmer, John Heasley, Andrew Partan, and Pete Whiting. 21 | ## 22 | 23 | AUTOMAKE_OPTIONS=foreign no-dependencies 24 | 25 | @SET_MAKE@ 26 | 27 | pkgdata_DATA = COPYING CHANGES FAQ README README.git README.lg UPGRADING cloginrc.sample 28 | EXTRA_DIST = BUGS Todo configure install-sh \ 29 | mkinstalldirs Makefile.in Todo $(pkgdata_DATA) 30 | #DIST_COMMON = 31 | 32 | # '.' is here (and at the beginnging of the macro) so that distclean-recursive 33 | # will run make distclean in . after the other dirs (preserving Makefile) and 34 | # mkinstalldirs will create the install destination before descending into 35 | # the subdirs. 36 | SUBDIRS = . include etc bin man share 37 | 38 | # sysconfdir is here because etc/Makefile uses a script to be careful about 39 | # installing rancid.conf, not over-writing an existing one. 40 | DIRS2_CREATE=$(DESTDIR)$(prefix) $(DESTDIR)$(sysconfdir) 41 | if MK_LCLSTATEDIR 42 | DIRS2_CREATE+=$(DESTDIR)$(localstatedir) 43 | endif 44 | install-data-hook: 45 | $(mkinstalldirs) $(DIRS2_CREATE); 46 | 47 | distclean-local: 48 | -rm -rf $(top_srcdir)/autom4te.cache 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build-stamp 2 | *.log 3 | *.substvars 4 | *.tar.gz 5 | patch-stamp 6 | debian/files 7 | debian/rancid-cgi/ 8 | debian/rancid-core/ 9 | debian/rancid-util/ 10 | debian/rancid.postrm.debhelper 11 | debian/rancid/ 12 | debian/rancid-git/ 13 | Makefile 14 | aclocal.m4 15 | autom4te.cache/ 16 | bin/.deps/ 17 | bin/Makefile 18 | bin/agmrancid 19 | bin/alogin 20 | bin/arancid 21 | bin/arrancid 22 | bin/avologin 23 | bin/avorancid 24 | bin/blogin 25 | bin/brancid 26 | bin/brocaderancid 27 | bin/cat5rancid 28 | bin/clogin 29 | bin/control_rancid 30 | bin/cssrancid 31 | bin/dlogin 32 | bin/drancid 33 | bin/elogin 34 | bin/erancid 35 | bin/f10rancid 36 | bin/f5rancid 37 | bin/flogin 38 | bin/fnrancid 39 | bin/francid 40 | bin/hlogin 41 | bin/hpuifilter 42 | bin/hpuifilter.o 43 | bin/hrancid 44 | bin/htlogin 45 | bin/htrancid 46 | bin/jerancid 47 | bin/jlogin 48 | bin/jrancid 49 | bin/lg.cgi 50 | bin/lgform.cgi 51 | bin/mrancid 52 | bin/mrvlogin 53 | bin/mrvrancid 54 | bin/mtlogin 55 | bin/mtrancid 56 | bin/nlogin 57 | bin/nrancid 58 | bin/nslogin 59 | bin/nsrancid 60 | bin/nxrancid 61 | bin/par 62 | bin/prancid 63 | bin/pflogin 64 | bin/pfrancid 65 | bin/rancid 66 | bin/rancid-cvs 67 | bin/rancid-fe 68 | bin/rancid-run 69 | bin/rancid_par 70 | bin/rivlogin 71 | bin/rivrancid 72 | bin/rrancid 73 | bin/shelllogin 74 | bin/shellrancid 75 | bin/srancid 76 | bin/tlogin 77 | bin/telcorancid 78 | bin/tntlogin 79 | bin/tntrancid 80 | bin/trancid 81 | bin/ubnt-es-rancid 82 | bin/ucsrancid 83 | bin/urancid 84 | bin/xrancid 85 | bin/xrrancid 86 | bin/zrancid 87 | bin/zyrancid 88 | config.status 89 | etc/Makefile 90 | etc/lg.conf.sample 91 | etc/rancid.conf.sample 92 | include/Makefile 93 | include/config.h 94 | include/stamp-h1 95 | man/Makefile 96 | man/lg.conf.5 97 | man/lg_intro.1 98 | man/rancid.conf.5 99 | share/Makefile 100 | share/downreport 101 | share/rancid-cvspurge 102 | share/rtrfilter 103 | bin/fnlogin 104 | include/version.h 105 | 106 | 107 | -------------------------------------------------------------------------------- /debian/rancid-git.postinst: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # postinst script for rancid 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | . /usr/share/debconf/confmodule 9 | db_version 2.0 10 | 11 | # summary of how this script can be called: 12 | # * `configure' 13 | # * `abort-upgrade' 14 | # * `abort-remove' `in-favour' 15 | # 16 | # * `abort-deconfigure' `in-favour' 17 | # `removing' 18 | # 19 | # for details, see http://www.debian.org/doc/debian-policy/ or 20 | # the debian-policy package 21 | # 22 | # quoting from the policy: 23 | # Any necessary prompting should almost always be confined to the 24 | # post-installation script, and should be protected with a conditional 25 | # so that unnecessary prompting doesn't happen if a package's 26 | # installation fails and the `postinst' is called with `abort-upgrade', 27 | # `abort-remove' or `abort-deconfigure'. 28 | 29 | 30 | 31 | case "$1" in 32 | configure) 33 | # change wrong shell /bin/false for user rancid to /bin/bash: 34 | case "`getent passwd rancid`" in 35 | *:/bin/false) 36 | usermod -s /bin/bash rancid 37 | ;; 38 | esac 39 | 40 | if ! `getent passwd rancid >/dev/null`; then 41 | adduser --system --group --home /var/lib/rancid --gecos "RANCID,,," --quiet \ 42 | --shell /bin/bash rancid 43 | fi 44 | if [ -d /var/log/rancid ]; then 45 | chown rancid:rancid /var/log/rancid 46 | fi 47 | if [ -d /var/lib/rancid ]; then 48 | chown rancid:rancid /var/lib/rancid 49 | fi 50 | ;; 51 | 52 | abort-upgrade|abort-remove|abort-deconfigure) 53 | 54 | ;; 55 | 56 | *) 57 | echo "postinst called with unknown argument \`$1'" >&2 58 | exit 1 59 | ;; 60 | esac 61 | 62 | 63 | db_stop 64 | 65 | # dh_installdeb will replace this with shell code automatically 66 | # generated by other debhelper scripts. 67 | 68 | #DEBHELPER# 69 | 70 | exit 0 71 | 72 | 73 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: rancid-git 2 | Section: net 3 | Priority: optional 4 | Maintainer: Roland Rosenfeld 5 | Build-Depends: automake, 6 | autotools-dev, 7 | cvs, 8 | debhelper (>= 9), 9 | dh-autoreconf, 10 | exim4 | mail-transport-agent, 11 | expect, 12 | iputils-ping | ping, 13 | openssh-client, 14 | perl, 15 | po-debconf, 16 | telnet 17 | Standards-Version: 3.9.6 18 | Homepage: http://www.shrubbery.net/rancid/ 19 | 20 | Package: rancid-git 21 | Architecture: any 22 | Depends: adduser, 23 | cvs | subversion | git, 24 | debconf (>= 0.2.26) | debconf-2.0, 25 | exim4 | mail-transport-agent, 26 | expect, 27 | iputils-ping | ping, 28 | libperl4-corelibs-perl | perl (<< 5.12.3-7), 29 | openssh-client | ssh, 30 | passwd, 31 | perl, 32 | ${misc:Depends}, 33 | ${perl:Depends}, 34 | ${shlibs:Depends} 35 | Suggests: diffstat 36 | Provides: rancid, rancid-core, rancid-util 37 | Replaces: rancid-core (<< 2.3.5), rancid-util (<< 2.3.5) 38 | Breaks: rancid-core (<< 2.3.5), rancid-util (<< 2.3.5) 39 | Conflicts: par, rancid 40 | Description: Really Awesome New Cisco confIg Differ 41 | This is a popular ISP toolkit, based on expect and shell scripts, 42 | for managing router configurations. 43 | . 44 | Rancid monitors a router's (or device's) configuration, including 45 | software and hardware (cards, serial numbers, etc), using CVS, 46 | Subversion or Git. 47 | 48 | Package: rancid-cgi 49 | Architecture: all 50 | Depends: liblockfile-simple-perl, rancid-git, ${misc:Depends}, ${perl:Depends} 51 | Suggests: apache2 | httpd-cgi 52 | Description: looking glass CGI for rancid 53 | This is a popular ISP toolkit, based on expect and shell scripts, 54 | for managing router configurations. 55 | Rancid monitors a router's (or device's) configuration, including 56 | software and hardware (cards, serial numbers, etc), using CVS. 57 | Rancid currently supports Cisco routers, Juniper routers, Catalyst 58 | switches, Foundry switches, Redback NASs, and ADC EZT3 muxes. 59 | This is the cgi package, a modified version of lg (Looking Glass) 60 | provided from rancid team to check rancid through web interface too. 61 | -------------------------------------------------------------------------------- /man/lg_intro.1.in: -------------------------------------------------------------------------------- 1 | .\" 2 | .hys 50 3 | .TH "lg_intro" "1" "24 Jan 2001" 4 | .SH NAME 5 | lg_intro \- introduction to the looking glass 6 | .\" 7 | .SH INTRODUCTION 8 | The 9 | .B looking glass 10 | offers a web based interface to routers to users without their needing 11 | permission to login to the router. This may be a perfect interface for customer 12 | support or less savvy folks, and many ISPs have given public access to such 13 | an interface as a "route server." 14 | .\" 15 | .SH DESCRIPTION 16 | The looking glass consists of two CGI 17 | .BR perl (1) 18 | scripts, 19 | .IR lg.cgi 20 | and 21 | .IR lgform.cgi , 22 | and the 23 | .BR lg.conf (5) 24 | configuration file. 25 | .PP 26 | Both of these scripts begin with reading the configuration file. If 27 | there is an error in the file's syntax or if the file can not be found, error 28 | messages will be displayed on standard-error. The Apache http server 29 | redirects standard-error to its error log file by default. 30 | .PP 31 | lgform.cgi displays a html form consisting of a list of possible 32 | router commands that can be run and a scrolling list of routers that 33 | these commands may be run on. When the form is submitted, lg.cgi is 34 | run. 35 | .PP 36 | lg.cgi begins by performing some basic checks on the 37 | arguments passed to it. If these checks pass, lg.cgi either displays 38 | cached data from a previous invocation, if that data exists and is 39 | within the cache interval, or uses 40 | .BR clogin (1) 41 | to login to the device and execute the command. The 42 | results of the command are cached if applicable and displayed for the 43 | user. 44 | .\" 45 | .SH "GETTING STARTED" 46 | Besides 47 | .BR lg.conf (5), 48 | additional instructions for setting up the looking glass can be found 49 | in the README file under 50 | .IR @pkgdatadir@/README.lg . 51 | .PP 52 | Note that the looking glass scripts require a few perl modules not 53 | included with rancid. Rancid's configure process does not check for 54 | these. See the README file. 55 | .\" 56 | .SH "SEE ALSO" 57 | .BR cloginrc (5), 58 | .BR clogin (1), 59 | .BR lg.conf (5) 60 | .SH HISTORY 61 | Rancid's looking glass is based on Ed Kern's (included by permission, 62 | thanks Ed!), which could once be found on http://nitrous.digex.net/ but 63 | has apparently been removed. Support for Juniper and Foundry devices, 64 | use of rancid's device login scripts, and additional commands and checks 65 | have been added to the original. 66 | -------------------------------------------------------------------------------- /debian/README.Debian: -------------------------------------------------------------------------------- 1 | rancid for Debian 2 | ----------------- 3 | 4 | The main rancid package is divided in two subpackages to separate 5 | the core from the cgi looking glass web interface. 6 | 7 | The user 'rancid' is automatically created. 8 | 9 | In /etc/rancid you can find rancid.conf and lg.conf (if rancid-cgi is 10 | installed) to configure them as you wish. 11 | 12 | rancid Looking Glass 13 | -------------------- 14 | 15 | The looking glass is a basic web interface to gathering some common 16 | information from your routers, it is not an interface to browse the 17 | router config files rancid gathers, nor in any way interfaces with rancid. 18 | It does use rancid's cloginrc and router.db file format, as well as 19 | rancid's login scripts (clogin and friends), so you can configure lg 20 | access to your routers with: 21 | 22 | cp /var/lib/rancid/.cloginrc /etc/rancid/cloginrc 23 | chown www-data:www-data /etc/rancid/cloginrc 24 | chmod 640 /etc/rancid/cloginrc 25 | 26 | awk -F: '$2 ~ /cisco|juniper|foundry/ { print $0 }' /var/lib/rancid/*/router.db > /etc/rancid/router.db 27 | chown www-data:www-data /etc/rancid/router.db 28 | chmod 640 /etc/rancid/router.db 29 | 30 | In /usr/share/doc/rancid-cgi/examples/ you can find an apache2 config 31 | example to either copy to your apache's conf.d directory, or to 32 | include in a virtual host definition, which will enable the lg cgi view 33 | (allowed by default from localhost, add your own IP's as needed). 34 | 35 | There is also a script in the examples/ directory to copy rancid's 36 | configuration (accessible by the rancid user) to the looking glass's 37 | config files (accessible as www-data) - ie. basically run the above 38 | commands - which you can run manually or copy to /etc/cron.hourly/ to 39 | keep the looking glass config updated with rancid's config. 40 | 41 | The looking glass should be considered an internal administrative tool, 42 | it is not fit for open access from the Internet. It would be advisable 43 | to protect access to it by IP (and passwords), and access it over SSL. 44 | 45 | 46 | Troubleshooting 47 | --------------- 48 | 49 | ** a note from Colin Whittaker 50 | 51 | if you find problem on session hanging try setting 52 | NOPIPE=YES; export NOPIPE 53 | in /etc/rancid/rancid.conf 54 | 55 | ** 56 | 57 | 58 | Credits 59 | ------- 60 | 61 | Samuele Giovanni Tonon Sun Mar 28 15:47:07 CEST 2004 62 | Roland Rosenfeld 63 | $Id: README.Debian,v 1.5 2009-02-15 19:35:07 roland Exp $ 64 | 65 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | ## Copyright (c) 1997-2010 by Terrapin Communications, Inc. 2 | ## All rights reserved. 3 | ## 4 | ## This code is derived from software contributed to and maintained by 5 | ## Terrapin Communications, Inc. by Henry Kilmer, John Heasley, Andrew Partan, 6 | ## Pete Whiting, Austin Schutz, and Andrew Fort. 7 | ## 8 | ## Redistribution and use in source and binary forms, with or without 9 | ## modification, are permitted provided that the following conditions 10 | ## are met: 11 | ## 1. Redistributions of source code must retain the above copyright 12 | ## notice, this list of conditions and the following disclaimer. 13 | ## 2. Redistributions in binary form must reproduce the above copyright 14 | ## notice, this list of conditions and the following disclaimer in the 15 | ## documentation and/or other materials provided with the distribution. 16 | ## 3. All advertising materials mentioning features or use of this software 17 | ## must display the following acknowledgement: 18 | ## This product includes software developed by Terrapin Communications, 19 | ## Inc. and its contributors for RANCID. 20 | ## 4. Neither the name of Terrapin Communications, Inc. nor the names of its 21 | ## contributors may be used to endorse or promote products derived from 22 | ## this software without specific prior written permission. 23 | ## 5. It is requested that non-binding fixes and modifications be contributed 24 | ## back to Terrapin Communications, Inc. 25 | ## 26 | ## THIS SOFTWARE IS PROVIDED BY Terrapin Communications, INC. AND CONTRIBUTORS 27 | ## ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 28 | ## TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 29 | ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COMPANY OR CONTRIBUTORS 30 | ## BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31 | ## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 32 | ## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 33 | ## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 34 | ## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 35 | ## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36 | ## POSSIBILITY OF SUCH DAMAGE. 37 | # 38 | # The expect login scripts were based on Erik Sherk's gwtn, by permission. 39 | # 40 | # The original looking glass software was written by Ed Kern, provided by 41 | # permission and modified beyond recognition. 42 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # 3 | # (c) 2007-2013 Roland Rosenfeld , based on 4 | # 5 | # Uncomment this to turn on verbose mode. 6 | #export DH_VERBOSE=1 7 | #export DH_OPTIONS=-v 8 | 9 | # These are used for cross-compiling and for saving the configure script 10 | # from having to guess our platform (since we know it already) 11 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) 12 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) 13 | 14 | %: 15 | dh $@ --with autotools_dev --with autoreconf 16 | 17 | override_dh_auto_configure: 18 | aclocal 19 | autoconf 20 | autoheader 21 | automake --add-missing 22 | dh_auto_configure -- \ 23 | --host=$(DEB_HOST_GNU_TYPE) \ 24 | --build=$(DEB_BUILD_GNU_TYPE) \ 25 | --prefix=/ \ 26 | --mandir=\$${prefix}usr/share/man \ 27 | --infodir=\$${prefix}usr/share/info \ 28 | --datadir=\$${prefix}var/lib \ 29 | --sysconfdir=\$${prefix}etc/rancid \ 30 | --exec-prefix=\$${prefix}usr/lib/rancid \ 31 | --localstatedir=\$${prefix}var/lib/rancid \ 32 | --libdir=\$${prefix}usr/share/perl5 \ 33 | --with-git 34 | 35 | override_dh_auto_install: 36 | $(MAKE) install prefix=$(CURDIR)/debian/rancid-git/ \ 37 | pkgdata_DATA='' dist_pkgdata_DATA='' 38 | 39 | mv debian/rancid-git/usr/lib/rancid/bin/lg.cgi \ 40 | debian/rancid-cgi/usr/lib/cgi-bin/lg/; \ 41 | mv debian/rancid-git/usr/lib/rancid/bin/lgform.cgi \ 42 | debian/rancid-cgi/usr/lib/cgi-bin/lg/; \ 43 | mv debian/rancid-git/etc/rancid/lg.conf \ 44 | debian/rancid-cgi/etc/rancid/; \ 45 | sed -ri 's|(#\$$LG_CACHE_DIR="\./tmp";)|\1\n\$$LG_CACHE_DIR="/var/cache/rancid-cgi";|' \ 46 | debian/rancid-cgi/etc/rancid/lg.conf; \ 47 | sed -ri 's|(#\$$LG_LOG="local0";)|\1\n\$$LG_LOG="/var/log/rancid/lg.log";|' \ 48 | debian/rancid-cgi/etc/rancid/lg.conf; \ 49 | sed -ri 's|(#\$$LG_CLOGINRC="\$$ENV\(HOME\)/.cloginrc";)|\1\n\$$LG_CLOGINRC="/etc/rancid/cloginrc";|' \ 50 | debian/rancid-cgi/etc/rancid/lg.conf; \ 51 | sed -ri 's|#(\$$LG_ROUTERDB="/etc/rancid/router.db";)|\1|' \ 52 | debian/rancid-cgi/etc/rancid/lg.conf; \ 53 | mv debian/rancid-git/usr/share/man/man1/lg_intro.1 \ 54 | debian/rancid-cgi/usr/share/man/man1/; \ 55 | mv debian/rancid-git/usr/share/man/man5/lg.conf.5 \ 56 | debian/rancid-cgi/usr/share/man/man5/; \ 57 | install -m644 share/index.html \ 58 | debian/rancid-cgi/usr/lib/cgi-bin/lg/; \ 59 | 60 | override_dh_clean: 61 | rm -f config.log 62 | [ ! -f Makefile ] || $(MAKE) distclean 63 | dh_clean 64 | 65 | override_dh_installchangelogs: 66 | dh_installchangelogs -k CHANGES 67 | 68 | override_dh_compress: 69 | dh_compress -X.pdf 70 | 71 | override_dh_auto_test: 72 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: RANCID 3 | Source: http://dotwaffle.github.io/rancid-git/ 4 | 5 | Files: * 6 | Copyright: Copyright (c) 1997-2010 by Terrapin Communications, Inc. 7 | License: BSD-4-clause 8 | All rights reserved. 9 | . 10 | This code is derived from software contributed to and maintained by 11 | Terrapin Communications, Inc. by Henry Kilmer, John Heasley, Andrew Partan, 12 | Pete Whiting, Austin Schutz, and Andrew Fort. 13 | . 14 | Redistribution and use in source and binary forms, with or without 15 | modification, are permitted provided that the following conditions 16 | are met: 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 3. All advertising materials mentioning features or use of this software 23 | must display the following acknowledgement: 24 | This product includes software developed by Terrapin Communications, 25 | Inc. and its contributors for RANCID. 26 | 4. Neither the name of Terrapin Communications, Inc. nor the names of its 27 | contributors may be used to endorse or promote products derived from 28 | this software without specific prior written permission. 29 | 5. It is requested that non-binding fixes and modifications be contributed 30 | back to Terrapin Communications, Inc. 31 | . 32 | THIS SOFTWARE IS PROVIDED BY Terrapin Communications, INC. AND CONTRIBUTORS 33 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 34 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 35 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COMPANY OR CONTRIBUTORS 36 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 37 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 38 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 39 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 40 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 41 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | . 44 | The expect login scripts were based on Erik Sherk's gwtn, by permission. 45 | . 46 | The original looking glass software was written by Ed Kern, provided by 47 | permission and modified beyond recognition. 48 | -------------------------------------------------------------------------------- /share/lgnotes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | Looking Glass Notes 8 | 9 | 10 |    Looking Glass Notes 12 |

13 |
14 |

15 |

    16 | Just a few straight forward notes on our implementation of 17 | Ed Kern's looking glass (which was http://nitrous.digex.net). 18 |
19 |

20 |

21 |

    22 |
  • Some items are not implemented for the junipers/foundrys yet (so, as i get 23 | to it) or no equivalent command exists. 24 |
  • If there is something which you feel is missing, feel free to ask 25 | and/or send comments to 26 | rancid@shrubbery.net. No guarantees.
  • 27 |
  • Only one query per router allowed at any given time. This is to avoid 28 | resource deprivation on the looking glass host or the router. The 29 | looking glass will attempt to serialize queries.
  • 30 |
  • The looking glass will ping a router prior to querying it to avoid 31 | trying to query routers which are down or otherwise inaccessible.
  • 32 |
  • Login failures can be intermittent or permanent, either due to the 33 | router being inaccessible from the looking glass machine, 34 | or authorization failure(s). Contact your local network engineering 35 | folks to resolve login failures.
  • 36 |
  • Queries followed by <something> require an argument(s) in the text 37 | window below the query list. Some queries take optional arguments 38 | denoted by [something]. Multiple arguments should be separated by a 39 | space.
  • 40 |
  • Note that output from certain queries is cached by the server and may 41 | be slightly out of date. These queries will be noted as such in the 42 | output. This is limited to queries which could produce lots of output, 43 | such as 'sh ip bgp dampened-paths'.
  • 44 |
  • Note that some queries have potential to produce great load on the router 45 | and produce lots of output, such as 'sh ip bgp' or 'sh ip bgp reg '^3561'. 46 | The looking glass attempts to deny such commands.
  • 47 |
48 |

49 | Some useful hints: 50 |

    51 |
  • Show interfaces can take arguments other than an interface name, assuming 52 | the router is running an O/S version with the capability. For example; a 53 | cisco can take 'descriptions' or 'brief' and 'terse' for the juniper.
  • 54 |
  • Show ip bgp neighbor can take additional arguments (if configured to allow 55 | it), such as 'advertised routes', 'flap-statistics', 'received-routes', 56 | and 'routes'. The argument will be converted for the platform.
  • 57 |
58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /man/par.1: -------------------------------------------------------------------------------- 1 | .\" 2 | .hys 50 3 | .TH "rancid_par" "1" "18 December 2007" 4 | .SH NAME 5 | rancid_par \- parallel command processing 6 | .SH SYNOPSIS 7 | .B rancid_par 8 | [\fB\-dfiqx\fP] 9 | [\c 10 | .BI \-c\ 11 | command] 12 | [\c 13 | .BI \-l\ 14 | logfile] 15 | [\c 16 | .BI \-n\c 17 | #] 18 | file 19 | [file...] 20 | .SH DESCRIPTION 21 | .B rancid_par 22 | takes a list of files to run a command on. The first line of each file begins 23 | with a colon (:) or a pound-sign (#). If a colon, the remainder of the 24 | line is a command to run for each of the subsequent lines. If a pound-sign, 25 | then each subsequent line is a (self-contained) command, unless the 26 | .B \-c 27 | option was specified, in which case it operates as if the argument to 28 | .B \-c 29 | had followed a colon on the first line. 30 | .PP 31 | In each of the cases where the lines of the file following the first are 32 | not commands (i.e.: colon or \-c), instances of open-close braces ({}) in the 33 | command will be replaced by these values. 34 | .PP 35 | For example, a inputfile whose contents is: 36 | .sp 37 | : echo {} 38 | .br 39 | a 40 | .br 41 | b 42 | .br 43 | c 44 | .sp 45 | run with 46 | .B rancid_par 47 | like so: 48 | .sp 49 | %rancid_par \-q inputfile 50 | .sp 51 | will produce the following output (order will vary): 52 | .sp 53 | b 54 | .br 55 | a 56 | .br 57 | c 58 | .PP 59 | The command-line options are as follows: 60 | .PP 61 | .TP 62 | .B \-c 63 | Command to be run on each of the arguments following the command-line 64 | options, where the first line of the input file(s) begins with a pound-sign 65 | (#). 66 | .\" 67 | .TP 68 | .B \-d 69 | Print debugging information on standard error (stderr). 70 | .\" 71 | .TP 72 | .B \-f 73 | No file or STDIN, just run a quantity of the command specified with \-c. 74 | .\" 75 | .TP 76 | .B \-i 77 | Run commands interactively through (multiple) 78 | .BR xterm (1) 79 | processes. 80 | .\" 81 | .TP 82 | .B \-l 83 | Prefix of logfile name, as in prefix.N where N is the 84 | .B rancid_par 85 | process number ([0..]). 86 | .sp 87 | Default: par.log.