Configuration-Repository
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:Archive configurations into source control
= Configuration Repository (CR)

== Description

Configuration Repository is a utility that leverages Git to help manage backing 
up remote or local text, usually in the form of configuration files. A driver 
is used to customize what is being archived. When a driver is not specified, 
SNMP is used to attempt to choose which driver is loaded based off the sysDescr.

Hosts can be added via a variety of methods such as CSV files, TXT files, zone
transfers via DNS, or individually specified on the command-line.

To ease locating files in the repository and to dictate the file structure of
the repository, Regular Expressions can be used.

== Features

* Host list support via DNS, CSV, TXT, or command line
* Repository file structure determined by Regex
* Device detection (Cisco, etc) via SNMP or by direct specification
* Extendable with additional host drivers

== Requirements

The following gems are required to use Configuration Repository:

* dnsruby
* git
* net-scp
* net-ssh >= 2.0.23
* rake
* saikuro_treemap (for ccn metrics)
* snmp

Note: The OpenSSL library for Ruby (libopenssl-ruby via apt for Ubuntu) must
be installed in order for net-ssh to function properly.

== Installing Configuration Repository

RubyGems is the preferred install method for Configuration Repository (CR). 
It is intended to be installed via the RubyGems[http://rubyforge.org/projects/rubygems/] 
system. To get the latest version, simply enter the following int your command 
prompt:

	$ sudo gem install CR-.gem

Prior to using CR, please make sure 'git' is available in your path and you
have installed the required lib OpenSSL package (if required, see above).

== Running from source

If you are developing for Configuration Repository and would like to run from
the source tree, run executables with:

	$ ruby -rubygems -I lib bin/crepo

==Examples

Run against a single host:
    crepo -r /path/to/repository -n host.domain.tld -u username -p password 

Run against multiple hosts with the same credentials:
    crepo -r /path/to/repository -n host.domain.tld -n host.domain.tld -u username -p password

Run against domains with different credentials:
    crepo -r /path/to/repository -d user1:pass1@domain1.tld -d user2:pass2@domain2.tld
 
Run against a txt file of host strings containing hosts:
    crepo -r /path/to/repository -N hostfile.txt -u user -p pass

Run against a CSV file of host strings containing domains:
    crepo -r /path/to/repository -D domainfile.csv -u user -p pass

Usernames and passwords can also be specified as part of the host string
within either file type allowing for greater flexiblility in environments
with varying credentials.

===CSV Columns:

	,,,,,

===Host Strings (URI):

Supports URIs beginning with convene:// or left omitted.

====Examples:
	convene://user:pass@device.domain.tld?driver=cisco
  
	:@
	
Username and password are optional. Omit '@' when listing only host or domain:

	user:password@host.domain.tld or host.domain.tld

Specify a driver in query notation and skip SNMP finger printing in any host string:

	host.domain.tld?driver=Cisco

==Drivers

There are generic drivers available for a small variety of networking devices
such as Cisco and Foundry. However, the real power lies in custom drivers. 

The preference in which drivers are loaded is:
 * Direct filename specifed in the URI.
 * User's '.convene/drivers/(filename).rb' in home directory
 * Drivers included with CR

Drivers overload the #config method of the Host class and are expected to return
a hash with the key being a filename and the value being an array containing
the text of that file.

==Regular Expressions

Regular experessions can be specified on the command-line with the -x  
flag. The overall match of the expression determines whether the host will be
added whereas sub-matches determine the file structure of the repository.

====Examples:

    -x /.*\.somedomain.tld/
    
This would add all hosts that match *.somedomain.tld and store the contents of
the files under the root repository directory in directories named after the
hostname of the device.

    -x /.*\.(somedomain.tld)/

Will add all hosts in the example above, however the contents would be stored in
the root repository directory in a directory named "somedomain.tld" then in a 
directory named after the hostname of the device. 

== Copyright

Copyright 2010 Andrew R. Greenwood and Jonathan P. Voss

本源码包内暂不包含可直接显示的源代码文件,请下载源码包。