From 81fc3a4b423d8ce9fe69def57007312a96db6f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20L=C3=B6nnemark?= Date: Tue, 19 Sep 2017 16:28:41 +0200 Subject: Add support for Supermicro SSE-G48-TG4 This model (and possibly others) runs an OS with a different set of commands than the Supermicro model that already exists. --- docs/Supported-OS-Types.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index e600040..f5352de 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -128,7 +128,8 @@ * Siklu * [EtherHaul](lib/oxidized/model/siklu.rb) * Supermicro - * [Supermicro](lib/oxidized/model/supermicro.rb) + * [Supermicro](lib/oxidized/model/supermicro.rb): Known to work with the Supermicro SSE-G2252. + * [Supermicro2](lib/oxidized/model/supermicro2.rb): Known to work with the Supermicro SSE-G48-TG4. * Symantec * [Blue Coat ProxySG / Security Gateway OS (SGOS)](lib/oxidized/model/sgos.rb) * Trango Systems -- cgit v1.2.1 From 77e5c874896e8f17aa32fa40b96196a8d2932ff5 Mon Sep 17 00:00:00 2001 From: Jason Ackley Date: Sat, 18 Nov 2017 03:57:16 -0600 Subject: docs: Misc Doc updates (#1107) * Move VRP-Huawei.md to new Model-Notes subdir * Update Sources.md with a few improvements: 1. Sync the example table name between the MySQL and SQLite example configs for consistency. 2. Document the very useful custom SQL query parameter (query:) including a couple of examples. * Basic README.md for Model-Notes directory with a simple table for notes/caveats * Markdown quote the Huawei config blocks and link back to README.md * Update Sources.md --- docs/Model-Notes/README.md | 17 +++++++++++++++++ docs/Model-Notes/VRP-Huawei.md | 34 ++++++++++++++++++++++++++++++++++ docs/Sources.md | 36 +++++++++++++++++++++++++++++++++--- docs/VRP-Huawei.md | 27 --------------------------- 4 files changed, 84 insertions(+), 30 deletions(-) create mode 100644 docs/Model-Notes/README.md create mode 100644 docs/Model-Notes/VRP-Huawei.md delete mode 100644 docs/VRP-Huawei.md (limited to 'docs') diff --git a/docs/Model-Notes/README.md b/docs/Model-Notes/README.md new file mode 100644 index 0000000..15ab445 --- /dev/null +++ b/docs/Model-Notes/README.md @@ -0,0 +1,17 @@ + + +Model Notes +======================== + + +This directory contains implemention notes and caveats to assist you in your oxidized deployment. + +Use the table below for more information on the Vendor/Model caveats. + + +Vendor | Model |Updated +----------------|-----------------|---------------- +Huawei|[VRP](VRP-Huawei.md)|17 Nov 2017 + + +If you discover additional caveats or problems please make sure to consult the [GitHub issues for oxidized](https://github.com/ytti/oxidized/issues) known issues. diff --git a/docs/Model-Notes/VRP-Huawei.md b/docs/Model-Notes/VRP-Huawei.md new file mode 100644 index 0000000..d03c752 --- /dev/null +++ b/docs/Model-Notes/VRP-Huawei.md @@ -0,0 +1,34 @@ +Huawei VRP Configuration +======================== + +Create a user with no privileges + +``` + system-view + [~HUAWEI] aaa + [~HUAWEI-aaa] local-user oxidized password irreversible-cipher verysecret + [*HUAWEI-aaa] local-user oxidized level 1 + [*HUAWEI-aaa] local-user oxidized service-type terminal ssh + [*HUAWEI-aaa] commit +``` + +The commands Oxidized executes are: + +1. screen-length 0 temporary +2. display version +3. display device +4. display current-configuration all + +Command 2 and 3 can be executed without issues, but 1 and 4 are only available for higher level users. Instead of making Oxidized a read/write user on your device, lower the priviledge-level for commands 1 and 4: + +``` + system-view + [~HUAWEI] command-privilege level 1 view global display current-configuration all + [*HUAWEI] command-privilege level 1 view shell screen-length + [*HUAWEI] commit +``` + +Oxidized can now retrieve your configuration! + + +Back to [Model-Notes](README.md) diff --git a/docs/Sources.md b/docs/Sources.md index 4121c89..0a6d1d7 100644 --- a/docs/Sources.md +++ b/docs/Sources.md @@ -61,8 +61,8 @@ source: default: sql sql: adapter: sqlite - database: "/var/lib/oxidized/devices.db" - table: devices + database: "/var/lib/oxidized/nodes.db" + table: nodes map: name: fqdn model: model @@ -72,6 +72,36 @@ source: enable: enable ``` +### Custom SQL Query Support + +You may also implement a custom SQL query to retreive the nodelist using SQL syntax with the `query:` configuration parameter under the `sql:` stanza. + + +#### Custom SQL Query Examples + +You may have a table named `nodes` which contains a boolean to indicate if the nodes should be enabled (fetched via oxidized). This can be used in the custom SQL query to avoid fetching from known impacted nodes. + +In your configuration, you would add the `query:` parameter and specify the SQL query. Make sure to put this within the `sql:` configuration section. + +```sql +query: "SELECT * FROM nodes WHERE enabled = True" +``` + +Since this is an SQL query, you can also provide a more advanced query to assist in more complicated oxidized deployments. The exact deployment is up to you on how you design your database and oxidized fetchers. + +In this example we limit the nodes to two "POPs" of `mypop1` and `mypop2`. We also require the nodes to have the `enabled` boolean set to `True`. + +```sql +query: "SELECT * FROM nodes WHERE pop IN ('mypop1','mypop2') AND enabled = True" +``` +The order of the nodes returned will influence the order that nodes are fetched by oxidized. You can use standard SQL `ORDER BY` clauses to influence the node order. + +You should always test your SQL query before using it in the oxidized configuration as there is no syntax or error checking performed before sending it to the database engine. + +Consult your database documentation for more information on query language and table optimization. + + + ### Source: HTTP One object per device. @@ -107,4 +137,4 @@ source: url: https://url/api scheme: https secure: false -``` \ No newline at end of file +``` diff --git a/docs/VRP-Huawei.md b/docs/VRP-Huawei.md deleted file mode 100644 index 9e97b7d..0000000 --- a/docs/VRP-Huawei.md +++ /dev/null @@ -1,27 +0,0 @@ -Huawei VRP Configuration -======================== - -Create a user with no privileges - - system-view - [~HUAWEI] aaa - [~HUAWEI-aaa] local-user oxidized password irreversible-cipher verysecret - [*HUAWEI-aaa] local-user oxidized level 1 - [*HUAWEI-aaa] local-user oxidized service-type terminal ssh - [*HUAWEI-aaa] commit - -The commands Oxidized executes are: - -1. screen-length 0 temporary -2. display version -3. display device -4. display current-configuration all - -Command 2 and 3 can be executed without issues, but 1 and 4 are only available for higher level users. Instead of making Oxidized a read/write user on your device, lower the priviledge-level for commands 1 and 4: - - system-view - [~HUAWEI] command-privilege level 1 view global display current-configuration all - [*HUAWEI] command-privilege level 1 view shell screen-length - [*HUAWEI] commit - -Oxidized can now retrieve your configuration! \ No newline at end of file -- cgit v1.2.1 From 115764f3b2d20b3732a8d81c38afaea19c11dad8 Mon Sep 17 00:00:00 2001 From: pv2b Date: Mon, 20 Nov 2017 09:16:44 +0100 Subject: feature: Added model information to exec hook (#1105) * Add OX_NODE_MODEL to exec hook * Update docs to reflect added OX_NODE_MSG to hook --- docs/Hooks.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/Hooks.md b/docs/Hooks.md index 7d503a3..fab4025 100644 --- a/docs/Hooks.md +++ b/docs/Hooks.md @@ -26,6 +26,7 @@ OX_NODE_IP OX_NODE_FROM OX_NODE_MSG OX_NODE_GROUP +OX_NODE_MODEL OX_JOB_STATUS OX_JOB_TIME OX_REPO_COMMITREF -- cgit v1.2.1 From 99220b9947946d5ad1e53cba6a343e942ce0c498 Mon Sep 17 00:00:00 2001 From: pv2b Date: Tue, 21 Nov 2017 09:03:48 +0100 Subject: model: Added support for Opnsense (#1111) * Add OPNsense model * Fix class name * Mention support for OPNsense in Supported OS types --- docs/Supported-OS-Types.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index 9176f2e..99566c4 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -117,6 +117,7 @@ * [OneOS](/lib/oxidized/model/oneos.rb) * Opengear * [Opengear](/lib/oxidized/model/opengear.rb) + * [OPNsense](/lib/oxidized/model/opnsense.rb) * Palo Alto * [PANOS](/lib/oxidized/model/panos.rb) * [PLANET SG/SGS Switches](/lib/oxidized/model/planet.rb) -- cgit v1.2.1 From c81881d2cd42f02b30bd36740745a78e6106afa8 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Tue, 21 Nov 2017 09:40:55 +0000 Subject: Update Sources.md --- docs/Sources.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/Sources.md b/docs/Sources.md index 0a6d1d7..b04261c 100644 --- a/docs/Sources.md +++ b/docs/Sources.md @@ -23,7 +23,7 @@ source: Example csv `/var/lib/oxidized/router.db`: ``` -rtr01.local,192.168.1.1,ios,oxidized,5uP3R53cR3T,T0p53cR3t +rtr01.local:192.168.1.1:ios:oxidized:5uP3R53cR3T:T0p53cR3t ``` ### Source: SQL -- cgit v1.2.1 From da8923512737f0d9383feaebaf43e781e914b71e Mon Sep 17 00:00:00 2001 From: Michael Baker Date: Thu, 23 Nov 2017 06:18:41 +0800 Subject: fix: GPG bug fix when loading file (#1109) * GPG bug fix * Update Sources.md * Update README.md --- docs/Sources.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'docs') diff --git a/docs/Sources.md b/docs/Sources.md index b04261c..7029b72 100644 --- a/docs/Sources.md +++ b/docs/Sources.md @@ -26,6 +26,31 @@ Example csv `/var/lib/oxidized/router.db`: rtr01.local:192.168.1.1:ios:oxidized:5uP3R53cR3T:T0p53cR3t ``` +If you would like to use a GPG encrypted file as the source then you can use the following example: + +```yaml +source: + default: csv + csv: + file: ~/.config/oxidized/router.db + delimiter: !ruby/regexp /:/ + gpg: true + gpg_password: 'password' + map: + name: 0 + model: 1 +``` + +> Please note, if you are running GPG v2 then you will be prompted for your gpg password on start up, if you use GPG >= 2.1 then you can add the following config to stop that behaviour: + +> Within `~/.gnupg/gpg-agent.conf` + +> `allow-loopback-pinentry` + +> and within: `~/.gnupg/gpg.conf` + +> `pinentry-mode loopback` + ### Source: SQL Oxidized uses the `sequel` ruby gem. You can use a variety of databases that aren't explicitly listed. For more information visit https://github.com/jeremyevans/sequel Make sure you have the correct adapter! ### Source: MYSQL -- cgit v1.2.1 From 2803e49ec9e10e97a0b28550f495eeb8e59b2c8d Mon Sep 17 00:00:00 2001 From: JBBR Date: Wed, 29 Nov 2017 10:00:09 +0100 Subject: docs: Create AireOS.md (#1116) --- docs/Model-Notes/AireOS.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/Model-Notes/AireOS.md (limited to 'docs') diff --git a/docs/Model-Notes/AireOS.md b/docs/Model-Notes/AireOS.md new file mode 100644 index 0000000..0da9b57 --- /dev/null +++ b/docs/Model-Notes/AireOS.md @@ -0,0 +1,12 @@ +Cisco WLC Configuration +======================== + +Create a user with read-write privilege : + +``` +mgmtuser add oxidized **** read-write +``` + +Oxidized needs read-write privilege in order to execute 'config paging disable'. + +Back to [Model-Notes](README.md) -- cgit v1.2.1 From d2a9c75b02eb18f13121c9f653a443f58682505b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Mantel?= Date: Mon, 4 Dec 2017 21:18:27 +0100 Subject: model: Added support for SLX-OS (#1056) * Add support for SLX-OS * Remove commented code * Add SLX-OS on the list of Supported OS Types * Replace tabs with spaces * Regex modification for remove the display of uptime --- docs/Supported-OS-Types.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index 99566c4..a6ee713 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -27,11 +27,12 @@ * [VOSS (VSP Operating System Software)](/lib/oxidized/model/voss.rb) * [BOSS (Baystack Operating System Software)](/lib/oxidized/model/boss.rb) * Brocade - * [FabricOS](/lib/oxidized/model/fabricos.rb) - * [Ironware](/lib/oxidized/model/ironware.rb) - * [NOS (Network Operating System)](/lib/oxidized/model/nos.rb) - * [Vyatta](/lib/oxidized/model/vyatta.rb) - * [6910](/lib/oxidized/model/br6910.rb) + * [FabricOS](lib/oxidized/model/fabricos.rb) + * [Ironware](lib/oxidized/model/ironware.rb) + * [NOS (Network Operating System)](lib/oxidized/model/nos.rb) + * [Vyatta](lib/oxidized/model/vyatta.rb) + * [6910](lib/oxidized/model/br6910.rb) + * [SLX-OS](lib/oxidized/model/slxos.rb) * Casa * [Casa](/lib/oxidized/model/casa.rb) * Check Point -- cgit v1.2.1 From 7e6dc8cce71d6e2753a4e865d8bfbcd347fe1f8a Mon Sep 17 00:00:00 2001 From: Frederik Kriewitz Date: Sun, 10 Dec 2017 21:53:14 +0100 Subject: model: Add support for Broadband Network Platform Software from GCOM Technologies Co.,Ltd. (#1097) * Add support for Broadband Network Platform Software from GCOM Technologies Co.,Ltd. * requested changes --- docs/Supported-OS-Types.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index a6ee713..c2035b0 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -77,6 +77,8 @@ * [XOS](/lib/oxidized/model/xos.rb) * F5 * [TMOS](/lib/oxidized/model/tmos.rb) + * Fiberstore + * [S3800](/lib/oxidized/model/gcombnps.rb) * Force10 * [DNOS](/lib/oxidized/model/dnos.rb) * [FTOS](/lib/oxidized/model/ftos.rb) @@ -84,6 +86,8 @@ * [FortiOS](/lib/oxidized/model/fortios.rb) * Fujitsu * [PRIMERGY Blade switch 1/10Gbe](/lib/oxidized/model/fujitsupy.rb) + * GCOM Technologies + * [Broadband Network Platform Software](/lib/oxidized/model/gcombnps.rb) * Hatteras * [Hatteras](/lib/oxidized/model/hatteras.rb) * Hirschmann -- cgit v1.2.1 From 38e1f4216df5751e856e11532fc894ccfbd4010d Mon Sep 17 00:00:00 2001 From: mattie47 <4696925+mattie47@users.noreply.github.com> Date: Sun, 7 Jan 2018 10:32:52 +1300 Subject: model: Added Allied Telesis AW+ model (#936) * Create awplus.rb Added support for Allied Telesis AW+ switches and routers * Add support for Allied Telesis Alliedware Plus products * Add Allied Telesis to Supported Products * Add Allied Telesis to supported models Feature support included: - Telnet and SSH -- Enable/Secret Password - Device info from "show system" command -- Dynamic output e.g. Device Uptime is removed. - Var: remove_secret - User-defined terminal length -- User is not required to "terminal no length" and can keep configured pager length. --- docs/Supported-OS-Types.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index c2035b0..a12f5ef 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -11,6 +11,8 @@ * [ISAM](/lib/oxidized/model/isam.rb) * [SR OS (Formerly TiMOS)](/lib/oxidized/model/timos.rb) * Wireless + * Allied Telesis + * [Alliedware Plus](/lib/oxidized/model/awplus.rb) * Alvarion * [BreezeACCESS](/lib/oxidized/model/alvarion.rb) * APC -- cgit v1.2.1 From 6f46eeb2b5000d3f07377655d0bcfc7c2ef36cb3 Mon Sep 17 00:00:00 2001 From: KodApa85 Date: Thu, 18 Jan 2018 15:33:07 +0000 Subject: docs: Added documentation for setting up JunOS with Oxidized (#1155) --- docs/Model-Notes/JunOS.md | 38 ++++++++++++++++++++++++++++++++++++++ docs/Model-Notes/README.md | 1 + 2 files changed, 39 insertions(+) create mode 100644 docs/Model-Notes/JunOS.md (limited to 'docs') diff --git a/docs/Model-Notes/JunOS.md b/docs/Model-Notes/JunOS.md new file mode 100644 index 0000000..ed8dbca --- /dev/null +++ b/docs/Model-Notes/JunOS.md @@ -0,0 +1,38 @@ +JunOS Configuration +======================== + +Create login class cfg-view + +``` +set system login class cfg-view permissions view-configuration +set system login class cfg-view allow-commands "(show)|(set cli screen-length)|(set cli screen-width)" +set system login class cfg-view deny-commands "(clear)|(file)|(file show)|(help)|(load)|(monitor)|(op)|(request)|(save)|(set)|(start)|(test)" +set system login class cfg-view deny-configuration all +``` + +Create a user with cfg-view class + +``` +set system login user oxidized class cfg-view +set system login user oxidized authentication plain-text-password "verysecret" +``` + +The commands Oxidized executes are: + +1. set cli screen-length 0 +2. set cli screen-width 0 +3. show configuration +4. show version +5. show chassis hardware +6. show system license +7. show system license keys +ex22|ex33|ex4|ex8|qfx only +8. show virtual-chassis +MX960 only +9. show chassis fabric reachability + + +Oxidized can now retrieve your configuration! + + +Back to [Model-Notes](README.md) diff --git a/docs/Model-Notes/README.md b/docs/Model-Notes/README.md index 15ab445..d4b917c 100644 --- a/docs/Model-Notes/README.md +++ b/docs/Model-Notes/README.md @@ -12,6 +12,7 @@ Use the table below for more information on the Vendor/Model caveats. Vendor | Model |Updated ----------------|-----------------|---------------- Huawei|[VRP](VRP-Huawei.md)|17 Nov 2017 +Juniper|[MX/QFX/EX/SRX/J Series](JunOS.md)|18 Jan 2018 If you discover additional caveats or problems please make sure to consult the [GitHub issues for oxidized](https://github.com/ytti/oxidized/issues) known issues. -- cgit v1.2.1 From 4e59878052f0668f4dde2282e86882626936f6b4 Mon Sep 17 00:00:00 2001 From: KodApa85 Date: Thu, 25 Jan 2018 22:01:39 +0000 Subject: model: Fixed FTP Passive/Active modes & Xyzel XGS4600 series Docs (#1161) * FTP Passive/Active mode added * Documentation for Xyzel XGS4600 series --- docs/Configuration.md | 9 +++++++++ docs/Model-Notes/README.md | 1 + docs/Model-Notes/XGS4600-Zyxel.md | 24 ++++++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 docs/Model-Notes/XGS4600-Zyxel.md (limited to 'docs') diff --git a/docs/Configuration.md b/docs/Configuration.md index db71bc7..e2db05e 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -74,6 +74,15 @@ vars_map: ... ``` +### FTP Passive Mode + +Oxidized uses ftp passive mode by default. Some devices require passive mode to be disabled. To do so, we can set `input.ftp.passive` to false +``` +input: + ftp: + passive: false +``` + ### Advanced Configuration Below is an advanced example configuration. You will be able to (optionally) override options per device. The router.db format used is `hostname:model:username:password:enable_password`. Hostname and model will be the only required options, all others override the global configuration sections. diff --git a/docs/Model-Notes/README.md b/docs/Model-Notes/README.md index d4b917c..f51ed80 100644 --- a/docs/Model-Notes/README.md +++ b/docs/Model-Notes/README.md @@ -13,6 +13,7 @@ Vendor | Model |Updated ----------------|-----------------|---------------- Huawei|[VRP](VRP-Huawei.md)|17 Nov 2017 Juniper|[MX/QFX/EX/SRX/J Series](JunOS.md)|18 Jan 2018 +Xyzel|[XGS4600 Series](XGS4600-Zyxel.md)|23 Jan 2018 If you discover additional caveats or problems please make sure to consult the [GitHub issues for oxidized](https://github.com/ytti/oxidized/issues) known issues. diff --git a/docs/Model-Notes/XGS4600-Zyxel.md b/docs/Model-Notes/XGS4600-Zyxel.md new file mode 100644 index 0000000..0ff2e7d --- /dev/null +++ b/docs/Model-Notes/XGS4600-Zyxel.md @@ -0,0 +1,24 @@ +ZynOS Configuration +======================== + +## FTP +FTP access is only possible as admin, other users can login but cannot pull the files. +For the XGS4600 series the config file is _config_ and not _config-0_ + +The following line in _oxidized/lib/oxidized/model/zynos.rb_ with need changing +``` + cmd 'config-0' + +``` + +The inclusion of an extra ftp option is also require. Within _input_ add the following +``` +input: + ftp: + passive: false +``` + +Oxidized can now retrieve your configuration! + + +Back to [Model-Notes](README.md) -- cgit v1.2.1 From cc78c8143cc167a14f1d45755a83242fae0af1b2 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Thu, 15 Feb 2018 19:40:26 +0000 Subject: docs: Added model note for 3com comware (#1186) --- docs/Model-Notes/Comware.md | 10 ++++++++++ docs/Model-Notes/README.md | 1 + 2 files changed, 11 insertions(+) create mode 100644 docs/Model-Notes/Comware.md (limited to 'docs') diff --git a/docs/Model-Notes/Comware.md b/docs/Model-Notes/Comware.md new file mode 100644 index 0000000..31eb002 --- /dev/null +++ b/docs/Model-Notes/Comware.md @@ -0,0 +1,10 @@ +Comware Configuration +===================== + +If you find 3Com comware devices aren't being backed up this may be due to prompt detection not matching +because a previous login message is disabled after the first prompt. You can disable this on the devices +themselves by running this command: + +`info-center source default channel 1 log state off debug state off` + +[Reference](https://github.com/ytti/oxidized/issues/1171) diff --git a/docs/Model-Notes/README.md b/docs/Model-Notes/README.md index f51ed80..6a64058 100644 --- a/docs/Model-Notes/README.md +++ b/docs/Model-Notes/README.md @@ -11,6 +11,7 @@ Use the table below for more information on the Vendor/Model caveats. Vendor | Model |Updated ----------------|-----------------|---------------- +3COM|[Comware](Comware.md)|15 Feb 2018 Huawei|[VRP](VRP-Huawei.md)|17 Nov 2017 Juniper|[MX/QFX/EX/SRX/J Series](JunOS.md)|18 Jan 2018 Xyzel|[XGS4600 Series](XGS4600-Zyxel.md)|23 Jan 2018 -- cgit v1.2.1 From baee367bfec7ec5241ad7e893de7df8ea7eec1e7 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Tue, 27 Feb 2018 14:10:14 +0000 Subject: Added model to Supported-OS-Types --- docs/Supported-OS-Types.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index c2035b0..683a022 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -133,6 +133,8 @@ * [Quanta / VxWorks 6.6 (1.1.0.8)](/lib/oxidized/model/quantaos.rb) * Siklu * [EtherHaul](/lib/oxidized/model/siklu.rb) + * SNR + * [SNR](/lib/oxidized/model/snr.rb) * Supermicro * [Supermicro](/lib/oxidized/model/supermicro.rb) * Symantec -- cgit v1.2.1 From 72397c4f344ab97fe3db1e381a3e5e1b1a935c62 Mon Sep 17 00:00:00 2001 From: Jason Ackley Date: Tue, 27 Feb 2018 08:58:59 -0600 Subject: model: Added support for ArbOS from Arbor Networks. (#1096) * Basic support for ArbOS from Arbor Networks. ArbOS is the generic name for Arbor Networks (https://www.arbornetworks.com/) OS that runs on some of their devices. Found and imported from https://github.com/claranet/oxidized . Credit to Claranet for the creation. Locally validated on Peakflow SP v8.2+ The module is quite simple as the command 'config show' automatically disables pagination. There is a pagination-enabled version of the command as well. * Added model notes for ArbOS --- docs/Model-Notes/ArbOS.md | 10 ++++++++++ docs/Model-Notes/README.md | 1 + docs/Supported-OS-Types.md | 2 ++ 3 files changed, 13 insertions(+) create mode 100644 docs/Model-Notes/ArbOS.md (limited to 'docs') diff --git a/docs/Model-Notes/ArbOS.md b/docs/Model-Notes/ArbOS.md new file mode 100644 index 0000000..0f5b628 --- /dev/null +++ b/docs/Model-Notes/ArbOS.md @@ -0,0 +1,10 @@ +Arbor Networks ArbOS notes +========================== + +If you are running ArbOS version 7 or lower then you may need to update the model to remove `exec true`: + +``` + cfg :ssh do + pre_logout 'exit' + end +``` diff --git a/docs/Model-Notes/README.md b/docs/Model-Notes/README.md index 6a64058..9d7db32 100644 --- a/docs/Model-Notes/README.md +++ b/docs/Model-Notes/README.md @@ -12,6 +12,7 @@ Use the table below for more information on the Vendor/Model caveats. Vendor | Model |Updated ----------------|-----------------|---------------- 3COM|[Comware](Comware.md)|15 Feb 2018 +Arbor Networks|[ArbOS](ArbOS.md)|27 Feb 2018 Huawei|[VRP](VRP-Huawei.md)|17 Nov 2017 Juniper|[MX/QFX/EX/SRX/J Series](JunOS.md)|18 Jan 2018 Xyzel|[XGS4600 Series](XGS4600-Zyxel.md)|23 Jan 2018 diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index a12f5ef..d6d718f 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -17,6 +17,8 @@ * [BreezeACCESS](/lib/oxidized/model/alvarion.rb) * APC * [AOS](/lib/oxidized/model/apc_aos.rb) + * Arbor Networks + * [ArbOS](/lib/oxidized/model/arbos.rb) * Arista * [EOS](/lib/oxidized/model/eos.rb) * Arris -- cgit v1.2.1 From ad2a0675edee605bda8fe460b3656857eb050129 Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Sun, 11 Mar 2018 23:11:13 +0100 Subject: Introduce support for OXIDIZED_SSH_PASSPHRASE --- docs/Hooks.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/Hooks.md b/docs/Hooks.md index fab4025..080d301 100644 --- a/docs/Hooks.md +++ b/docs/Hooks.md @@ -67,6 +67,8 @@ This hook configures the repository `remote` and _push_ the code when the specif * `publickey`: publickey for repository auth. * `privatekey`: privatekey for repository auth. +It is also possible to set the environment variable `OXIDIZED_SSH_PASSPHRASE` to a passphrase if your keypair requires it. + When using groups repositories, each group must have its own `remote` in the `remote_repo` config. ``` yaml -- cgit v1.2.1 From 87600b1f5f12711afe29c408e02dbbd927e3f25d Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Mon, 12 Mar 2018 00:19:20 +0100 Subject: Lint and standardize markdown documentation --- docs/Configuration.md | 58 +++---- docs/Hooks.md | 78 +++++----- docs/Model-Notes/AireOS.md | 8 +- docs/Model-Notes/ArbOS.md | 2 +- docs/Model-Notes/Comware.md | 10 +- docs/Model-Notes/JunOS.md | 14 +- docs/Model-Notes/README.md | 8 +- docs/Model-Notes/VRP-Huawei.md | 5 +- docs/Model-Notes/XGS4600-Zyxel.md | 13 +- docs/Outputs.md | 42 +++-- docs/Ruby-API.md | 46 ++++-- docs/Sources.md | 48 +++--- docs/Supported-OS-Types.md | 317 +++++++++++++++++++------------------- 13 files changed, 336 insertions(+), 313 deletions(-) (limited to 'docs') diff --git a/docs/Configuration.md b/docs/Configuration.md index e2db05e..59e3f6d 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -1,10 +1,12 @@ -## Configuration -### Debugging +# Configuration + +## Debugging + In case a model plugin doesn't work correctly (ios, procurve, etc.), you can enable live debugging of SSH/Telnet sessions. Just add a `debug` option containing the value true to the `input` section. The log files will be created depending on the parent directory of the logfile option. The following example will log an active ssh/telnet session `/home/oxidized/.config/oxidized/log/-`. The file will be truncated on each consecutive ssh/telnet session, so you need to put a `tailf` or `tail -f` on that file! -``` +```yaml log: /home/oxidized/.config/oxidized/log ... @@ -16,20 +18,20 @@ input: secure: false ``` -### Privileged mode +## Privileged mode To start privileged mode before pulling the configuration, Oxidized needs to send the enable command. You can globally enable this, by adding the following snippet to the global section of the configuration file. -``` +```yaml vars: enable: S3cre7 ``` -### Removing secrets +## Removing secrets To strip out secrets from configurations before storing them, Oxidized needs the the remove_secrets flag. You can globally enable this by adding the following snippet to the global sections of the configuration file. -``` +```yaml vars: remove_secret: true ``` @@ -38,32 +40,33 @@ Device models can contain substitution filters to remove potentially sensitive d As a partial example from ios.rb: -``` +```yaml cmd :secret do |cfg| cfg.gsub! /^(snmp-server community).*/, '\\1 ' (...) cfg end ``` + The above strips out snmp community strings from your saved configs. **NOTE:** Removing secrets reduces the usefulness as a full configuration backup, but it may make sharing configs easier. -### Disabling SSH exec channels +## Disabling SSH exec channels Oxidized uses exec channels to make information extraction simpler, but there are some situations where this doesn't work well, e.g. configuring devices. This feature can be turned off by setting the `ssh_no_exec` variable. -``` +```yaml vars: ssh_no_exec: true ``` -### SSH Proxy Command +## SSH Proxy Command Oxidized can `ssh` through a proxy as well. To do so we just need to set `ssh_proxy` variable. -``` +```yaml ... map: name: 0 @@ -74,20 +77,21 @@ vars_map: ... ``` -### FTP Passive Mode +## FTP Passive Mode Oxidized uses ftp passive mode by default. Some devices require passive mode to be disabled. To do so, we can set `input.ftp.passive` to false -``` + +```yaml input: ftp: passive: false ``` -### Advanced Configuration +## Advanced Configuration Below is an advanced example configuration. You will be able to (optionally) override options per device. The router.db format used is `hostname:model:username:password:enable_password`. Hostname and model will be the only required options, all others override the global configuration sections. -``` +```yaml --- username: oxidized password: S3cr3tx @@ -130,14 +134,13 @@ source: model_map: cisco: ios juniper: junos - ``` -### Advanced Group Configuration +## Advanced Group Configuration For group specific credentials -``` +```yaml groups: mikrotik: username: admin @@ -146,16 +149,19 @@ groups: username: ubnt password: ubnt ``` + and add group mapping -``` + +```yaml map: model: 0 name: 1 group: 2 ``` + For model specific credentials -``` +```yaml models: junos: username: admin @@ -170,26 +176,26 @@ models: password: password ``` -### RESTful API and Web Interface +## RESTful API and Web Interface The RESTful API and Web Interface is enabled by configuring the `rest:` parameter in the config file. This parameter can optionally contain a relative URI. -``` +```yaml # Listen on http://127.0.0.1:8888/ rest: 127.0.0.1:8888 ``` -``` +```yaml # Listen on http://10.0.0.1:8000/oxidized/ rest: 10.0.0.1:8000/oxidized ``` -### Triggered backups +## Triggered backups A node can be moved to head-of-queue via the REST API `GET/POST /node/next/[NODE]`. In the default configuration this node will be processed when the next job worker becomes available, it could take some time if existing backups are in progress. To execute moved jobs immediately a new job can be added: -``` +```yaml next_adds_job: true ``` diff --git a/docs/Hooks.md b/docs/Hooks.md index fab4025..d52ee08 100644 --- a/docs/Hooks.md +++ b/docs/Hooks.md @@ -1,25 +1,30 @@ # Hooks + You can define arbitrary number of hooks that subscribe different events. The hook system is modular and different kind of hook types can be enabled. ## Configuration + Following configuration keys need to be defined for all hooks: - * `events`: which events to subscribe. Needs to be an array. See below for the list of available events. - * `type`: what hook class to use. See below for the list of available hook types. +* `events`: which events to subscribe. Needs to be an array. See below for the list of available events. +* `type`: what hook class to use. See below for the list of available hook types. ### Events - * `node_success`: triggered when configuration is succesfully pulled from a node and right before storing the configuration. - * `node_fail`: triggered after `retries` amount of failed node pulls. - * `post_store`: triggered after node configuration is stored (this is executed only when the configuration has changed). - * `nodes_done`: triggered after finished fetching all nodes. + +* `node_success`: triggered when configuration is succesfully pulled from a node and right before storing the configuration. +* `node_fail`: triggered after `retries` amount of failed node pulls. +* `post_store`: triggered after node configuration is stored (this is executed only when the configuration has changed). +* `nodes_done`: triggered after finished fetching all nodes. ## Hook type: exec + The `exec` hook type allows users to run an arbitrary shell command or a binary when triggered. The command is executed on a separate child process either in synchronous or asynchronous fashion. Non-zero exit values cause errors to be logged. STDOUT and STDERR are currently not collected. Command is executed with the following environment: -``` + +```text OX_EVENT OX_NODE_NAME OX_NODE_IP @@ -35,13 +40,13 @@ OX_REPO_NAME Exec hook recognizes following configuration keys: - * `timeout`: hard timeout for the command execution. SIGTERM will be sent to the child process after the timeout has elapsed. Default: 60 - * `async`: influences whether main thread will wait for the command execution. Set this true for long running commands so node pull is not blocked. Default: false - * `cmd`: command to run. +* `timeout`: hard timeout for the command execution. SIGTERM will be sent to the child process after the timeout has elapsed. Default: 60 +* `async`: influences whether main thread will wait for the command execution. Set this true for long running commands so node pull is not blocked. Default: false +* `cmd`: command to run. +## exec hook configuration example -## Hook configuration example -``` +```yaml hooks: name_for_example_hook1: type: exec @@ -55,21 +60,21 @@ hooks: timeout: 120 ``` -### githubrepo +### Hook type: 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. +* `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 +```yaml hooks: push_to_remote: remote_repo: @@ -78,10 +83,9 @@ hooks: firewalls: git@git.intranet:oxidized/firewalls.git ``` +## githubrepo hook configuration example -## Hook configuration example - -``` yaml +```yaml hooks: push_to_remote: type: githubrepo @@ -97,14 +101,14 @@ The `awssns` hook publishes messages to AWS SNS topics. This allows you to notif Fields sent in the message: - * `event`: Event type (e.g. `node_success`) - * `group`: Group name - * `model`: Model name (e.g. `eos`) - * `node`: Device hostname +* `event`: Event type (e.g. `node_success`) +* `group`: Group name +* `model`: Model name (e.g. `eos`) +* `node`: Device hostname -Configuration example: +## awssns hook configuration example -``` yaml +```yaml hooks: hook_script: type: awssns @@ -115,8 +119,8 @@ hooks: AWS SNS hook requires the following configuration keys: - * `region`: AWS Region name - * `topic_arn`: ASN Topic reference +* `region`: AWS Region name +* `topic_arn`: ASN Topic reference Your AWS credentials should be stored in `~/.aws/credentials`. @@ -126,13 +130,13 @@ The `slackdiff` hook posts colorized config diffs to a [Slack](http://www.slack. You will need to manually install the `slack-api` gem on your system: -``` +```shell gem install slack-api ``` -Configuration example: +## slackdiff hook configuration example -``` yaml +```yaml hooks: slack: type: slackdiff @@ -143,7 +147,7 @@ hooks: Optionally you can disable snippets and post a formatted message, for instance linking to a commit in a git repo. Named parameters `%{node}`, `%{group}`, `%{model}` and `%{commitref}` are available. -``` yaml +```yaml hooks: slack: type: slackdiff @@ -162,13 +166,13 @@ The `xmppdiff` hook posts config diffs to a [XMPP](https://en.wikipedia.org/wiki You will need to manually install the `xmpp4r` gem on your system: -``` +```shell gem install xmpp4r ``` -Configuration example: +## xmppdiff hook configuration example -``` yaml +```yaml hooks: xmpp: type: xmppdiff diff --git a/docs/Model-Notes/AireOS.md b/docs/Model-Notes/AireOS.md index 0da9b57..9962f31 100644 --- a/docs/Model-Notes/AireOS.md +++ b/docs/Model-Notes/AireOS.md @@ -1,12 +1,12 @@ -Cisco WLC Configuration -======================== +Cisco WLC Configuration +======================= Create a user with read-write privilege : -``` +```text mgmtuser add oxidized **** read-write ``` -Oxidized needs read-write privilege in order to execute 'config paging disable'. +Oxidized needs read-write privilege in order to execute 'config paging disable'. Back to [Model-Notes](README.md) diff --git a/docs/Model-Notes/ArbOS.md b/docs/Model-Notes/ArbOS.md index 0f5b628..f68467f 100644 --- a/docs/Model-Notes/ArbOS.md +++ b/docs/Model-Notes/ArbOS.md @@ -3,7 +3,7 @@ Arbor Networks ArbOS notes If you are running ArbOS version 7 or lower then you may need to update the model to remove `exec true`: -``` +```ruby cfg :ssh do pre_logout 'exit' end diff --git a/docs/Model-Notes/Comware.md b/docs/Model-Notes/Comware.md index 31eb002..0da019a 100644 --- a/docs/Model-Notes/Comware.md +++ b/docs/Model-Notes/Comware.md @@ -1,10 +1,12 @@ Comware Configuration ===================== -If you find 3Com comware devices aren't being backed up this may be due to prompt detection not matching -because a previous login message is disabled after the first prompt. You can disable this on the devices -themselves by running this command: +If you find 3Com comware devices aren't being backed up this may be due to prompt detection not matching because a previous login message is disabled after the first prompt. -`info-center source default channel 1 log state off debug state off` +You can disable this on the devices themselves by running this command: + +```text +info-center source default channel 1 log state off debug state off +``` [Reference](https://github.com/ytti/oxidized/issues/1171) diff --git a/docs/Model-Notes/JunOS.md b/docs/Model-Notes/JunOS.md index ed8dbca..8093df0 100644 --- a/docs/Model-Notes/JunOS.md +++ b/docs/Model-Notes/JunOS.md @@ -1,9 +1,9 @@ JunOS Configuration -======================== +=================== Create login class cfg-view -``` +```text set system login class cfg-view permissions view-configuration set system login class cfg-view allow-commands "(show)|(set cli screen-length)|(set cli screen-width)" set system login class cfg-view deny-commands "(clear)|(file)|(file show)|(help)|(load)|(monitor)|(op)|(request)|(save)|(set)|(start)|(test)" @@ -12,7 +12,7 @@ set system login class cfg-view deny-configuration all Create a user with cfg-view class -``` +```text set system login user oxidized class cfg-view set system login user oxidized authentication plain-text-password "verysecret" ``` @@ -25,14 +25,10 @@ The commands Oxidized executes are: 4. show version 5. show chassis hardware 6. show system license -7. show system license keys -ex22|ex33|ex4|ex8|qfx only -8. show virtual-chassis -MX960 only +7. show system license keys (ex22|ex33|ex4|ex8|qfx only) +8. show virtual-chassis (MX960 only) 9. show chassis fabric reachability - Oxidized can now retrieve your configuration! - Back to [Model-Notes](README.md) diff --git a/docs/Model-Notes/README.md b/docs/Model-Notes/README.md index 9d7db32..8dcabd3 100644 --- a/docs/Model-Notes/README.md +++ b/docs/Model-Notes/README.md @@ -1,21 +1,17 @@ - - Model Notes -======================== - +=========== This directory contains implemention notes and caveats to assist you in your oxidized deployment. Use the table below for more information on the Vendor/Model caveats. - Vendor | Model |Updated ----------------|-----------------|---------------- 3COM|[Comware](Comware.md)|15 Feb 2018 +AireOS|[AireOS](AireOS.md)|29 Nov 2017 Arbor Networks|[ArbOS](ArbOS.md)|27 Feb 2018 Huawei|[VRP](VRP-Huawei.md)|17 Nov 2017 Juniper|[MX/QFX/EX/SRX/J Series](JunOS.md)|18 Jan 2018 Xyzel|[XGS4600 Series](XGS4600-Zyxel.md)|23 Jan 2018 - If you discover additional caveats or problems please make sure to consult the [GitHub issues for oxidized](https://github.com/ytti/oxidized/issues) known issues. diff --git a/docs/Model-Notes/VRP-Huawei.md b/docs/Model-Notes/VRP-Huawei.md index d03c752..e68a959 100644 --- a/docs/Model-Notes/VRP-Huawei.md +++ b/docs/Model-Notes/VRP-Huawei.md @@ -3,7 +3,7 @@ Huawei VRP Configuration Create a user with no privileges -``` +```text system-view [~HUAWEI] aaa [~HUAWEI-aaa] local-user oxidized password irreversible-cipher verysecret @@ -21,7 +21,7 @@ The commands Oxidized executes are: Command 2 and 3 can be executed without issues, but 1 and 4 are only available for higher level users. Instead of making Oxidized a read/write user on your device, lower the priviledge-level for commands 1 and 4: -``` +```text system-view [~HUAWEI] command-privilege level 1 view global display current-configuration all [*HUAWEI] command-privilege level 1 view shell screen-length @@ -30,5 +30,4 @@ Command 2 and 3 can be executed without issues, but 1 and 4 are only available f Oxidized can now retrieve your configuration! - Back to [Model-Notes](README.md) diff --git a/docs/Model-Notes/XGS4600-Zyxel.md b/docs/Model-Notes/XGS4600-Zyxel.md index 0ff2e7d..17cb2b5 100644 --- a/docs/Model-Notes/XGS4600-Zyxel.md +++ b/docs/Model-Notes/XGS4600-Zyxel.md @@ -1,18 +1,20 @@ ZynOS Configuration -======================== +=================== ## FTP + FTP access is only possible as admin, other users can login but cannot pull the files. For the XGS4600 series the config file is _config_ and not _config-0_ -The following line in _oxidized/lib/oxidized/model/zynos.rb_ with need changing -``` - cmd 'config-0' +The following line in _oxidized/lib/oxidized/model/zynos.rb_ will need changing +```text + cmd 'config-0' ``` The inclusion of an extra ftp option is also require. Within _input_ add the following -``` + +```yaml input: ftp: passive: false @@ -20,5 +22,4 @@ input: Oxidized can now retrieve your configuration! - Back to [Model-Notes](README.md) diff --git a/docs/Outputs.md b/docs/Outputs.md index e3bd42d..92c672c 100644 --- a/docs/Outputs.md +++ b/docs/Outputs.md @@ -1,23 +1,22 @@ +# Outputs -## Output - -### Output: File +## Output: File Parent directory needs to be created manually, one file per device, with most recent running config. -``` +```yaml output: file: directory: /var/lib/oxidized/configs ``` -### Output: Git +## 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 +```yaml output: default: git git: @@ -28,7 +27,7 @@ output: And for groups repositories: -``` yaml +```yaml output: default: git git: @@ -40,14 +39,14 @@ output: Oxidized will create a repository for each group in the same directory as the `default.git`. For example: -``` csv +```csv host1:ios:first host2:nxos:second ``` This will generate the following repositories: -``` bash +```bash $ ls /var/lib/oxidized/git-repos default.git first.git second.git @@ -55,7 +54,7 @@ default.git first.git second.git If you would like to use groups and a single repository, you can force this with the `single_repo` config. -``` yaml +```yaml output: default: git git: @@ -64,15 +63,14 @@ output: ``` -### Output: Git-Crypt +## Output: Git-Crypt This uses the gem git and system git-crypt interfaces. Have a look at [GIT-Crypt](https://www.agwa.name/projects/git-crypt/) documentation to know how to install it. Additionally to user and email informations, you have to provide the users ID that can be a key ID, a full fingerprint, an email address, or anything else that uniquely identifies a public key to GPG (see "HOW TO SPECIFY A USER ID" in the gpg man page). - For a single repositories for all devices: -``` yaml +```yaml output: default: gitcrypt gitcrypt: @@ -86,7 +84,7 @@ output: And for groups repositories: -``` yaml +```yaml output: default: gitcrypt gitcrypt: @@ -101,14 +99,14 @@ output: Oxidized will create a repository for each group in the same directory as the `default`. For example: -``` csv +```csv host1:ios:first host2:nxos:second ``` This will generate the following repositories: -``` bash +```bash $ ls /var/lib/oxidized/git-repos default.git first.git second.git @@ -116,7 +114,7 @@ default.git first.git second.git If you would like to use groups and a single repository, you can force this with the `single_repo` config. -``` yaml +```yaml output: default: gitcrypt gitcrypt: @@ -130,11 +128,11 @@ output: Please note that user list is only updated once at creation. -### Output: Http +## Output: Http POST a config to the specified URL -``` +```yaml output: default: http http: @@ -143,13 +141,13 @@ output: url: "http://192.168.162.50:8080/db/coll" ``` -### Output types +## 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` (run `gem contents oxidized` to find out the full file path). 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 -``` +```text - cmd 'show version' do |cfg| - comment cfg.lines.first + cmd 'show version' do |state| @@ -183,7 +181,7 @@ For example, let's say you want to split out `show version` and `show inventory` which will result in the following layout -``` +```text diff/$FQDN--show_running_config nodiff/$FQDN--show_version nodiff/$FQDN--show_inventory diff --git a/docs/Ruby-API.md b/docs/Ruby-API.md index 2dbc10e..8621870 100644 --- a/docs/Ruby-API.md +++ b/docs/Ruby-API.md @@ -3,33 +3,39 @@ The following objects exist in Oxidized. ## Input - * gets config from nodes - * must implement 'connect', 'get', 'cmd' - * 'ssh', 'telnet, ftp, and tftp' implemented + +* gets config from nodes +* must implement 'connect', 'get', 'cmd' +* 'ssh', 'telnet, ftp, and tftp' implemented ## Output - * stores config - * must implement 'store' (may implement 'fetch') - * 'git' and 'file' (store as flat ascii) implemented + +* stores config +* must implement 'store' (may implement 'fetch') +* 'git' and 'file' (store as flat ascii) implemented ## Source - * gets list of nodes to poll - * must implement 'load' - * source can have 'name', 'model', 'group', 'username', 'password', 'input', 'output', 'prompt' - * name - name of the devices - * model - model to use ios/junos/xyz, model is loaded dynamically when needed (Also default in config file) - * input - method to acquire config, loaded dynamically as needed (Also default in config file) - * output - method to store config, loaded dynamically as needed (Also default in config file) - * prompt - prompt used for node (Also default in config file, can be specified in model too) - * 'sql', 'csv' and 'http' (supports any format with single entry per line, like router.db) + +* gets list of nodes to poll +* must implement 'load' +* source can have 'name', 'model', 'group', 'username', 'password', 'input', 'output', 'prompt' + * name - name of the devices + * model - model to use ios/junos/xyz, model is loaded dynamically when needed (Also default in config file) + * input - method to acquire config, loaded dynamically as needed (Also default in config file) + * output - method to store config, loaded dynamically as needed (Also default in config file) + * prompt - prompt used for node (Also default in config file, can be specified in model too) +* 'sql', 'csv' and 'http' (supports any format with single entry per line, like router.db) ## Model + ### At the top level + A model may use several methods at the top level in the class. `cfg` is executed in input/output/source context. `cmd` is executed within an instance of the model. #### `cfg` + `cfg` may be called with a list of methods (`:ssh`, `:telnet`) and a block with zero parameters. Calling `cfg` registers the given access methods and calling it at least once is required for a model to work. @@ -38,6 +44,7 @@ The block may contain commands to change some behaviour for the given methods (e.g. calling `post_login` to disable the pager). #### `cmd` + Is used to specify commands that should be executed on a model in order to gather its configuration. It can be called with: @@ -69,18 +76,21 @@ Execution order is `:all`, `:secret`, and lastly the command specific block, if given. #### `comment` + Called with a single string containing the string to prepend for comments in emitted configuration for this model. If not specified the default of `'# '` will be used (note the trailing space). #### `prompt` + Is called with a regular expression that is used to detect when command output ends after a command has been executed. If not specified, a default of `/^([\w.@-]+[#>]\s?)$/` is used. #### `expect` + Called with a regular expression and a block. The block takes two parameters: the regular expression, and the data containing the match. @@ -90,26 +100,32 @@ The passed data is replaced by the return value of the block. it's further processed. ### At the second level + The following methods are available: #### `comment` + Used inside `cmd` invocations. Comments out every line in the passed string and returns the result. #### `password` + Used inside `cfg` invocations to specify the regular expression used to detect the password prompt. If not specified, the default of `/^Password/` is used. #### `post_login` + Used inside `cfg` invocations to specify commands to run once Oxidized has logged in to the switch. Takes one argument that is either a block (taking zero parameters) or a string containing a command to execute. #### `pre_logout` + Used to specify commands to run before Oxidized closes the connection to the switch. Takes one argument that is either a block (taking zero parameters) or a string containing a command to execute. #### `send` + Usually used inside `expect` or blocks passed to `post_login`/`pre_logout`. Takes a single parameter: a string to be sent to the switch. diff --git a/docs/Sources.md b/docs/Sources.md index 7029b72..5599409 100644 --- a/docs/Sources.md +++ b/docs/Sources.md @@ -1,10 +1,10 @@ -## Source +# Sources -### Source: CSV +## Source: CSV One line per device, colon seperated. If `ip` isn't present, a DNS lookup will be done against `name`. For large installations, setting `ip` will dramatically reduce startup time. -``` +```yaml source: default: csv csv: @@ -22,7 +22,7 @@ source: Example csv `/var/lib/oxidized/router.db`: -``` +```text rtr01.local:192.168.1.1:ios:oxidized:5uP3R53cR3T:T0p53cR3t ``` @@ -41,25 +41,31 @@ source: model: 1 ``` -> Please note, if you are running GPG v2 then you will be prompted for your gpg password on start up, if you use GPG >= 2.1 then you can add the following config to stop that behaviour: +Please note, if you are running GPG v2 then you will be prompted for your gpg password on start up, if you use GPG >= 2.1 then you can add the following config to stop that behaviour: -> Within `~/.gnupg/gpg-agent.conf` +Within `~/.gnupg/gpg-agent.conf` + +```text +allow-loopback-pinentry +``` -> `allow-loopback-pinentry` +and within: `~/.gnupg/gpg.conf` -> and within: `~/.gnupg/gpg.conf` +```text +pinentry-mode loopback +``` -> `pinentry-mode loopback` +## Source: SQL -### Source: SQL Oxidized uses the `sequel` ruby gem. You can use a variety of databases that aren't explicitly listed. For more information visit https://github.com/jeremyevans/sequel Make sure you have the correct adapter! -### Source: MYSQL + +## Source: MYSQL `sudo apt-get install libmysqlclient-dev` The values correspond to your fields in the DB such that ip, model, etc are field names in the DB -``` +```yaml source: default: sql sql: @@ -77,11 +83,11 @@ source: enable: enable ``` -### Source: SQLite +## Source: SQLite One row per device, filtered by hostname. -``` +```yaml source: default: sql sql: @@ -97,12 +103,11 @@ source: enable: enable ``` -### Custom SQL Query Support +## Custom SQL Query Support You may also implement a custom SQL query to retreive the nodelist using SQL syntax with the `query:` configuration parameter under the `sql:` stanza. - -#### Custom SQL Query Examples +### Custom SQL Query Examples You may have a table named `nodes` which contains a boolean to indicate if the nodes should be enabled (fetched via oxidized). This can be used in the custom SQL query to avoid fetching from known impacted nodes. @@ -119,21 +124,20 @@ In this example we limit the nodes to two "POPs" of `mypop1` and `mypop2`. We al ```sql query: "SELECT * FROM nodes WHERE pop IN ('mypop1','mypop2') AND enabled = True" ``` + The order of the nodes returned will influence the order that nodes are fetched by oxidized. You can use standard SQL `ORDER BY` clauses to influence the node order. You should always test your SQL query before using it in the oxidized configuration as there is no syntax or error checking performed before sending it to the database engine. Consult your database documentation for more information on query language and table optimization. - - -### Source: HTTP +## Source: HTTP One object per device. HTTP Supports basic auth, configure the user and pass you want to use under the http: section. -``` +```yaml source: default: http http: @@ -155,7 +159,7 @@ source: You can also pass `secure: false` if you want to disable ssl certificate verification: -``` +```yaml source: default: http http: diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index d6d718f..a0ca66b 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -1,159 +1,160 @@ # Supported OS types - * Vendor - * OS model - * A10 Networks - * [ACOS](/lib/oxidized/model/acos.rb) - * Accedian Performance Elements (NIDs) - * [AEN](/lib/oxidized/model/aen.rb) - * Alcatel-Lucent - * [AOS](/lib/oxidized/model/aos.rb) - * [AOS7](/lib/oxidized/model/aos7.rb) - * [ISAM](/lib/oxidized/model/isam.rb) - * [SR OS (Formerly TiMOS)](/lib/oxidized/model/timos.rb) - * Wireless - * Allied Telesis - * [Alliedware Plus](/lib/oxidized/model/awplus.rb) - * Alvarion - * [BreezeACCESS](/lib/oxidized/model/alvarion.rb) - * APC - * [AOS](/lib/oxidized/model/apc_aos.rb) - * Arbor Networks - * [ArbOS](/lib/oxidized/model/arbos.rb) - * Arista - * [EOS](/lib/oxidized/model/eos.rb) - * Arris - * [C4CMTS](/lib/oxidized/model/c4cmts.rb) - * Aruba - * [AOSW](/lib/oxidized/model/aosw.rb) - * AudioCodes - * [AudioCodes](/lib/oxdized/model/audiocodes.rb) - * Avaya - * [VOSS (VSP Operating System Software)](/lib/oxidized/model/voss.rb) - * [BOSS (Baystack Operating System Software)](/lib/oxidized/model/boss.rb) - * Brocade - * [FabricOS](lib/oxidized/model/fabricos.rb) - * [Ironware](lib/oxidized/model/ironware.rb) - * [NOS (Network Operating System)](lib/oxidized/model/nos.rb) - * [Vyatta](lib/oxidized/model/vyatta.rb) - * [6910](lib/oxidized/model/br6910.rb) - * [SLX-OS](lib/oxidized/model/slxos.rb) - * Casa - * [Casa](/lib/oxidized/model/casa.rb) - * Check Point - * [GaiaOS](/lib/oxidized/model/gaiaos.rb) - * Ciena - * [SAOS](/lib/oxidized/model/saos.rb) - * Cisco - * [ACSW](/lib/oxidized/model/acsw.rb) - * [AireOS](/lib/oxidized/model/aireos.rb) - * [ASA](/lib/oxidized/model/asa.rb) - * [AsyncOS](/lib/oxidized/model/asyncos.rb) - * [CatOS](/lib/oxidized/model/catos.rb) - * [IOS](/lib/oxidized/model/ios.rb) - * [IOSXR](/lib/oxidized/model/iosxr.rb) - * [NGA](/lib/oxidized/model/cisconga.rb) - * [NXOS](/lib/oxidized/model/nxos.rb) - * [SMA](/lib/oxidized/model/ciscosma.rb) - * [SMB (Nikola series)](/lib/oxidized/model/ciscosmb.rb) - * [UCS](/lib/oxidized/model/ucs.rb) - * Citrix - * [NetScaler (Virtual Applicance)](/lib/oxidized/model/netscaler.rb) - * Coriant (former Tellabs) - * [TMOS (8800)](/lib/oxidized/model/corianttmos.rb) - * [8600](/lib/oxidized/model/coriant8600.rb) - * [Groove](/lib/oxidized/model/coriantgroove.rb) - * Cumulus - * [Linux](/lib/oxidized/model/cumulus.rb) - * DataCom - * [DmSwitch 3000](/lib/oxidized/model/datacom.rb) - * DCN - * [DCN](/lib/oxidized/model/ios.rb) - Map this to ios. - * DELL - * [PowerConnect](/lib/oxidized/model/powerconnect.rb) - * [AOSW](/lib/oxidized/model/aosw.rb) - * D-Link - * [D-Link](/lib/oxidized/model/dlink.rb) - * Ericsson/Redback - * [IPOS (former SEOS)](/lib/oxidized/model/ipos.rb) - * Extreme Networks - * [Enterasys](/lib/oxidized/model/enterasys.rb) - * [WM](/lib/oxidized/model/mtrlrfs.rb) - * [XOS](/lib/oxidized/model/xos.rb) - * F5 - * [TMOS](/lib/oxidized/model/tmos.rb) - * Fiberstore - * [S3800](/lib/oxidized/model/gcombnps.rb) - * Force10 - * [DNOS](/lib/oxidized/model/dnos.rb) - * [FTOS](/lib/oxidized/model/ftos.rb) - * FortiGate - * [FortiOS](/lib/oxidized/model/fortios.rb) - * Fujitsu - * [PRIMERGY Blade switch 1/10Gbe](/lib/oxidized/model/fujitsupy.rb) - * GCOM Technologies - * [Broadband Network Platform Software](/lib/oxidized/model/gcombnps.rb) - * Hatteras - * [Hatteras](/lib/oxidized/model/hatteras.rb) - * Hirschmann - * [HiOS](/lib/oxidized/model/hirschmann.rb) - * HP - * [Comware (HP A-series, H3C, 3Com)](/lib/oxidized/model/comware.rb) - * [Procurve](/lib/oxidized/model/procurve.rb) - * [BladeSystem (Onboard Administrator)](/lib/oxidized/model/hpebladesystem.rb) - * [MSA](/lib/oxidized/model/hpemsa.rb) - * Huawei - * [VRP](/lib/oxidized/model/vrp.rb) - * Juniper - * [JunOS](/lib/oxidized/model/junos.rb) - * [ScreenOS (Netscreen)](/lib/oxidized/model/screenos.rb) - * Mellanox - * [MLNX-OS](/lib/oxidized/model/mlnxos.rb) - * [Voltaire](/lib/oxidized/model/voltaire.rb) - * Mikrotik - * [RouterOS](/lib/oxidized/model/routeros.rb) - * Motorola - * [RFS](/lib/oxidized/model/mtrlrfs.rb) - * MRV - * [MasterOS](/lib/oxidized/model/masteros.rb) - * [FiberDriver](/lib/oxidized/model/fiberdriver.rb) - * Netgear - * [Netgear](/lib/oxidized/model/netgear.rb) - * Netonix - * [WISP Switch (As Netonix)](/lib/oxidized/model/netonix.rb) - * Nokia (formerly TiMetra, Alcatel, Alcatel-Lucent) - * [SR OS (TiMOS)](/lib/oxidized/model/timos.rb) - * OneAccess - * [OneOS](/lib/oxidized/model/oneos.rb) - * Opengear - * [Opengear](/lib/oxidized/model/opengear.rb) - * [OPNsense](/lib/oxidized/model/opnsense.rb) - * Palo Alto - * [PANOS](/lib/oxidized/model/panos.rb) - * [PLANET SG/SGS Switches](/lib/oxidized/model/planet.rb) - * [pfSense](/lib/oxidized/model/pfsense.rb) - * Radware - * [AlteonOS](/lib/oxidized/model/alteonos.rb) - * Quanta - * [Quanta / VxWorks 6.6 (1.1.0.8)](/lib/oxidized/model/quantaos.rb) - * Siklu - * [EtherHaul](/lib/oxidized/model/siklu.rb) - * Supermicro - * [Supermicro](/lib/oxidized/model/supermicro.rb) - * Symantec - * [Blue Coat ProxySG / Security Gateway OS (SGOS)](/lib/oxidized/model/sgos.rb) - * Trango Systems - * [Trango](/lib/oxidized/model/trango.rb) - * TPLink - * [TPLink](/lib/oxidized/model/tplink.rb) - * Ubiquiti - * [AirOS](/lib/oxidized/model/airos.rb) - * [Edgeos](/lib/oxidized/model/edgeos.rb) - * [EdgeSwitch](/lib/oxidized/model/edgeswitch.rb) - * Watchguard - * [Fireware OS](/lib/oxidized/model/firewareos.rb) - * Westell - * [Westell 8178G, Westell 8266G](/lib/oxidized/model/weos.rb) - * Zhone - * [Zhone (OLT and MX)](/lib/oxidized/model/zhoneolt.rb) - * Zyxel - * [ZyNOS](/lib/oxidized/model/zynos.rb) + +* Vendor + * OS model +* A10 Networks + * [ACOS](/lib/oxidized/model/acos.rb) +* Accedian Performance Elements (NIDs) + * [AEN](/lib/oxidized/model/aen.rb) +* Alcatel-Lucent + * [AOS](/lib/oxidized/model/aos.rb) + * [AOS7](/lib/oxidized/model/aos7.rb) + * [ISAM](/lib/oxidized/model/isam.rb) + * [SR OS (Formerly TiMOS)](/lib/oxidized/model/timos.rb) + * Wireless +* Allied Telesis + * [Alliedware Plus](/lib/oxidized/model/awplus.rb) +* Alvarion + * [BreezeACCESS](/lib/oxidized/model/alvarion.rb) +* APC + * [AOS](/lib/oxidized/model/apc_aos.rb) +* Arbor Networks + * [ArbOS](/lib/oxidized/model/arbos.rb) +* Arista + * [EOS](/lib/oxidized/model/eos.rb) +* Arris + * [C4CMTS](/lib/oxidized/model/c4cmts.rb) +* Aruba + * [AOSW](/lib/oxidized/model/aosw.rb) +* AudioCodes + * [AudioCodes](/lib/oxdized/model/audiocodes.rb) +* Avaya + * [VOSS (VSP Operating System Software)](/lib/oxidized/model/voss.rb) + * [BOSS (Baystack Operating System Software)](/lib/oxidized/model/boss.rb) +* Brocade + * [FabricOS](lib/oxidized/model/fabricos.rb) + * [Ironware](lib/oxidized/model/ironware.rb) + * [NOS (Network Operating System)](lib/oxidized/model/nos.rb) + * [Vyatta](lib/oxidized/model/vyatta.rb) + * [6910](lib/oxidized/model/br6910.rb) + * [SLX-OS](lib/oxidized/model/slxos.rb) +* Casa + * [Casa](/lib/oxidized/model/casa.rb) +* Check Point + * [GaiaOS](/lib/oxidized/model/gaiaos.rb) +* Ciena + * [SAOS](/lib/oxidized/model/saos.rb) +* Cisco + * [ACSW](/lib/oxidized/model/acsw.rb) + * [AireOS](/lib/oxidized/model/aireos.rb) + * [ASA](/lib/oxidized/model/asa.rb) + * [AsyncOS](/lib/oxidized/model/asyncos.rb) + * [CatOS](/lib/oxidized/model/catos.rb) + * [IOS](/lib/oxidized/model/ios.rb) + * [IOSXR](/lib/oxidized/model/iosxr.rb) + * [NGA](/lib/oxidized/model/cisconga.rb) + * [NXOS](/lib/oxidized/model/nxos.rb) + * [SMA](/lib/oxidized/model/ciscosma.rb) + * [SMB (Nikola series)](/lib/oxidized/model/ciscosmb.rb) + * [UCS](/lib/oxidized/model/ucs.rb) +* Citrix + * [NetScaler (Virtual Applicance)](/lib/oxidized/model/netscaler.rb) +* Coriant (former Tellabs) + * [TMOS (8800)](/lib/oxidized/model/corianttmos.rb) + * [8600](/lib/oxidized/model/coriant8600.rb) + * [Groove](/lib/oxidized/model/coriantgroove.rb) +* Cumulus + * [Linux](/lib/oxidized/model/cumulus.rb) +* DataCom + * [DmSwitch 3000](/lib/oxidized/model/datacom.rb) +* DCN + * [DCN](/lib/oxidized/model/ios.rb) - Map this to ios. +* DELL + * [PowerConnect](/lib/oxidized/model/powerconnect.rb) + * [AOSW](/lib/oxidized/model/aosw.rb) +* D-Link + * [D-Link](/lib/oxidized/model/dlink.rb) +* Ericsson/Redback + * [IPOS (former SEOS)](/lib/oxidized/model/ipos.rb) +* Extreme Networks + * [Enterasys](/lib/oxidized/model/enterasys.rb) + * [WM](/lib/oxidized/model/mtrlrfs.rb) + * [XOS](/lib/oxidized/model/xos.rb) +* F5 + * [TMOS](/lib/oxidized/model/tmos.rb) +* Fiberstore + * [S3800](/lib/oxidized/model/gcombnps.rb) +* Force10 + * [DNOS](/lib/oxidized/model/dnos.rb) + * [FTOS](/lib/oxidized/model/ftos.rb) +* FortiGate + * [FortiOS](/lib/oxidized/model/fortios.rb) +* Fujitsu + * [PRIMERGY Blade switch 1/10Gbe](/lib/oxidized/model/fujitsupy.rb) +* GCOM Technologies + * [Broadband Network Platform Software](/lib/oxidized/model/gcombnps.rb) +* Hatteras + * [Hatteras](/lib/oxidized/model/hatteras.rb) +* Hirschmann + * [HiOS](/lib/oxidized/model/hirschmann.rb) +* HP + * [Comware (HP A-series, H3C, 3Com)](/lib/oxidized/model/comware.rb) + * [Procurve](/lib/oxidized/model/procurve.rb) + * [BladeSystem (Onboard Administrator)](/lib/oxidized/model/hpebladesystem.rb) + * [MSA](/lib/oxidized/model/hpemsa.rb) +* Huawei + * [VRP](/lib/oxidized/model/vrp.rb) +* Juniper + * [JunOS](/lib/oxidized/model/junos.rb) + * [ScreenOS (Netscreen)](/lib/oxidized/model/screenos.rb) +* Mellanox + * [MLNX-OS](/lib/oxidized/model/mlnxos.rb) + * [Voltaire](/lib/oxidized/model/voltaire.rb) +* Mikrotik + * [RouterOS](/lib/oxidized/model/routeros.rb) +* Motorola + * [RFS](/lib/oxidized/model/mtrlrfs.rb) +* MRV + * [MasterOS](/lib/oxidized/model/masteros.rb) + * [FiberDriver](/lib/oxidized/model/fiberdriver.rb) +* Netgear + * [Netgear](/lib/oxidized/model/netgear.rb) +* Netonix + * [WISP Switch (As Netonix)](/lib/oxidized/model/netonix.rb) +* Nokia (formerly TiMetra, Alcatel, Alcatel-Lucent) + * [SR OS (TiMOS)](/lib/oxidized/model/timos.rb) +* OneAccess + * [OneOS](/lib/oxidized/model/oneos.rb) +* Opengear + * [Opengear](/lib/oxidized/model/opengear.rb) +* [OPNsense](/lib/oxidized/model/opnsense.rb) +* Palo Alto + * [PANOS](/lib/oxidized/model/panos.rb) +* [PLANET SG/SGS Switches](/lib/oxidized/model/planet.rb) +* [pfSense](/lib/oxidized/model/pfsense.rb) +* Radware + * [AlteonOS](/lib/oxidized/model/alteonos.rb) +* Quanta + * [Quanta / VxWorks 6.6 (1.1.0.8)](/lib/oxidized/model/quantaos.rb) +* Siklu + * [EtherHaul](/lib/oxidized/model/siklu.rb) +* Supermicro + * [Supermicro](/lib/oxidized/model/supermicro.rb) +* Symantec + * [Blue Coat ProxySG / Security Gateway OS (SGOS)](/lib/oxidized/model/sgos.rb) +* Trango Systems + * [Trango](/lib/oxidized/model/trango.rb) +* TPLink + * [TPLink](/lib/oxidized/model/tplink.rb) +* Ubiquiti + * [AirOS](/lib/oxidized/model/airos.rb) + * [Edgeos](/lib/oxidized/model/edgeos.rb) + * [EdgeSwitch](/lib/oxidized/model/edgeswitch.rb) +* Watchguard + * [Fireware OS](/lib/oxidized/model/firewareos.rb) +* Westell + * [Westell 8178G, Westell 8266G](/lib/oxidized/model/weos.rb) +* Zhone + * [Zhone (OLT and MX)](/lib/oxidized/model/zhoneolt.rb) +* Zyxel + * [ZyNOS](/lib/oxidized/model/zynos.rb) -- cgit v1.2.1 From 1d4e44f28fab2567f3f2692b281c4163c0e9f6ba Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Wed, 14 Mar 2018 22:00:25 +0100 Subject: Document the process of extending models --- docs/Extending-Models.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 docs/Extending-Models.md (limited to 'docs') diff --git a/docs/Extending-Models.md b/docs/Extending-Models.md new file mode 100644 index 0000000..4f59f69 --- /dev/null +++ b/docs/Extending-Models.md @@ -0,0 +1,73 @@ +# Extending and Customizing Oxidized Models + +Oxidized supports a growing list of [operating system types](Supported-Os-Types.md). Out of the box, most model implementations collect configuration data. Some implementations also include a conservative set of additional commands that collect basic device information (device make and model, software version, licensing information, ...) which are appended to the configuration as comments. + +A user may wish to extend an existing model to collect the output of additional commands. Oxidized offers smart loading of models in order to facilitate this with ease, without the need to introduce changes to the upstream source code. + +## Extending an existing model with a new command + +The example below can be used to extend the `JunOS` model to collect the output of `show interfaces diagnostics optics` and append the output to the configuration file as a comment. This command retrieves DOM information on pluggable optics present in a `JunOS`-powered chassis. + +Create the file `~/.config/oxidized/model/junos.rb` with the following contents: + +```ruby +require 'oxidized/mode/junos.rb' + + +class JunOS + + + cmd 'show interfaces diagnostics optics' do |cfg| + comment cfg + end + + +end +``` + +Due to smart loading, the user-supplied `~/.config/oxidized/model/junos.rb` file will take precedence over the model with the same name included in Oxidized. The code then uses `require` to load the included model, and extends the class defined therein with an additional command. + +Intuitively, it is also possible to: + +* Completely re-define an existing model by creating a file in `~/.config/oxidized/model/` with the same name as an existing model, but not `require`-ing the upstream model file. +* Create a named variation of an existing model, by creating a file with a new name (such as `~/.config/oxidized/model/junos-extra.rb`), Then `require` the original model and extend its base class as in the above example. The named variation can then be specified as an OS type for some devices but not others when defining sources. +* Create a completely new model, with a new name, for a new operating system type. + +## Advanced features + +The loosely-coupled architecture of Oxidized allows for easy extensibility in more advanced use cases as well. + +The example below extends the functionality of the `JunOS` model further to collect `display set` formatted configuration from the device, and utilizes the multi-output functionality of the `git` output to place the returned configuration in a separate file within a git repository. + +It is possible to configure the `git` output to create new subdirectories under an existing repository instead of creating new repositories for each new defined output type (the default) by including the following configuration in the `~/.config/oxidized/config` file: + +```yaml +output: + git: + type_as_directory: true +``` + +Then, `~/.config/oxidized/model/junos.rb` is adapted as following: + +```ruby +require 'oxidized/mode/junos.rb' + + +class JunOS + + + cmd 'show interface diagnostic optics' do |cfg| + comment cfg + end + + cmd 'show configuration | display set' do |cfg| + cfg.type = "junos-set" + cfg.name = "set" + cfg + end + + +end +``` + +The output of the `show configuration | display set` command is marked with a new arbitrary alternative output type, `junos-set`. The `git` output will use the output type to create a new subdirectory by the same name. In this subdirectory, the `git` output will create files with the name `--set` that will contain the output of this command for each device. \ No newline at end of file -- cgit v1.2.1 From 94b6638542d98169f9502089f153c0b5e63b3b5f Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Wed, 14 Mar 2018 22:05:07 +0100 Subject: fix a typo that broke a link within new documentation --- docs/Extending-Models.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/Extending-Models.md b/docs/Extending-Models.md index 4f59f69..0707157 100644 --- a/docs/Extending-Models.md +++ b/docs/Extending-Models.md @@ -1,6 +1,6 @@ # Extending and Customizing Oxidized Models -Oxidized supports a growing list of [operating system types](Supported-Os-Types.md). Out of the box, most model implementations collect configuration data. Some implementations also include a conservative set of additional commands that collect basic device information (device make and model, software version, licensing information, ...) which are appended to the configuration as comments. +Oxidized supports a growing list of [operating system types](Supported-OS-Types.md). Out of the box, most model implementations collect configuration data. Some implementations also include a conservative set of additional commands that collect basic device information (device make and model, software version, licensing information, ...) which are appended to the configuration as comments. A user may wish to extend an existing model to collect the output of additional commands. Oxidized offers smart loading of models in order to facilitate this with ease, without the need to introduce changes to the upstream source code. -- cgit v1.2.1 From f1048f9b9616a2307d0de6c53847d52a16458bb8 Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Wed, 14 Mar 2018 22:14:38 +0100 Subject: rename extending to creating models and correct typos --- docs/Creating-Models.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/Extending-Models.md | 73 ------------------------------------------------ 2 files changed, 73 insertions(+), 73 deletions(-) create mode 100644 docs/Creating-Models.md delete mode 100644 docs/Extending-Models.md (limited to 'docs') diff --git a/docs/Creating-Models.md b/docs/Creating-Models.md new file mode 100644 index 0000000..3c343e6 --- /dev/null +++ b/docs/Creating-Models.md @@ -0,0 +1,73 @@ +# Creating and Extending Oxidized Models + +Oxidized supports a growing list of [operating system types](Supported-OS-Types.md). Out of the box, most model implementations collect configuration data. Some implementations also include a conservative set of additional commands that collect basic device information (device make and model, software version, licensing information, ...) which are appended to the configuration as comments. + +A user may wish to extend an existing model to collect the output of additional commands. Oxidized offers smart loading of models in order to facilitate this with ease, without the need to introduce changes to the upstream source code. + +## Extending an existing model with a new command + +The example below can be used to extend the `JunOS` model to collect the output of `show interfaces diagnostics optics` and append the output to the configuration file as a comment. This command retrieves DOM information on pluggable optics present in a `JunOS`-powered chassis. + +Create the file `~/.config/oxidized/model/junos.rb` with the following contents: + +```ruby +require 'oxidized/model/junos.rb' + + +class JunOS + + + cmd 'show interfaces diagnostics optics' do |cfg| + comment cfg + end + + +end +``` + +Due to smart loading, the user-supplied `~/.config/oxidized/model/junos.rb` file will take precedence over the model with the same name included in Oxidized. The code then uses `require` to load the included model, and extends the class defined therein with an additional command. + +Intuitively, it is also possible to: + +* Completely re-define an existing model by creating a file in `~/.config/oxidized/model/` with the same name as an existing model, but not `require`-ing the upstream model file. +* Create a named variation of an existing model, by creating a file with a new name (such as `~/.config/oxidized/model/junos-extra.rb`), Then `require` the original model and extend its base class as in the above example. The named variation can then be specified as an OS type for some devices but not others when defining sources. +* Create a completely new model, with a new name, for a new operating system type. + +## Advanced features + +The loosely-coupled architecture of Oxidized allows for easy extensibility in more advanced use cases as well. + +The example below extends the functionality of the `JunOS` model further to collect `display set` formatted configuration from the device, and utilizes the multi-output functionality of the `git` output to place the returned configuration in a separate file within a git repository. + +It is possible to configure the `git` output to create new subdirectories under an existing repository instead of creating new repositories for each new defined output type (the default) by including the following configuration in the `~/.config/oxidized/config` file: + +```yaml +output: + git: + type_as_directory: true +``` + +Then, `~/.config/oxidized/model/junos.rb` is adapted as following: + +```ruby +require 'oxidized/model/junos.rb' + + +class JunOS + + + cmd 'show interface diagnostic optics' do |cfg| + comment cfg + end + + cmd 'show configuration | display set' do |cfg| + cfg.type = "junos-set" + cfg.name = "set" + cfg + end + + +end +``` + +The output of the `show configuration | display set` command is marked with a new arbitrary alternative output type, `junos-set`. The `git` output will use the output type to create a new subdirectory by the same name. In this subdirectory, the `git` output will create files with the name `--set` that will contain the output of this command for each device. \ No newline at end of file diff --git a/docs/Extending-Models.md b/docs/Extending-Models.md deleted file mode 100644 index 0707157..0000000 --- a/docs/Extending-Models.md +++ /dev/null @@ -1,73 +0,0 @@ -# Extending and Customizing Oxidized Models - -Oxidized supports a growing list of [operating system types](Supported-OS-Types.md). Out of the box, most model implementations collect configuration data. Some implementations also include a conservative set of additional commands that collect basic device information (device make and model, software version, licensing information, ...) which are appended to the configuration as comments. - -A user may wish to extend an existing model to collect the output of additional commands. Oxidized offers smart loading of models in order to facilitate this with ease, without the need to introduce changes to the upstream source code. - -## Extending an existing model with a new command - -The example below can be used to extend the `JunOS` model to collect the output of `show interfaces diagnostics optics` and append the output to the configuration file as a comment. This command retrieves DOM information on pluggable optics present in a `JunOS`-powered chassis. - -Create the file `~/.config/oxidized/model/junos.rb` with the following contents: - -```ruby -require 'oxidized/mode/junos.rb' - - -class JunOS - - - cmd 'show interfaces diagnostics optics' do |cfg| - comment cfg - end - - -end -``` - -Due to smart loading, the user-supplied `~/.config/oxidized/model/junos.rb` file will take precedence over the model with the same name included in Oxidized. The code then uses `require` to load the included model, and extends the class defined therein with an additional command. - -Intuitively, it is also possible to: - -* Completely re-define an existing model by creating a file in `~/.config/oxidized/model/` with the same name as an existing model, but not `require`-ing the upstream model file. -* Create a named variation of an existing model, by creating a file with a new name (such as `~/.config/oxidized/model/junos-extra.rb`), Then `require` the original model and extend its base class as in the above example. The named variation can then be specified as an OS type for some devices but not others when defining sources. -* Create a completely new model, with a new name, for a new operating system type. - -## Advanced features - -The loosely-coupled architecture of Oxidized allows for easy extensibility in more advanced use cases as well. - -The example below extends the functionality of the `JunOS` model further to collect `display set` formatted configuration from the device, and utilizes the multi-output functionality of the `git` output to place the returned configuration in a separate file within a git repository. - -It is possible to configure the `git` output to create new subdirectories under an existing repository instead of creating new repositories for each new defined output type (the default) by including the following configuration in the `~/.config/oxidized/config` file: - -```yaml -output: - git: - type_as_directory: true -``` - -Then, `~/.config/oxidized/model/junos.rb` is adapted as following: - -```ruby -require 'oxidized/mode/junos.rb' - - -class JunOS - - - cmd 'show interface diagnostic optics' do |cfg| - comment cfg - end - - cmd 'show configuration | display set' do |cfg| - cfg.type = "junos-set" - cfg.name = "set" - cfg - end - - -end -``` - -The output of the `show configuration | display set` command is marked with a new arbitrary alternative output type, `junos-set`. The `git` output will use the output type to create a new subdirectory by the same name. In this subdirectory, the `git` output will create files with the name `--set` that will contain the output of this command for each device. \ No newline at end of file -- cgit v1.2.1 From ce0216fde8cdf562be4cc9d39aba2cf003d3c7f6 Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Fri, 16 Mar 2018 16:19:21 +0100 Subject: documentation touch-ups and issue #1218 --- docs/Creating-Models.md | 2 +- docs/Model-Notes/VRP-Huawei.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/Creating-Models.md b/docs/Creating-Models.md index 3c343e6..d7a8155 100644 --- a/docs/Creating-Models.md +++ b/docs/Creating-Models.md @@ -1,4 +1,4 @@ -# Creating and Extending Oxidized Models +# Creating and Extending Models Oxidized supports a growing list of [operating system types](Supported-OS-Types.md). Out of the box, most model implementations collect configuration data. Some implementations also include a conservative set of additional commands that collect basic device information (device make and model, software version, licensing information, ...) which are appended to the configuration as comments. diff --git a/docs/Model-Notes/VRP-Huawei.md b/docs/Model-Notes/VRP-Huawei.md index e68a959..a5c0c99 100644 --- a/docs/Model-Notes/VRP-Huawei.md +++ b/docs/Model-Notes/VRP-Huawei.md @@ -30,4 +30,6 @@ Command 2 and 3 can be executed without issues, but 1 and 4 are only available f Oxidized can now retrieve your configuration! +Caveat: Some versions of VRP default to appending a timestamp prior to the output of each `display` command, which will lead to superfluous updates. The configuration statement `timestamp disable` can be used to disable this functionality. (Issue #1218) + Back to [Model-Notes](README.md) -- cgit v1.2.1 From 720facc6f80d2b977d73b944c81c63b6d95e768b Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Fri, 16 Mar 2018 20:31:09 +0100 Subject: improve spelling in docs --- docs/Configuration.md | 2 +- docs/Hooks.md | 4 ++-- docs/Model-Notes/AireOS.md | 2 +- docs/Model-Notes/Comware.md | 2 +- docs/Model-Notes/README.md | 4 ++-- docs/Model-Notes/VRP-Huawei.md | 2 +- docs/Sources.md | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) (limited to 'docs') diff --git a/docs/Configuration.md b/docs/Configuration.md index 59e3f6d..6bbbb61 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -54,7 +54,7 @@ The above strips out snmp community strings from your saved configs. ## Disabling SSH exec channels -Oxidized uses exec channels to make information extraction simpler, but there are some situations where this doesn't work well, e.g. configuring devices. This feature can be turned off by setting the `ssh_no_exec` +Oxidized uses exec channels to make information extraction simpler, but there are some situations where this doesn't work well, e.g. configuring devices. This feature can be turned off by setting the `ssh_no_exec` variable. ```yaml diff --git a/docs/Hooks.md b/docs/Hooks.md index 1d263fb..8a0a8b9 100644 --- a/docs/Hooks.md +++ b/docs/Hooks.md @@ -11,7 +11,7 @@ Following configuration keys need to be defined for all hooks: ### Events -* `node_success`: triggered when configuration is succesfully pulled from a node and right before storing the configuration. +* `node_success`: triggered when configuration is successfully pulled from a node and right before storing the configuration. * `node_fail`: triggered after `retries` amount of failed node pulls. * `post_store`: triggered after node configuration is stored (this is executed only when the configuration has changed). * `nodes_done`: triggered after finished fetching all nodes. @@ -62,7 +62,7 @@ hooks: ### Hook type: 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. +This hook configures the repository `remote` and _push_ the code when the specified event is triggered. If the `username` and `password` are not provided, the `Rugged::Credentials::SshKeyFromAgent` will be used. `githubrepo` hook recognizes following configuration keys: diff --git a/docs/Model-Notes/AireOS.md b/docs/Model-Notes/AireOS.md index 9962f31..5674ae2 100644 --- a/docs/Model-Notes/AireOS.md +++ b/docs/Model-Notes/AireOS.md @@ -1,7 +1,7 @@ Cisco WLC Configuration ======================= -Create a user with read-write privilege : +Create a user with read-write privilege: ```text mgmtuser add oxidized **** read-write diff --git a/docs/Model-Notes/Comware.md b/docs/Model-Notes/Comware.md index 0da019a..e7a2198 100644 --- a/docs/Model-Notes/Comware.md +++ b/docs/Model-Notes/Comware.md @@ -1,7 +1,7 @@ Comware Configuration ===================== -If you find 3Com comware devices aren't being backed up this may be due to prompt detection not matching because a previous login message is disabled after the first prompt. +If you find 3Com Comware devices aren't being backed up this may be due to prompt detection not matching because a previous login message is disabled after the first prompt. You can disable this on the devices themselves by running this command: diff --git a/docs/Model-Notes/README.md b/docs/Model-Notes/README.md index 8dcabd3..c4b0ed1 100644 --- a/docs/Model-Notes/README.md +++ b/docs/Model-Notes/README.md @@ -1,7 +1,7 @@ Model Notes =========== -This directory contains implemention notes and caveats to assist you in your oxidized deployment. +This directory contains implementation notes and caveats to assist you in your oxidized deployment. Use the table below for more information on the Vendor/Model caveats. @@ -12,6 +12,6 @@ AireOS|[AireOS](AireOS.md)|29 Nov 2017 Arbor Networks|[ArbOS](ArbOS.md)|27 Feb 2018 Huawei|[VRP](VRP-Huawei.md)|17 Nov 2017 Juniper|[MX/QFX/EX/SRX/J Series](JunOS.md)|18 Jan 2018 -Xyzel|[XGS4600 Series](XGS4600-Zyxel.md)|23 Jan 2018 +Zyxel|[XGS4600 Series](XGS4600-Zyxel.md)|23 Jan 2018 If you discover additional caveats or problems please make sure to consult the [GitHub issues for oxidized](https://github.com/ytti/oxidized/issues) known issues. diff --git a/docs/Model-Notes/VRP-Huawei.md b/docs/Model-Notes/VRP-Huawei.md index a5c0c99..ff5426e 100644 --- a/docs/Model-Notes/VRP-Huawei.md +++ b/docs/Model-Notes/VRP-Huawei.md @@ -19,7 +19,7 @@ The commands Oxidized executes are: 3. display device 4. display current-configuration all -Command 2 and 3 can be executed without issues, but 1 and 4 are only available for higher level users. Instead of making Oxidized a read/write user on your device, lower the priviledge-level for commands 1 and 4: +Command 2 and 3 can be executed without issues, but 1 and 4 are only available for higher level users. Instead of making Oxidized a read/write user on your device, lower the privilege-level for commands 1 and 4: ```text system-view diff --git a/docs/Sources.md b/docs/Sources.md index 5599409..6d8e19e 100644 --- a/docs/Sources.md +++ b/docs/Sources.md @@ -2,7 +2,7 @@ ## Source: CSV -One line per device, colon seperated. If `ip` isn't present, a DNS lookup will be done against `name`. For large installations, setting `ip` will dramatically reduce startup time. +One line per device, colon separated. If `ip` isn't present, a DNS lookup will be done against `name`. For large installations, setting `ip` will dramatically reduce startup time. ```yaml source: @@ -105,7 +105,7 @@ source: ## Custom SQL Query Support -You may also implement a custom SQL query to retreive the nodelist using SQL syntax with the `query:` configuration parameter under the `sql:` stanza. +You may also implement a custom SQL query to retrieve the nodelist using SQL syntax with the `query:` configuration parameter under the `sql:` stanza. ### Custom SQL Query Examples -- cgit v1.2.1 From 9862cff359d6abc7bdc260600acd293d2d85dd2b Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Sat, 17 Mar 2018 13:04:20 +0100 Subject: restore dev comment of @tobbez to aricentiss model --- docs/Supported-OS-Types.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index 2e1de7c..1717284 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -141,8 +141,7 @@ * Supermicro * [SSE-G2252, G2252P](/lib/oxidized/model/edgecos.rb) * [SSE-G48-TG4, G24-TG4](/lib/oxidized/model/aricentiss.rb) - * [SSE-X24S, X24SR, X3348S, X3348SR, X3348T, - * X3348TR](/lib/oxidized/model/aricentiss.rb) + * [SSE-X24S, X24SR, X3348S, X3348SR, X3348T, X3348TR](/lib/oxidized/model/aricentiss.rb) * [SBM-GEM-X2C, GEM-X2C+, GEM-X3S+, XEM-X10SM](/lib/oxidized/model/aricentiss.rb) * Symantec * [Blue Coat ProxySG / Security Gateway OS (SGOS)](/lib/oxidized/model/sgos.rb) -- cgit v1.2.1 From d3c96a04c15ff0c6cae00d0721a6f5216357207f Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Sat, 17 Mar 2018 17:49:18 +0100 Subject: transition timos to sros --- docs/Supported-OS-Types.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index 1717284..493918d 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -10,7 +10,7 @@ * [AOS](/lib/oxidized/model/aos.rb) * [AOS7](/lib/oxidized/model/aos7.rb) * [ISAM](/lib/oxidized/model/isam.rb) - * [SR OS (Formerly TiMOS)](/lib/oxidized/model/timos.rb) + * [SR OS (Formerly TiMOS)](/lib/oxidized/model/sros.rb) * Wireless * Allied Telesis * [Alliedware Plus](/lib/oxidized/model/awplus.rb) @@ -122,7 +122,7 @@ * Netonix * [WISP Switch (As Netonix)](/lib/oxidized/model/netonix.rb) * Nokia (formerly TiMetra, Alcatel, Alcatel-Lucent) - * [SR OS (TiMOS)](/lib/oxidized/model/timos.rb) + * [SR OS (TiMOS)](/lib/oxidized/model/sros.rb) * OneAccess * [OneOS](/lib/oxidized/model/oneos.rb) * Opengear -- cgit v1.2.1 From 3f8bd19e144d026d0d14ed0f26a6c7c2339bd17a Mon Sep 17 00:00:00 2001 From: Ilya Demyanov Date: Thu, 5 Apr 2018 19:06:23 +0300 Subject: docs: Fixed the link to SNR model --- docs/Supported-OS-Types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index 5240297..7a765f8 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -139,7 +139,7 @@ * Siklu * [EtherHaul](/lib/oxidized/model/siklu.rb) * SNR - * [SNR-S300G, S2xxx, S3xxx, S4xxx](/lib/oxidized/dcnos.rb) + * [SNR-S300G, S2xxx, S3xxx, S4xxx](/lib/oxidized/model/dcnos.rb) * Supermicro * [SSE-G2252, G2252P](/lib/oxidized/model/edgecos.rb) * [SSE-G48-TG4, G24-TG4](/lib/oxidized/model/aricentiss.rb) -- cgit v1.2.1 From 30894a5015e6ce780096bd965493913133197c14 Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Sat, 7 Apr 2018 01:49:05 +0200 Subject: extend githubrepo documentation --- docs/Hooks.md | 51 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 15 deletions(-) (limited to 'docs') diff --git a/docs/Hooks.md b/docs/Hooks.md index 8a0a8b9..b582a2f 100644 --- a/docs/Hooks.md +++ b/docs/Hooks.md @@ -9,7 +9,7 @@ Following configuration keys need to be defined for all hooks: * `events`: which events to subscribe. Needs to be an array. See below for the list of available events. * `type`: what hook class to use. See below for the list of available hook types. -### Events +## Events * `node_success`: triggered when configuration is successfully pulled from a node and right before storing the configuration. * `node_fail`: triggered after `retries` amount of failed node pulls. @@ -44,7 +44,7 @@ Exec hook recognizes following configuration keys: * `async`: influences whether main thread will wait for the command execution. Set this true for long running commands so node pull is not blocked. Default: false * `cmd`: command to run. -## exec hook configuration example +### exec hook configuration example ```yaml hooks: @@ -60,21 +60,29 @@ hooks: timeout: 120 ``` -### Hook type: githubrepo +## Hook type: githubrepo -This hook configures the repository `remote` and _push_ the code when the specified event is triggered. If the `username` and `password` are not provided, the `Rugged::Credentials::SshKeyFromAgent` will be used. +The `githubrepo` hook executes a `git push` to a configured `remote_repo` when the specified event is triggered. -`githubrepo` hook recognizes following configuration keys: +Several authentication methods are supported: + +* Provide a `password` for username + password authentication +* Provide both a `publickey` and a `privatekey` for ssh key-based authentication +* Don't provide any credentials for ssh-agent authentication + +The username will be set to the relevant part of the `remote_repo` URI, with a fallback to `git`. It is also possible to provide one by setting the `username` configuration key. + +For ssh key-based authentication, it is possible to set the environment variable `OXIDIZED_SSH_PASSPHRASE` to a passphrase if the private key requires it. + +`githubrepo` hook recognizes the 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. +* `publickey`: public key for repository auth. +* `privatekey`: private key for repository auth. -It is also possible to set the environment variable `OXIDIZED_SSH_PASSPHRASE` to a passphrase if your keypair requires it. - -When using groups repositories, each group must have its own `remote` in the `remote_repo` config. +When using groups, each group must have a unique entry in the `remote_repo` config. ```yaml hooks: @@ -85,7 +93,9 @@ hooks: firewalls: git@git.intranet:oxidized/firewalls.git ``` -## githubrepo hook configuration example +### githubrepo hook configuration example + +Authenticate with the username `git` and a password: ```yaml hooks: @@ -93,10 +103,21 @@ hooks: type: githubrepo events: [post_store] remote_repo: git@git.intranet:oxidized/test.git - username: user password: pass ``` +Authenticate with the username `git` and an ssh key: + +```yaml +hooks: + push_to_remote: + type: githubrepo + events: [post_store] + remote_repo: git@git.intranet:oxidized/test.git + publickey: /root/.ssh/id_rsa.pub + privatekey: /root/.ssh/id_rsa +``` + ## Hook type: awssns The `awssns` hook publishes messages to AWS SNS topics. This allows you to notify other systems of device configuration changes, for example a config orchestration pipeline. Multiple services can subscribe to the same AWS topic. @@ -108,7 +129,7 @@ Fields sent in the message: * `model`: Model name (e.g. `eos`) * `node`: Device hostname -## awssns hook configuration example +### awssns hook configuration example ```yaml hooks: @@ -136,7 +157,7 @@ You will need to manually install the `slack-api` gem on your system: gem install slack-api ``` -## slackdiff hook configuration example +### slackdiff hook configuration example ```yaml hooks: @@ -172,7 +193,7 @@ You will need to manually install the `xmpp4r` gem on your system: gem install xmpp4r ``` -## xmppdiff hook configuration example +### xmppdiff hook configuration example ```yaml hooks: -- cgit v1.2.1 From bb7b89f0db0c73650e0d1ac035d8441a0cb2e94f Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Sat, 7 Apr 2018 01:57:08 +0200 Subject: improve githubrepo auth example --- docs/Hooks.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/Hooks.md b/docs/Hooks.md index b582a2f..fb80a19 100644 --- a/docs/Hooks.md +++ b/docs/Hooks.md @@ -95,7 +95,7 @@ hooks: ### githubrepo hook configuration example -Authenticate with the username `git` and a password: +Authenticate with a username and a password: ```yaml hooks: @@ -103,6 +103,7 @@ hooks: type: githubrepo events: [post_store] remote_repo: git@git.intranet:oxidized/test.git + username: user password: pass ``` -- cgit v1.2.1 From b29550ce0cfaf6192652747d340da2dc777ac22b Mon Sep 17 00:00:00 2001 From: Zsolt Zsiros Date: Mon, 16 Apr 2018 14:48:43 +0200 Subject: model: netgear.rb support for older models (#1268) * Added support for older models (FW 5.x.y.z like on GS110TP, GS748Tv4, etc) * Fixed prompt regex * docs/Model-Notes/Netgear created * docs/Model-Notes/Netgear fixed typos --- docs/Model-Notes/Netgear.md | 66 +++++++++++++++++++++++++++++++++++++++++++++ docs/Model-Notes/README.md | 1 + 2 files changed, 67 insertions(+) create mode 100644 docs/Model-Notes/Netgear.md (limited to 'docs') diff --git a/docs/Model-Notes/Netgear.md b/docs/Model-Notes/Netgear.md new file mode 100644 index 0000000..9bfd094 --- /dev/null +++ b/docs/Model-Notes/Netgear.md @@ -0,0 +1,66 @@ +Netgear Configuration +===================== + +There are several models available with CLI management via telnet (port 60000), but they all behave like one of the following: +- older models: +``` +Connected to 192.168.3.201. + +(GS748Tv4) +Applying Interface configuration, please wait ...admin +Password:******** +(GS748Tv4) >enable +Password: + +(GS748Tv4) #terminal length 0 + +(GS748Tv4) #show running-config +``` + +- newer models: +``` +Connected to 172.0.3.203. + +User:admin +Password:******** +(GS724Tv4) >enable + +(GS724Tv4) #terminal length 0 + +(GS724Tv4) #show running-config +``` + +The main differences are: +- the prompt for username is different (looks quite strange for older models) +- enable password + - the older model prompts for enable password and it expects empty string + - the newer model does not prompt for enable password at all + +Configuration for older/newer models: make sure you have defined variable 'enable': +- `'true'` for newer models +- `''` empty string: for older models + +One possible configuration: +- oxidized config +``` +source: + default: csv + csv: + file: "/home/oxidized/.config/oxidized/router.db" + delimiter: !ruby/regexp /:/ + map: + name: 0 + model: 1 + username: 2 + password: 3 + vars_map: + enable: 4 + telnet_port: 5 +``` +- router.db +``` +switchOldFW:netgear:admin:adminpw::60000 +switchNewFW:netgear:admin:adminpw:true:60000 +``` + +[Reference](https://github.com/ytti/oxidized/pull/1268) \ No newline at end of file diff --git a/docs/Model-Notes/README.md b/docs/Model-Notes/README.md index c4b0ed1..fd1298e 100644 --- a/docs/Model-Notes/README.md +++ b/docs/Model-Notes/README.md @@ -12,6 +12,7 @@ AireOS|[AireOS](AireOS.md)|29 Nov 2017 Arbor Networks|[ArbOS](ArbOS.md)|27 Feb 2018 Huawei|[VRP](VRP-Huawei.md)|17 Nov 2017 Juniper|[MX/QFX/EX/SRX/J Series](JunOS.md)|18 Jan 2018 +Netgear|[Netgear](Netgear.md)|11 Apr 2018 Zyxel|[XGS4600 Series](XGS4600-Zyxel.md)|23 Jan 2018 If you discover additional caveats or problems please make sure to consult the [GitHub issues for oxidized](https://github.com/ytti/oxidized/issues) known issues. -- cgit v1.2.1 From 12c770dd3504748d3e67f99175b26d0515a3d283 Mon Sep 17 00:00:00 2001 From: Yuri Zubov Date: Thu, 19 Apr 2018 14:19:41 +0300 Subject: Basic support for NDMS OS (Zyxel Keenetic) --- docs/Supported-OS-Types.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index 7a765f8..4556946 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -163,3 +163,4 @@ * [Zhone (OLT and MX)](/lib/oxidized/model/zhoneolt.rb) * Zyxel * [ZyNOS](/lib/oxidized/model/zynos.rb) + * [NDMS](/lib/oxidized/model/ndms.rb) -- cgit v1.2.1 From ffd4cc1569df3a9ad5c1ac453861544762ac4853 Mon Sep 17 00:00:00 2001 From: ytti Date: Mon, 23 Apr 2018 15:44:00 +0300 Subject: Fix Brocade links Fixes #1302 --- docs/Supported-OS-Types.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index 4556946..8839cc3 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -32,12 +32,12 @@ * [VOSS (VSP Operating System Software)](/lib/oxidized/model/voss.rb) * [BOSS (Baystack Operating System Software)](/lib/oxidized/model/boss.rb) * Brocade - * [FabricOS](lib/oxidized/model/fabricos.rb) - * [Ironware](lib/oxidized/model/ironware.rb) - * [NOS (Network Operating System)](lib/oxidized/model/nos.rb) - * [Vyatta](lib/oxidized/model/vyatta.rb) - * [6910](lib/oxidized/model/br6910.rb) - * [SLX-OS](lib/oxidized/model/slxos.rb) + * [FabricOS](/lib/oxidized/model/fabricos.rb) + * [Ironware](/lib/oxidized/model/ironware.rb) + * [NOS (Network Operating System)](/lib/oxidized/model/nos.rb) + * [Vyatta](/lib/oxidized/model/vyatta.rb) + * [6910](/lib/oxidized/model/br6910.rb) + * [SLX-OS](/lib/oxidized/model/slxos.rb) * Casa * [Casa](/lib/oxidized/model/casa.rb) * Check Point -- cgit v1.2.1 From cb002959bfc776de117f2353041e9d40aa486585 Mon Sep 17 00:00:00 2001 From: Jason Ackley Date: Tue, 24 Apr 2018 10:07:51 -0500 Subject: Add a note about database engine reserved keywords. --- docs/Sources.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/Sources.md b/docs/Sources.md index 6d8e19e..eb3cd0c 100644 --- a/docs/Sources.md +++ b/docs/Sources.md @@ -59,6 +59,9 @@ pinentry-mode loopback Oxidized uses the `sequel` ruby gem. You can use a variety of databases that aren't explicitly listed. For more information visit https://github.com/jeremyevans/sequel Make sure you have the correct adapter! +**NOTE** - Many database engines have reserved keywords that may conflict with Oxidized configuration field names (such as 'name', 'group', etc). Pay attention to any names that are used and observed proper quoting methods to avoid errors or unpredictable results. + + ## Source: MYSQL `sudo apt-get install libmysqlclient-dev` -- cgit v1.2.1 From 6d9181ae1a191a9e4bfc028edfd3c5b5d0435d0e Mon Sep 17 00:00:00 2001 From: Jason Ackley Date: Tue, 24 Apr 2018 10:08:58 -0500 Subject: Consistency - add a link back to Model-Notes at the bottom --- docs/Model-Notes/ArbOS.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/Model-Notes/ArbOS.md b/docs/Model-Notes/ArbOS.md index f68467f..ebac997 100644 --- a/docs/Model-Notes/ArbOS.md +++ b/docs/Model-Notes/ArbOS.md @@ -8,3 +8,5 @@ If you are running ArbOS version 7 or lower then you may need to update the mode pre_logout 'exit' end ``` + +Back to [Model-Notes](README.md) -- cgit v1.2.1 From ffbc250f019fadabb7fd26b046c2a2e8e235b33c Mon Sep 17 00:00:00 2001 From: Jason Ackley Date: Tue, 24 Apr 2018 10:09:28 -0500 Subject: Consistency - add a link back to Model-Notes at the bottom --- docs/Model-Notes/Comware.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/Model-Notes/Comware.md b/docs/Model-Notes/Comware.md index e7a2198..048f312 100644 --- a/docs/Model-Notes/Comware.md +++ b/docs/Model-Notes/Comware.md @@ -10,3 +10,5 @@ info-center source default channel 1 log state off debug state off ``` [Reference](https://github.com/ytti/oxidized/issues/1171) + +Back to [Model-Notes](README.md) -- cgit v1.2.1 From b6f4c3665b773ae0ba95a9a6084392d47779e8fd Mon Sep 17 00:00:00 2001 From: Jason Ackley Date: Tue, 24 Apr 2018 10:10:06 -0500 Subject: Netgear notes updates Consistency - add a link back to Model-Notes at the bottom Tag a YAML block as YAML for highlighting. --- docs/Model-Notes/Netgear.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/Model-Notes/Netgear.md b/docs/Model-Notes/Netgear.md index 9bfd094..d82bdcc 100644 --- a/docs/Model-Notes/Netgear.md +++ b/docs/Model-Notes/Netgear.md @@ -6,7 +6,7 @@ There are several models available with CLI management via telnet (port 60000), ``` Connected to 192.168.3.201. -(GS748Tv4) +(GS748Tv4) Applying Interface configuration, please wait ...admin Password:******** (GS748Tv4) >enable @@ -42,7 +42,7 @@ Configuration for older/newer models: make sure you have defined variable 'enabl One possible configuration: - oxidized config -``` +```yaml source: default: csv csv: @@ -63,4 +63,6 @@ switchOldFW:netgear:admin:adminpw::60000 switchNewFW:netgear:admin:adminpw:true:60000 ``` -[Reference](https://github.com/ytti/oxidized/pull/1268) \ No newline at end of file +[Reference](https://github.com/ytti/oxidized/pull/1268) + +Back to [Model-Notes](README.md) -- cgit v1.2.1 From d1723993e6048621f6a2428bcba51c1cd17a124e Mon Sep 17 00:00:00 2001 From: Jason Ackley Date: Tue, 24 Apr 2018 10:11:24 -0500 Subject: Ruby-API.md cleanups Refer to things as 'device' versus 'switch' Add some example use case notes for post_login and pre_logout. MD highlight some items in the list for clarity misc text clarity adjustments. --- docs/Ruby-API.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'docs') diff --git a/docs/Ruby-API.md b/docs/Ruby-API.md index 8621870..a9963b3 100644 --- a/docs/Ruby-API.md +++ b/docs/Ruby-API.md @@ -6,7 +6,7 @@ The following objects exist in Oxidized. * gets config from nodes * must implement 'connect', 'get', 'cmd' -* 'ssh', 'telnet, ftp, and tftp' implemented +* 'ssh', 'telnet', 'ftp', and 'tftp' implemented ## Output @@ -18,12 +18,12 @@ The following objects exist in Oxidized. * gets list of nodes to poll * must implement 'load' -* source can have 'name', 'model', 'group', 'username', 'password', 'input', 'output', 'prompt' - * name - name of the devices - * model - model to use ios/junos/xyz, model is loaded dynamically when needed (Also default in config file) - * input - method to acquire config, loaded dynamically as needed (Also default in config file) - * output - method to store config, loaded dynamically as needed (Also default in config file) - * prompt - prompt used for node (Also default in config file, can be specified in model too) +* source can have 'name', 'model', 'group', 'username', 'password', 'input', 'output', 'prompt' for each device. + * `name` - name of the device + * `model` - model to use ('ios', 'junos', etc).The model is loaded dynamically by the first node of that model type. (Also default in config file) + * `input` - method to acquire config, loaded dynamically as needed (Also default in config file) + * `output` - method to store config, loaded dynamically as needed (Also default in config file) + * `prompt` - prompt used for node (Also default in config file, can be specified in model too) * 'sql', 'csv' and 'http' (supports any format with single entry per line, like router.db) ## Model @@ -116,16 +116,20 @@ the password prompt. If not specified, the default of `/^Password/` is used. #### `post_login` Used inside `cfg` invocations to specify commands to run once Oxidized has -logged in to the switch. Takes one argument that is either a block (taking zero +logged in to the device. Takes one argument that is either a block (taking zero parameters) or a string containing a command to execute. +This allows `post_login` to be used for any model-specific items prior to running the regular commands. This could include disabling the output pager or timestamp outputs that would cause constant differences. + #### `pre_logout` Used to specify commands to run before Oxidized closes the connection to the -switch. Takes one argument that is either a block (taking zero parameters) or a +device. Takes one argument that is either a block (taking zero parameters) or a string containing a command to execute. +This allows `pre_logout` to be used to 'undo' any changes that may have been needed via `post_login` (restore pager output, etc.) + #### `send` Usually used inside `expect` or blocks passed to `post_login`/`pre_logout`. -Takes a single parameter: a string to be sent to the switch. +Takes a single parameter: a string to be sent to the device. -- cgit v1.2.1 From e383a573e6c11f7366ce52774e191f7272db114f Mon Sep 17 00:00:00 2001 From: Jason Ackley Date: Tue, 24 Apr 2018 10:13:49 -0500 Subject: Misc Hooks.md cleanups misc text clarity. clarify timeout is in seconds clarity the publickey/privatekey are paths - not the keys themselves. Reorder the AWS SNS example of describing the config before the example config for consistency with the rest. --- docs/Hooks.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'docs') diff --git a/docs/Hooks.md b/docs/Hooks.md index fb80a19..ff430ca 100644 --- a/docs/Hooks.md +++ b/docs/Hooks.md @@ -1,6 +1,6 @@ # Hooks -You can define arbitrary number of hooks that subscribe different events. The hook system is modular and different kind of hook types can be enabled. +You can define an arbitrary number of hooks that subscribe to different events. The hook system is modular and different kind of hook types can be enabled. ## Configuration @@ -38,10 +38,10 @@ OX_REPO_COMMITREF OX_REPO_NAME ``` -Exec hook recognizes following configuration keys: +Exec hook recognizes the following configuration keys: -* `timeout`: hard timeout for the command execution. SIGTERM will be sent to the child process after the timeout has elapsed. Default: 60 -* `async`: influences whether main thread will wait for the command execution. Set this true for long running commands so node pull is not blocked. Default: false +* `timeout`: hard timeout (in seconds) for the command execution. SIGTERM will be sent to the child process after the timeout has elapsed. Default: `60` +* `async`: Execute the command in an asynchronous fashion. The main thread by default will wait for the hook command execution to complete. Set this to `true` for long running commands so node configuration pulls are not blocked. Default: `false` * `cmd`: command to run. ### exec hook configuration example @@ -79,8 +79,8 @@ For ssh key-based authentication, it is possible to set the environment variable * `remote_repo`: the remote repository to be pushed to. * `username`: username for repository auth. * `password`: password for repository auth. -* `publickey`: public key for repository auth. -* `privatekey`: private key for repository auth. +* `publickey`: public key file path for repository auth. +* `privatekey`: private key file path for repository auth. When using groups, each group must have a unique entry in the `remote_repo` config. @@ -95,7 +95,7 @@ hooks: ### githubrepo hook configuration example -Authenticate with a username and a password: +Authenticate with a username and a password without groups in use: ```yaml hooks: @@ -130,6 +130,11 @@ Fields sent in the message: * `model`: Model name (e.g. `eos`) * `node`: Device hostname + +The AWS SNS hook requires the following configuration keys: + +* `region`: AWS Region name +* `topic_arn`: ASN Topic reference ### awssns hook configuration example ```yaml @@ -141,11 +146,6 @@ hooks: topic_arn: arn:aws:sns:us-east-1:1234567:oxidized-test-backup_events ``` -AWS SNS hook requires the following configuration keys: - -* `region`: AWS Region name -* `topic_arn`: ASN Topic reference - Your AWS credentials should be stored in `~/.aws/credentials`. ## Hook type: slackdiff -- cgit v1.2.1 From 7d450963907a76b26c47082b5c482a093ba3a533 Mon Sep 17 00:00:00 2001 From: Jason Ackley Date: Tue, 24 Apr 2018 10:15:45 -0500 Subject: A few Outputs.md textual cleanups misc clarity items --- docs/Outputs.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/docs/Outputs.md b/docs/Outputs.md index 92c672c..fab3bf8 100644 --- a/docs/Outputs.md +++ b/docs/Outputs.md @@ -14,7 +14,7 @@ output: 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: +For a single repository containing all devices: ```yaml output: @@ -25,7 +25,7 @@ output: repo: "/var/lib/oxidized/devices.git" ``` -And for groups repositories: +And for group-based repositories: ```yaml output: @@ -68,7 +68,7 @@ output: This uses the gem git and system git-crypt interfaces. Have a look at [GIT-Crypt](https://www.agwa.name/projects/git-crypt/) documentation to know how to install it. Additionally to user and email informations, you have to provide the users ID that can be a key ID, a full fingerprint, an email address, or anything else that uniquely identifies a public key to GPG (see "HOW TO SPECIFY A USER ID" in the gpg man page). -For a single repositories for all devices: +For a single repository containing all devices: ```yaml output: @@ -82,7 +82,7 @@ output: - "" ``` -And for groups repositories: +And for group-based repositories: ```yaml output: @@ -130,8 +130,9 @@ Please note that user list is only updated once at creation. ## Output: Http -POST a config to the specified URL +The HTTP output will POST a config to the specified HTTP URL. Basic username/password authentication is supported. +Example HTTP output configuration: ```yaml output: default: http @@ -185,4 +186,4 @@ which will result in the following layout diff/$FQDN--show_running_config nodiff/$FQDN--show_version nodiff/$FQDN--show_inventory -``` \ No newline at end of file +``` -- cgit v1.2.1 From 90a84a79279a0bac817ef871a4992e3d7d019cef Mon Sep 17 00:00:00 2001 From: Jason Ackley Date: Tue, 24 Apr 2018 10:16:38 -0500 Subject: Give some examples of smart loading Indicate that it can be used to have local site changes or updated models from the repo. minor text clarity on other items. --- docs/Creating-Models.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/Creating-Models.md b/docs/Creating-Models.md index d7a8155..3cb87c3 100644 --- a/docs/Creating-Models.md +++ b/docs/Creating-Models.md @@ -4,6 +4,8 @@ Oxidized supports a growing list of [operating system types](Supported-OS-Types. A user may wish to extend an existing model to collect the output of additional commands. Oxidized offers smart loading of models in order to facilitate this with ease, without the need to introduce changes to the upstream source code. +This methodology allows local site changes to be preserved during Oxidized version updates / gem updates. + ## Extending an existing model with a new command The example below can be used to extend the `JunOS` model to collect the output of `show interfaces diagnostics optics` and append the output to the configuration file as a comment. This command retrieves DOM information on pluggable optics present in a `JunOS`-powered chassis. @@ -25,13 +27,16 @@ class JunOS end ``` -Due to smart loading, the user-supplied `~/.config/oxidized/model/junos.rb` file will take precedence over the model with the same name included in Oxidized. The code then uses `require` to load the included model, and extends the class defined therein with an additional command. +Due to smart loading, the user-supplied `~/.config/oxidized/model/junos.rb` file will take precedence over the model with the same name included in the Oxidized distribution. + +The code then uses `require` to initially load the Oxidized-supplied model, and extends the class defined therein with an additional command. Intuitively, it is also possible to: * Completely re-define an existing model by creating a file in `~/.config/oxidized/model/` with the same name as an existing model, but not `require`-ing the upstream model file. -* Create a named variation of an existing model, by creating a file with a new name (such as `~/.config/oxidized/model/junos-extra.rb`), Then `require` the original model and extend its base class as in the above example. The named variation can then be specified as an OS type for some devices but not others when defining sources. +* Create a named variation of an existing model, by creating a file with a new name (such as `~/.config/oxidized/model/junos-extra.rb`), Then `require` the original model and extend its base class as in the above example. The named variation can then be specified as an OS type for specific devices that can benefit from the extra functionality. This allows for preservation of the base functionality for the default model types. * Create a completely new model, with a new name, for a new operating system type. +* Testing/validation of an updated model from the [Oxidized GitHub repo models](https://github.com/ytti/oxidized/tree/master/lib/oxidized/model) by placing an updated model in the proper location without disrupting the gem-supplied model files. ## Advanced features @@ -70,4 +75,4 @@ class JunOS end ``` -The output of the `show configuration | display set` command is marked with a new arbitrary alternative output type, `junos-set`. The `git` output will use the output type to create a new subdirectory by the same name. In this subdirectory, the `git` output will create files with the name `--set` that will contain the output of this command for each device. \ No newline at end of file +The output of the `show configuration | display set` command is marked with a new arbitrary alternative output type, `junos-set`. The `git` output will use the output type to create a new subdirectory by the same name. In this subdirectory, the `git` output will create files with the name `--set` that will contain the output of this command for each device. -- cgit v1.2.1 From cdcecd48fd05fecd656f384d074bd06406ac2690 Mon Sep 17 00:00:00 2001 From: Jason Ackley Date: Tue, 24 Apr 2018 10:17:40 -0500 Subject: clarity updates for Configuration doc typo fixes - IP-Adress -> IP-Address remove_secrets -> remove_secret tag a ruby block as ruby for correct highlight misc other small text clarity (ssh_proxy is the proxy information etc) --- docs/Configuration.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'docs') diff --git a/docs/Configuration.md b/docs/Configuration.md index 6bbbb61..661e65a 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -4,7 +4,7 @@ In case a model plugin doesn't work correctly (ios, procurve, etc.), you can enable live debugging of SSH/Telnet sessions. Just add a `debug` option containing the value true to the `input` section. The log files will be created depending on the parent directory of the logfile option. -The following example will log an active ssh/telnet session `/home/oxidized/.config/oxidized/log/-`. The file will be truncated on each consecutive ssh/telnet session, so you need to put a `tailf` or `tail -f` on that file! +The following example will log an active ssh/telnet session `/home/oxidized/.config/oxidized/log/-`. The file will be truncated on each consecutive ssh/telnet session, so you need to put a `tailf` or `tail -f` on that file! ```yaml log: /home/oxidized/.config/oxidized/log @@ -29,18 +29,18 @@ vars: ## Removing secrets -To strip out secrets from configurations before storing them, Oxidized needs the the remove_secrets flag. You can globally enable this by adding the following snippet to the global sections of the configuration file. +To strip out secrets from configurations before storing them, Oxidized needs the `remove_secret` flag. You can globally enable this by adding the following snippet to the global section of the configuration file. ```yaml vars: remove_secret: true ``` -Device models can contain substitution filters to remove potentially sensitive data from configs. +Device models that contain substitution filters to remove sensitive data will now be run on any fetched configuration. As a partial example from ios.rb: -```yaml +```ruby cmd :secret do |cfg| cfg.gsub! /^(snmp-server community).*/, '\\1 ' (...) @@ -64,7 +64,11 @@ vars: ## SSH Proxy Command -Oxidized can `ssh` through a proxy as well. To do so we just need to set `ssh_proxy` variable. +Oxidized can `ssh` through a proxy as well. To do so we just need to set `ssh_proxy` variable with the proxy host information. + +This can be provided on a per-node basis by mapping the proper fields from your source. + +An example for a `csv` input source that maps the 4th field as the `ssh_proxy` value. ```yaml ... @@ -79,7 +83,7 @@ vars_map: ## FTP Passive Mode -Oxidized uses ftp passive mode by default. Some devices require passive mode to be disabled. To do so, we can set `input.ftp.passive` to false +Oxidized uses ftp passive mode by default. Some devices require passive mode to be disabled. To do so, we can set `input.ftp.passive` to false - this will make use of FTP active mode. ```yaml input: @@ -192,10 +196,12 @@ rest: 10.0.0.1:8000/oxidized ## Triggered backups -A node can be moved to head-of-queue via the REST API `GET/POST /node/next/[NODE]`. +A node can be moved to head-of-queue via the REST API `GET/POST /node/next/[NODE]`. This can be useful to immediately schedule a fetch of the configuration after some other event such as a syslog message indicating a configuration update on the device. -In the default configuration this node will be processed when the next job worker becomes available, it could take some time if existing backups are in progress. To execute moved jobs immediately a new job can be added: +In the default configuration this node will be processed when the next job worker becomes available, it could take some time if existing backups are in progress. To execute moved jobs immediately a new job can be added automatically: ```yaml next_adds_job: true ``` + +This will allow for a more timely fetch of the device configuration. -- cgit v1.2.1