README.md in oxidized-0.12.2 vs README.md in oxidized-0.13.0

- old
+ new

@@ -29,10 +29,11 @@ * [Privileged mode](#privileged-mode) * [Source: CSV](#source-csv) * [Source: SQLite](#source-sqlite) * [Source: HTTP](#source-http) * [Output: GIT](#output-git) + * [Output: HTTP](#output-http) * [Output: File](#output-file) * [Output types](#output-types) * [Advanced Configuration](#advanced-configuration) 7. [Ruby API](#ruby-api) * [Input](#input) @@ -68,17 +69,24 @@ * ASA * IOS * IOSXR * NXOS * SMB (Nikola series) + * Citrix + * NetScaler (Virtual Applicance) * Cumulus * Linux + * DataCom + * DmSwitch 3000 * DELL * PowerConnect * AOSW + * Ericsson/Redback + * IPOS (former SEOS) * Extreme Networks * XOS + * WM * F5 * TMOS * Force10 * DNOS * FTOS @@ -92,12 +100,16 @@ * Juniper * JunOS * ScreenOS (Netscreen) * Mikrotik * RouterOS + * Motorola + * RFS * MRV * MasterOS + * Netonix + * WISP Switch (As Netonix) * Opengear * Opengear * Palo Alto * PANOS * Ubiquiti @@ -119,11 +131,11 @@ ``` ## CentOS, Oracle Linux, Red Hat Linux version 6 Install Ruby 1.9.3 or greater (for Ruby 2.1.2 installation instructions see "Installing Ruby 2.1.2 using RVM"), then install Oxidized dependencies ```shell -yum install cmake sqlite-devel openssl-devel +yum install cmake sqlite-devel openssl-devel libssh2-devel ``` Now lets install oxidized via Rubygems: ```shell gem install oxidized @@ -134,10 +146,25 @@ Oxidized configuration is in YAML format. Configuration files are subsequently sourced from ```/etc/oxidized/config``` then ```~/.config/oxidized/config```. The hashes will be merged, this might be useful for storing source information in a system wide file and user specific configuration in the home directory (to only include a staff specific username and password). Eg. if many users are using ```oxs```, see [Oxidized::Script](https://github.com/ytti/oxidized-script). To initialize a default configuration in your home directory ```~/.config/oxidized/config```, simply run ```oxidized``` once. If you don't further configure anything from the output and source sections, it'll extend the examples on a subsequent ```oxidized``` execution. This is useful to see what options for a specific source or output backend are available. +You can set the env variable `OXIDIZED_HOME` to change its home directory. + +``` +OXIDIZED_HOME=/etc/oxidized + +$ tree -L 1 /etc/oxidized +/etc/oxidized/ +├── config +├── log-router-ssh +├── log-router-telnet +├── pid +├── router.db +└── repository.git +``` + ## Source Oxidized supports ```CSV```, ```SQLite``` and ```HTTP``` as source backends. The CSV backend reads nodes from a rancid compatible router.db file. The SQLite backend will fire queries against a database and map certain fields to model items. The HTTP backend will fire queries against a http/https url. Take a look at the [Cookbook](#cookbook) for more details. ## Outputs @@ -179,11 +206,11 @@ Install Ruby 2.1.2 build dependencies ``` yum install curl gcc-c++ patch readline readline-devel zlib zlib-devel yum install libyaml-devel libffi-devel openssl-devel make cmake -yum install bzip2 autoconf automake libtool bison iconv-devel +yum install bzip2 autoconf automake libtool bison iconv-devel libssh2-devel ``` Install RVM ``` curl -L get.rvm.io | bash -s stable @@ -281,20 +308,20 @@ enable: 4 ``` ### SSH Proxy Command -Oxidized can `ssh` through a proxy as well. To do so we just need to set `proxy` variable. +Oxidized can `ssh` through a proxy as well. To do so we just need to set `ssh_proxy` variable. ``` ... map: name: 0 model: 1 vars_map: enable: 2 - proxy: 3 + ssh_proxy: 3 ... ``` ### Source: SQLite @@ -352,19 +379,59 @@ ### Output: Git This uses the rugged/libgit2 interface. So you should remember that normal Git hooks will not be executed. + +For a single repositories for all devices: + +``` yaml +output: + default: git + git: + user: Oxidized + email: o@example.com + repo: "/var/lib/oxidized/devices.git" ``` + +And for groups repositories: + +``` yaml output: default: git git: user: Oxidized email: o@example.com + repo: + first: "/var/lib/oxidized/first.git" + second: "/var/lib/oxidized/second.git" +``` + +If you would like to use groups and a single repository, you can force this with the `single_repo` config. + +``` yaml +output: + default: git + git: + single_repo: true repo: "/var/lib/oxidized/devices.git" + ``` +### Output: Http + +POST a config to the specified URL + +``` +output: + default: http + http: + user: admin + password: changeit + url: "http://192.168.162.50:8080/db/coll" +``` + ### Output types If you prefer to have different outputs in different files and/or directories, you can easily do this by modifying the corresponding model. To change the behaviour for IOS, you would edit `lib/oxidized/model/ios.rb`. For example, let's say you want to split out `show version` and `show inventory` into separate files in a directory called `nodiff` which your tools will not send automated diffstats for. You can apply a patch along the lines of @@ -521,9 +588,45 @@ type: exec events: [post_store, node_fail] cmd: 'echo "Doing long running stuff for $OX_NODE_NAME" >> /tmp/ox_node_stuff.log; sleep 60' async: true timeout: 120 +``` + +### githubrepo + +This hook configures the repository `remote` and _push_ the code when the specified event is triggerd. If the `username` and `password` are not provided, the `Rugged::Credentials::SshKeyFromAgent` will be used. + +`githubrepo` hook recognizes following configuration keys: + + * `remote_repo`: the remote repository to be pushed to. + * `username`: username for repository auth. + * `password`: password for repository auth. + * `publickey`: publickey for repository auth. + * `privatekey`: privatekey for repository auth. + +When using groups repositories, each group must have its own `remote` in the `remote_repo` config. + +``` yaml +hooks: + push_to_remote: + remote_repo: + routers: git@git.intranet:oxidized/routers.git + switches: git@git.intranet:oxidized/switches.git + firewalls: git@git.intranet:oxidized/firewalls.git +``` + + +## Hook configuration example + +``` yaml +hooks: + push_to_remote: + type: githubrepo + events: [post_store] + remote_repo: git@git.intranet:oxidized/test.git + username: user + password: pass ``` # Ruby API The following objects exist in Oxidized.