From d5370793448660d0feda249da6104a9d294e055d Mon Sep 17 00:00:00 2001 From: laf Date: Fri, 29 Sep 2017 20:52:00 +0100 Subject: Added help section to docs --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ee0b426..17b305b 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,8 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen * [Advanced Configuration](docs/Configuration.md#advanced-configuration) * [Advanced Group Configuration](docs/Configuration.md#advanced-group-configuration) * [Hooks](docs/Hooks.md) -5. [Ruby API](docs/Ruby-API.md#ruby-api) +5. [Help](#help) +6. [Ruby API](docs/Ruby-API.md#ruby-api) * [Input](docs/Ruby-API.md#input) * [Output](docs/Ruby-API.md#output) * [Source](docs/Ruby-API.md#source) @@ -297,6 +298,14 @@ chown oxidized:oxidized /var/run/oxidized update-rc.d oxidized defaults ``` +# Help + +If you need help with Oxidized then we have a few methods you can use to get in touch. + + - [Gitter](https://gitter.im/oxidized/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - You can join the Lobby on gitter to chat to other Oxidized users. + - [GitHub](https://github.com/ytti/oxidized/) - For help and requests for code changes / updates. + - [Forum](https://community.librenms.org/c/help/oxidized) - A user forum run by [LibreNMS](https://github.com/librenms/librenms) where you can ask for help and support. + # Help Needed As things stand right now, `oxidized` is maintained by a single person. A great -- cgit v1.2.1 From 99590928ce1f704ea04ac305843ffd34031a833f Mon Sep 17 00:00:00 2001 From: Denver Abrey Date: Tue, 10 Oct 2017 15:43:42 +0200 Subject: Add haproxy example --- extra/oxidized.haproxy | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 extra/oxidized.haproxy diff --git a/extra/oxidized.haproxy b/extra/oxidized.haproxy new file mode 100644 index 0000000..91b76b2 --- /dev/null +++ b/extra/oxidized.haproxy @@ -0,0 +1,45 @@ +global + log /dev/log local0 + log /dev/log local1 notice + chroot /var/lib/haproxy + stats socket /run/haproxy/admin.sock mode 660 level admin + stats timeout 30s + user haproxy + group haproxy + daemon + + # Default SSL material locations + ca-base /etc/ssl/certs + crt-base /etc/ssl/private + + # Default ciphers to use on SSL-enabled listening sockets. + # For more information, see ciphers(1SSL). This list is from: + # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/ + ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS + ssl-default-bind-options no-sslv3 + +defaults + log global + mode http + option httplog + option dontlognull + timeout connect 5000 + timeout client 50000 + timeout server 50000 + errorfile 400 /etc/haproxy/errors/400.http + errorfile 403 /etc/haproxy/errors/403.http + errorfile 408 /etc/haproxy/errors/408.http + errorfile 500 /etc/haproxy/errors/500.http + errorfile 502 /etc/haproxy/errors/502.http + errorfile 503 /etc/haproxy/errors/503.http + errorfile 504 /etc/haproxy/errors/504.http + +frontend oxidized + bind *:80 + mode http + default_backend oxidized + compression algo gzip + compression type text/html text/plain text/css + +backend oxidized + server o1 127.0.0.1:8080 -- cgit v1.2.1 From 3541dc0d81f3efbfe1f5274fa8ccb96ee42d7d11 Mon Sep 17 00:00:00 2001 From: Denver Abrey Date: Wed, 11 Oct 2017 16:18:06 +0200 Subject: Rename haproxy example --- extra/oxidized-ubuntu.haproxy | 45 +++++++++++++++++++++++++++++++++++++++++++ extra/oxidized.haproxy | 45 ------------------------------------------- 2 files changed, 45 insertions(+), 45 deletions(-) create mode 100644 extra/oxidized-ubuntu.haproxy delete mode 100644 extra/oxidized.haproxy diff --git a/extra/oxidized-ubuntu.haproxy b/extra/oxidized-ubuntu.haproxy new file mode 100644 index 0000000..91b76b2 --- /dev/null +++ b/extra/oxidized-ubuntu.haproxy @@ -0,0 +1,45 @@ +global + log /dev/log local0 + log /dev/log local1 notice + chroot /var/lib/haproxy + stats socket /run/haproxy/admin.sock mode 660 level admin + stats timeout 30s + user haproxy + group haproxy + daemon + + # Default SSL material locations + ca-base /etc/ssl/certs + crt-base /etc/ssl/private + + # Default ciphers to use on SSL-enabled listening sockets. + # For more information, see ciphers(1SSL). This list is from: + # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/ + ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS + ssl-default-bind-options no-sslv3 + +defaults + log global + mode http + option httplog + option dontlognull + timeout connect 5000 + timeout client 50000 + timeout server 50000 + errorfile 400 /etc/haproxy/errors/400.http + errorfile 403 /etc/haproxy/errors/403.http + errorfile 408 /etc/haproxy/errors/408.http + errorfile 500 /etc/haproxy/errors/500.http + errorfile 502 /etc/haproxy/errors/502.http + errorfile 503 /etc/haproxy/errors/503.http + errorfile 504 /etc/haproxy/errors/504.http + +frontend oxidized + bind *:80 + mode http + default_backend oxidized + compression algo gzip + compression type text/html text/plain text/css + +backend oxidized + server o1 127.0.0.1:8080 diff --git a/extra/oxidized.haproxy b/extra/oxidized.haproxy deleted file mode 100644 index 91b76b2..0000000 --- a/extra/oxidized.haproxy +++ /dev/null @@ -1,45 +0,0 @@ -global - log /dev/log local0 - log /dev/log local1 notice - chroot /var/lib/haproxy - stats socket /run/haproxy/admin.sock mode 660 level admin - stats timeout 30s - user haproxy - group haproxy - daemon - - # Default SSL material locations - ca-base /etc/ssl/certs - crt-base /etc/ssl/private - - # Default ciphers to use on SSL-enabled listening sockets. - # For more information, see ciphers(1SSL). This list is from: - # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/ - ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS - ssl-default-bind-options no-sslv3 - -defaults - log global - mode http - option httplog - option dontlognull - timeout connect 5000 - timeout client 50000 - timeout server 50000 - errorfile 400 /etc/haproxy/errors/400.http - errorfile 403 /etc/haproxy/errors/403.http - errorfile 408 /etc/haproxy/errors/408.http - errorfile 500 /etc/haproxy/errors/500.http - errorfile 502 /etc/haproxy/errors/502.http - errorfile 503 /etc/haproxy/errors/503.http - errorfile 504 /etc/haproxy/errors/504.http - -frontend oxidized - bind *:80 - mode http - default_backend oxidized - compression algo gzip - compression type text/html text/plain text/css - -backend oxidized - server o1 127.0.0.1:8080 -- cgit v1.2.1 From 25dd702d92721e69dc4185205ad7bd7b65adf0ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20Lindsj=C3=B6?= Date: Fri, 20 Oct 2017 08:48:39 +0200 Subject: Fixed ever-changing output in fiberdriver model --- lib/oxidized/model/fiberdriver.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oxidized/model/fiberdriver.rb b/lib/oxidized/model/fiberdriver.rb index abe8f68..7cfa847 100644 --- a/lib/oxidized/model/fiberdriver.rb +++ b/lib/oxidized/model/fiberdriver.rb @@ -13,7 +13,7 @@ class FiberDriver < Oxidized::Model cfg.each_line.to_a[3..-1].join cfg.gsub! /^Building configuration.*$/, '' cfg.gsub! /^Current configuration:.*$$/, '' - cfg.gsub! /^! Configuration saved on .*$/, '' + cfg.gsub! /^! Configuration (saved|generated) on .*$/, '' cfg end -- cgit v1.2.1 From a1e36722c4e275318e8cc6a629f8a6c4a50c82e9 Mon Sep 17 00:00:00 2001 From: laf Date: Sat, 21 Oct 2017 20:35:51 +0100 Subject: docs: Fixed the links to the OS files --- docs/Supported-OS-Types.md | 178 ++++++++++++++++++++++----------------------- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index e600040..9176f2e 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -2,148 +2,148 @@ * Vendor * OS model * A10 Networks - * [ACOS](lib/oxidized/model/acos.rb) + * [ACOS](/lib/oxidized/model/acos.rb) * Accedian Performance Elements (NIDs) - * [AEN](lib/oxidized/model/aen.rb) + * [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) + * [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 * Alvarion - * [BreezeACCESS](lib/oxidized/model/alvarion.rb) + * [BreezeACCESS](/lib/oxidized/model/alvarion.rb) * APC - * [AOS](lib/oxidized/model/apc_aos.rb) + * [AOS](/lib/oxidized/model/apc_aos.rb) * Arista - * [EOS](lib/oxidized/model/eos.rb) + * [EOS](/lib/oxidized/model/eos.rb) * Arris - * [C4CMTS](lib/oxidized/model/c4cmts.rb) + * [C4CMTS](/lib/oxidized/model/c4cmts.rb) * Aruba - * [AOSW](lib/oxidized/model/aosw.rb) + * [AOSW](/lib/oxidized/model/aosw.rb) * AudioCodes - * [AudioCodes](lib/oxdized/model/audiocodes.rb) + * [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) + * [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) * Casa - * [Casa](lib/oxidized/model/casa.rb) + * [Casa](/lib/oxidized/model/casa.rb) * Check Point - * [GaiaOS](lib/oxidized/model/gaiaos.rb) + * [GaiaOS](/lib/oxidized/model/gaiaos.rb) * Ciena - * [SAOS](lib/oxidized/model/saos.rb) + * [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) + * [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) + * [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) + * [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) + * [Linux](/lib/oxidized/model/cumulus.rb) * DataCom - * [DmSwitch 3000](lib/oxidized/model/datacom.rb) + * [DmSwitch 3000](/lib/oxidized/model/datacom.rb) * DCN - * [DCN](lib/oxidized/model/ios.rb) - Map this to ios. + * [DCN](/lib/oxidized/model/ios.rb) - Map this to ios. * DELL - * [PowerConnect](lib/oxidized/model/powerconnect.rb) - * [AOSW](lib/oxidized/model/aosw.rb) + * [PowerConnect](/lib/oxidized/model/powerconnect.rb) + * [AOSW](/lib/oxidized/model/aosw.rb) * D-Link - * [D-Link](lib/oxidized/model/dlink.rb) + * [D-Link](/lib/oxidized/model/dlink.rb) * Ericsson/Redback - * [IPOS (former SEOS)](lib/oxidized/model/ipos.rb) + * [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) + * [WM](/lib/oxidized/model/mtrlrfs.rb) + * [XOS](/lib/oxidized/model/xos.rb) * F5 - * [TMOS](lib/oxidized/model/tmos.rb) + * [TMOS](/lib/oxidized/model/tmos.rb) * Force10 - * [DNOS](lib/oxidized/model/dnos.rb) - * [FTOS](lib/oxidized/model/ftos.rb) + * [DNOS](/lib/oxidized/model/dnos.rb) + * [FTOS](/lib/oxidized/model/ftos.rb) * FortiGate - * [FortiOS](lib/oxidized/model/fortios.rb) + * [FortiOS](/lib/oxidized/model/fortios.rb) * Fujitsu - * [PRIMERGY Blade switch 1/10Gbe](lib/oxidized/model/fujitsupy.rb) + * [PRIMERGY Blade switch 1/10Gbe](/lib/oxidized/model/fujitsupy.rb) * Hatteras - * [Hatteras](lib/oxidized/model/hatteras.rb) + * [Hatteras](/lib/oxidized/model/hatteras.rb) * Hirschmann - * [HiOS](lib/oxidized/model/hirschmann.rb) + * [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) + * [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) + * [VRP](/lib/oxidized/model/vrp.rb) * Juniper - * [JunOS](lib/oxidized/model/junos.rb) - * [ScreenOS (Netscreen)](lib/oxidized/model/screenos.rb) + * [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) + * [MLNX-OS](/lib/oxidized/model/mlnxos.rb) + * [Voltaire](/lib/oxidized/model/voltaire.rb) * Mikrotik - * [RouterOS](lib/oxidized/model/routeros.rb) + * [RouterOS](/lib/oxidized/model/routeros.rb) * Motorola - * [RFS](lib/oxidized/model/mtrlrfs.rb) + * [RFS](/lib/oxidized/model/mtrlrfs.rb) * MRV - * [MasterOS](lib/oxidized/model/masteros.rb) - * [FiberDriver](lib/oxidized/model/fiberdriver.rb) + * [MasterOS](/lib/oxidized/model/masteros.rb) + * [FiberDriver](/lib/oxidized/model/fiberdriver.rb) * Netgear - * [Netgear](lib/oxidized/model/netgear.rb) + * [Netgear](/lib/oxidized/model/netgear.rb) * Netonix - * [WISP Switch (As Netonix)](lib/oxidized/model/netonix.rb) + * [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/timos.rb) * OneAccess - * [OneOS](lib/oxidized/model/oneos.rb) + * [OneOS](/lib/oxidized/model/oneos.rb) * Opengear - * [Opengear](lib/oxidized/model/opengear.rb) + * [Opengear](/lib/oxidized/model/opengear.rb) * Palo Alto - * [PANOS](lib/oxidized/model/panos.rb) - * [PLANET SG/SGS Switches](lib/oxidized/model/planet.rb) - * [pfSense](lib/oxidized/model/pfsense.rb) + * [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) + * [AlteonOS](/lib/oxidized/model/alteonos.rb) * Quanta - * [Quanta / VxWorks 6.6 (1.1.0.8)](lib/oxidized/model/quantaos.rb) + * [Quanta / VxWorks 6.6 (1.1.0.8)](/lib/oxidized/model/quantaos.rb) * Siklu - * [EtherHaul](lib/oxidized/model/siklu.rb) + * [EtherHaul](/lib/oxidized/model/siklu.rb) * Supermicro - * [Supermicro](lib/oxidized/model/supermicro.rb) + * [Supermicro](/lib/oxidized/model/supermicro.rb) * Symantec - * [Blue Coat ProxySG / Security Gateway OS (SGOS)](lib/oxidized/model/sgos.rb) + * [Blue Coat ProxySG / Security Gateway OS (SGOS)](/lib/oxidized/model/sgos.rb) * Trango Systems - * [Trango](lib/oxidized/model/trango.rb) + * [Trango](/lib/oxidized/model/trango.rb) * TPLink - * [TPLink](lib/oxidized/model/tplink.rb) + * [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) + * [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) + * [Fireware OS](/lib/oxidized/model/firewareos.rb) * Westell - * [Westell 8178G, Westell 8266G](lib/oxidized/model/weos.rb) + * [Westell 8178G, Westell 8266G](/lib/oxidized/model/weos.rb) * Zhone - * [Zhone (OLT and MX)](lib/oxidized/model/zhoneolt.rb) + * [Zhone (OLT and MX)](/lib/oxidized/model/zhoneolt.rb) * Zyxel - * [ZyNOS](lib/oxidized/model/zynos.rb) + * [ZyNOS](/lib/oxidized/model/zynos.rb) -- cgit v1.2.1 From b43505e85193c28fbb39689542da229d057524fa Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Wed, 1 Nov 2017 22:18:30 +0000 Subject: release: Bump version to 0.21.0 (#1081) --- Gemfile.lock | 2 +- lib/oxidized/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 229a55c..6ee594f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - oxidized (0.20.0) + oxidized (0.21.0) asetus (~> 0.1) net-ssh (~> 3.0.2) net-telnet (~> 0) diff --git a/lib/oxidized/version.rb b/lib/oxidized/version.rb index 221cffa..9a92133 100644 --- a/lib/oxidized/version.rb +++ b/lib/oxidized/version.rb @@ -1,3 +1,3 @@ module Oxidized - VERSION = '0.20.0' + VERSION = '0.21.0' end -- cgit v1.2.1 From b19721a62aff7112c891ef13ebaa4fa944d6cb5b Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Sun, 5 Nov 2017 20:23:48 +0000 Subject: docs: Added changelog for 0.21.0 (#1085) --- CHANGELOG.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34b192c..7e77026 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,46 @@ +# 0.21.0 +- FEATURE: routeros include system history (@InsaneSplash) +- FEATURE: vrp added support for removing secrets (@bheum) +- FEATURE: hirschmann model (@OCangrand) +- FEATURE: asa added multiple context support (@marnovdm) +- FEATURE: procurve added additional output (@davama) +- FEATURE: Updated git commits to bare repo + drop need for temp dir during clone (@asenci) +- FEATURE: asyncos model (@cd67-usrt) +- FEATURE: ciscosma model (@cd67-usrt) +- FEATURE: procurve added transceiver info (@davama) +- FEATURE: routeros added remove_secret option (@spinza) +- FEATURE: Updated net-ssh version (@Fauli83) +- FEATURE: audiocodes model (@Fauli83) +- FEATURE: Added docs for Huawei VRP devices (@tuxis-ie) +- FEATURE: ciscosmb added radius key detection (@davama) +- FEATURE: radware model (@sfini) +- FEATURE: enterasys model (@koenvdheuvel) +- FEATURE: weos model (@ignaqui) +- FEATURE: hpemsa model (@aschaber1) +- FEATURE: Added nodes_done hook (@danilopopeye) +- FEATURE: ucs model (@WiXZlo) +- FEATURE: acsw model (@sfini) +- FEATURE: aen model (@ZacharyPuls) +- FEATURE: coriantgroove model (@nickhilliard) +- FEATURE: sgos model (@seekerOK) +- FEATURE: powerconnect support password removal (@tobbez) +- FEATURE: Added haproxy example for Ubuntu (@denvera) +- BUGFIX: fiberdriver remove configuration generated on from diff (@emjemj) +- BUGFIX: Fix email pass through (@ZacharyPuls) +- BUGFIX: iosxr suppress timestamp (@ja-frog) +- BUGFIX: ios allow lowercase user/pass prompt (@deepseth) +- BUGFIX: Use git show instead of git diff (@asenci) +- BUGFIX: netgear fixed sending enable password and exit/quit (@candlerb) +- BUGFIX: ironware removed space requirement from password prompt (@crami) +- BUGFIX: dlink removed uptime from diff (@rfdrake) +- BUGFIX: planet removed temp from diff (@flokli) +- BUGFIX: ironware removed fan, temp and flash from diff (@Punicaa) +- BUGFIX: panos changed exit to quit (@goebelmeier) +- BUGFIX: fortios remove FDS address from diffs (@bheum) +- BUGFIX: fortios remove additional secrets from diffs (@brunobritocarvalho) +- BUGFIX: fortios remove IPS URL DB (@brunobritocarvalho) +- BUGFIX: voss remove temperature, power and uptime from diff (@ospfbgp) + # 0.20.0 - FEATURE: gpg support for CSV source (@elmobp) - FEATURE: slackdiff (@natm) -- cgit v1.2.1 From 853480fca54492a38feaa4fa76941e88f54f11a8 Mon Sep 17 00:00:00 2001 From: mortzu Date: Wed, 8 Nov 2017 22:48:51 +0100 Subject: feature: Added hook for XMPP MUC (#951) * Added hook for XMPP MUC * Updated dockerfile * Added timeout to prevent oxidized to stop on XMPP error * Updated README --- Dockerfile | 1 + docs/Hooks.md | 25 ++++++++++++++++++ lib/oxidized/hook/xmppdiff.rb | 60 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 lib/oxidized/hook/xmppdiff.rb diff --git a/Dockerfile b/Dockerfile index a72a925..49ebb6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,7 @@ RUN gem install oxidized-web --no-ri --no-rdoc # dependencies for hooks RUN gem install aws-sdk RUN gem install slack-api +RUN gem install xmpp4r RUN rm -rf /tmp/oxidized diff --git a/docs/Hooks.md b/docs/Hooks.md index 12e3ab7..bf6ea54 100644 --- a/docs/Hooks.md +++ b/docs/Hooks.md @@ -141,3 +141,28 @@ hooks: ``` Note the channel name must be in quotes. + +## Hook type: xmppdiff + +The `xmppdiff` hook posts config diffs to a [XMPP](https://en.wikipedia.org/wiki/XMPP) chatroom of your choice. It only triggers for `post_store` events. + +You will need to manually install the `xmpp4r` gem on your system: + +``` +gem install xmpp4r +``` + +Configuration example: + +``` yaml +hooks: + slack: + type: xmppdiff + events: [post_store] + jid: "user@server.tld/resource" + password: "password" + channel: "room@server.tld" + nick: "nickname" +``` + +Note the channel name must be in quotes. diff --git a/lib/oxidized/hook/xmppdiff.rb b/lib/oxidized/hook/xmppdiff.rb new file mode 100644 index 0000000..396d1b3 --- /dev/null +++ b/lib/oxidized/hook/xmppdiff.rb @@ -0,0 +1,60 @@ +require 'xmpp4r' +require 'xmpp4r/muc/helper/simplemucclient' + +class XMPPDiff < Oxidized::Hook + def validate_cfg! + raise KeyError, 'hook.jid is required' unless cfg.has_key?('jid') + raise KeyError, 'hook.password is required' unless cfg.has_key?('password') + raise KeyError, 'hook.channel is required' unless cfg.has_key?('channel') + raise KeyError, 'hook.nick is required' unless cfg.has_key?('nick') + end + + def run_hook(ctx) + if ctx.node + if ctx.event.to_s == "post_store" + begin + Timeout::timeout(15) do + gitoutput = ctx.node.output.new + diff = gitoutput.get_diff ctx.node, ctx.node.group, ctx.commitref, nil + + interesting = diff[:patch].lines.to_a[4..-1].any? { |line| + ["+", "-"].include?(line[0]) and not ["#", "!"].include?(line[1]) + } + interesting &&= diff[:patch].lines.to_a[5..-1].any? { |line| line[0] == '-' } + interesting &&= diff[:patch].lines.to_a[5..-1].any? { |line| line[0] == '+' } + + if interesting + log "Connecting to XMPP" + client = Jabber::Client.new(Jabber::JID.new(cfg.jid)) + client.connect + sleep 1 + client.auth(cfg.password) + sleep 1 + + log "Connected" + + m = Jabber::MUC::SimpleMUCClient.new(client) + m.join(cfg.channel + "/" + cfg.nick) + + log "Joined" + + title = "#{ctx.node.name.to_s} #{ctx.node.group.to_s} #{ctx.node.model.class.name.to_s.downcase}" + log "Posting diff as snippet to #{cfg.channel}" + + m.say(title + "\n\n" + diff[:patch].lines.to_a[4..-1].join) + + sleep 1 + + client.close + + log "Finished" + + end + end + rescue Timeout::Error + log "timed out" + end + end + end + end +end -- cgit v1.2.1 From aa0e1808f25e5e8b1a76f34c29f2eeb7db75a7c7 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Thu, 9 Nov 2017 22:14:37 +0000 Subject: feature: Slack hook - optionally disable diff snippets and post custom messages (#763) * continue to diffs by default, but optionally post formatted messages * updated readme * remove static channel name * Update Hooks.md --- docs/Hooks.md | 13 +++++++++++++ lib/oxidized/hook/slackdiff.rb | 40 ++++++++++++++++++++++++++++++---------- 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/docs/Hooks.md b/docs/Hooks.md index bf6ea54..ca99034 100644 --- a/docs/Hooks.md +++ b/docs/Hooks.md @@ -140,6 +140,19 @@ hooks: channel: "#network-changes" ``` +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 +hooks: + slack: + type: slackdiff + events: [post_store] + token: SLACK_BOT_TOKEN + channel: "#network-changes" + diff: false + message: "%{node} %{group} %{model} updated https://git.intranet/network-changes/commit/%{commitref}" +``` + Note the channel name must be in quotes. ## Hook type: xmppdiff diff --git a/lib/oxidized/hook/slackdiff.rb b/lib/oxidized/hook/slackdiff.rb index 61f1743..728e5a7 100644 --- a/lib/oxidized/hook/slackdiff.rb +++ b/lib/oxidized/hook/slackdiff.rb @@ -1,5 +1,8 @@ require 'slack' +# defaults to posting a diff, if messageformat is supplied them a message will be posted too +# diffenable defaults to true + class SlackDiff < Oxidized::Hook def validate_cfg! raise KeyError, 'hook.token is required' unless cfg.has_key?('token') @@ -17,16 +20,33 @@ class SlackDiff < Oxidized::Hook client = Slack::Client.new client.auth_test log "Connected" - gitoutput = ctx.node.output.new - diff = gitoutput.get_diff ctx.node, ctx.node.group, ctx.commitref, nil - title = "#{ctx.node.name.to_s} #{ctx.node.group.to_s} #{ctx.node.model.class.name.to_s.downcase}" - log "Posting diff as snippet to #{cfg.channel}" - client.files_upload(channels: cfg.channel, as_user: true, - content: diff[:patch].lines.to_a[4..-1].join, - filetype: "diff", - title: title, - filename: "change" - ) + # diff snippet - default + diffenable = true + if cfg.has_key?('diff') == true + if cfg.diff == false + diffenable = false + end + end + if diffenable == true + gitoutput = ctx.node.output.new + diff = gitoutput.get_diff ctx.node, ctx.node.group, ctx.commitref, nil + title = "#{ctx.node.name.to_s} #{ctx.node.group.to_s} #{ctx.node.model.class.name.to_s.downcase}" + log "Posting diff as snippet to #{cfg.channel}" + client.files_upload(channels: cfg.channel, as_user: true, + content: diff[:patch].lines.to_a[4..-1].join, + filetype: "diff", + title: title, + filename: "change" + ) + end + # message custom formatted - optional + if cfg.has_key?('message') == true + log cfg.message + msg = cfg.message % {:node => ctx.node.name.to_s, :group => ctx.node.group.to_s, :commitref => ctx.commitref, :model => ctx.node.model.class.name.to_s.downcase} + log msg + log "Posting message to #{cfg.channel}" + client.chat_postMessage(channel: cfg.channel, text: msg, as_user: true) + end log "Finished" end end -- cgit v1.2.1 From 97a8e0935f2002a931db8bd8ba48b59cb22b4828 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Thu, 9 Nov 2017 22:17:16 +0000 Subject: Update Hooks.md (#1092) --- docs/Hooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Hooks.md b/docs/Hooks.md index ca99034..7d503a3 100644 --- a/docs/Hooks.md +++ b/docs/Hooks.md @@ -169,7 +169,7 @@ Configuration example: ``` yaml hooks: - slack: + xmpp: type: xmppdiff events: [post_store] jid: "user@server.tld/resource" -- cgit v1.2.1 From f720682514df9f49d35e6ced8af41e5dc789f8e0 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Thu, 9 Nov 2017 22:28:49 +0000 Subject: docs: Added comment to clarify interval value is in seconds (#1093) --- docs/Configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Configuration.md b/docs/Configuration.md index df0caa4..db71bc7 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -83,7 +83,7 @@ Below is an advanced example configuration. You will be able to (optionally) ove username: oxidized password: S3cr3tx model: junos -interval: 3600 +interval: 3600 #interval in seconds log: ~/.config/oxidized/log debug: false threads: 30 -- cgit v1.2.1 From 4203e00cbde157e767e8be39ffdcecb30db14e6b Mon Sep 17 00:00:00 2001 From: Nicholas Meredith Date: Sun, 12 Nov 2017 05:48:55 +1000 Subject: fix: Fix prompt pattern for model/comware.rb to handle ASCII Bell response +fix minor README.md typo (#1094) * comware.rb: update prompt to work when trailing ^G ASCII 7 (bell) is sent * README.md: correct typo 'HTT' to 'HTTP' for Configuration / Outputs paragraph * model/comware.rb: cleaning out some comments --- README.md | 2 +- lib/oxidized/model/comware.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 17b305b..2262d79 100644 --- a/README.md +++ b/README.md @@ -234,7 +234,7 @@ Oxidized supports [CSV](docs/Configuration.md#source-csv), [SQLite](docs/Config ## Outputs -Possible outputs are either [File](docs/Configuration.md#output-file), [GIT](docs/Configuration.md#output-git), [GIT-Crypt](docs/Configuration.md#output-git-crypt) and [HTT](docs/Configuration.md#output-http). The file backend takes a destination directory as argument and will keep a file per device, with most recent running version of a device. The GIT backend (recommended) will initialize an empty GIT repository in the specified path and create a new commit on every configuration change. The GIT-Crypt backend will also initialize a GIT repository but every configuration push to it will be encrypted on the fly by using `git-crypt` tool. Take a look at the [Configuration](docs/Configuration.md) for more details. +Possible outputs are either [File](docs/Configuration.md#output-file), [GIT](docs/Configuration.md#output-git), [GIT-Crypt](docs/Configuration.md#output-git-crypt) and [HTTP](docs/Configuration.md#output-http). The file backend takes a destination directory as argument and will keep a file per device, with most recent running version of a device. The GIT backend (recommended) will initialize an empty GIT repository in the specified path and create a new commit on every configuration change. The GIT-Crypt backend will also initialize a GIT repository but every configuration push to it will be encrypted on the fly by using `git-crypt` tool. Take a look at the [Configuration](docs/Configuration.md) for more details. Maps define how to map a model's fields to model [model fields](https://github.com/ytti/oxidized/tree/master/lib/oxidized/model). Most of the settings should be self explanatory, log is ignored if `use_syslog`(requires Ruby >= 2.0) is set to `true`. diff --git a/lib/oxidized/model/comware.rb b/lib/oxidized/model/comware.rb index d926854..a5b7190 100644 --- a/lib/oxidized/model/comware.rb +++ b/lib/oxidized/model/comware.rb @@ -1,8 +1,8 @@ class Comware < Oxidized::Model # HP (A-series)/H3C/3Com Comware - # sometimes the prompt might have a leading nul - prompt /^\0*(<[\w.-]+>)$/ + # sometimes the prompt might have a leading nul or trailing ASCII Bell (^G) + prompt /^\0*(<[\w.-]+>).?$/ comment '# ' # example how to handle pager -- cgit v1.2.1 From 40cfa7b7cfba0d0a655fe2148ad9336414e89737 Mon Sep 17 00:00:00 2001 From: pv2b Date: Wed, 15 Nov 2017 23:02:27 +0100 Subject: fix: Netgear model: Permit . as valid character in prompt (#1099) --- lib/oxidized/model/netgear.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oxidized/model/netgear.rb b/lib/oxidized/model/netgear.rb index 38aaca7..0ab1349 100644 --- a/lib/oxidized/model/netgear.rb +++ b/lib/oxidized/model/netgear.rb @@ -1,7 +1,7 @@ class Netgear < Oxidized::Model comment '!' - prompt /^(\([\w-]+\)\s[#>])$/ + prompt /^(\([\w\-.]+\)\s[#>])$/ cmd :secret do |cfg| cfg.gsub!(/password (\S+)/, 'password ') -- 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 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 8bef76580a3e848836f3f12fe9e6c50380dbe01e Mon Sep 17 00:00:00 2001 From: pv2b Date: Sat, 18 Nov 2017 10:59:28 +0100 Subject: model: Procurve Handle switch selection for stack commanders (#1104) When trying to connect to a HP Procurve Switch with stacking enabled, you are asked to choose which switch to connect to to manage. This patch makes it so that if this question is encountered, just press "Enter" to choose the stack commander. This won't make backing up stack members work (they still need to be configured seperately and given IP addresses, making stacking useless) but at least it makes it possible to back up a commander in a stack seperately. Fixed #1070 Credit to @stiltzkin10 for this fix. --- lib/oxidized/model/procurve.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/oxidized/model/procurve.rb b/lib/oxidized/model/procurve.rb index 180b703..11d7ea9 100644 --- a/lib/oxidized/model/procurve.rb +++ b/lib/oxidized/model/procurve.rb @@ -21,6 +21,11 @@ class Procurve < Oxidized::Model "" end + expect /Enter switch number/ do + send "\n" + "" + end + cmd :all do |cfg| cfg = cfg.each_line.to_a[1..-2].join cfg = cfg.gsub /^\r/, '' -- 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 + lib/oxidized/hook/exec.rb | 1 + 2 files changed, 2 insertions(+) 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 diff --git a/lib/oxidized/hook/exec.rb b/lib/oxidized/hook/exec.rb index a9a5950..3f984c2 100644 --- a/lib/oxidized/hook/exec.rb +++ b/lib/oxidized/hook/exec.rb @@ -71,6 +71,7 @@ class Exec < Oxidized::Hook "OX_NODE_FROM" => ctx.node.from.to_s, "OX_NODE_MSG" => ctx.node.msg.to_s, "OX_NODE_GROUP" => ctx.node.group.to_s, + "OX_NODE_MODEL" => ctx.node.model.class.name, "OX_REPO_COMMITREF" => ctx.commitref.to_s, "OX_REPO_NAME" => ctx.node.repo.to_s, ) -- 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 + lib/oxidized/model/opnsense.rb | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 lib/oxidized/model/opnsense.rb 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) diff --git a/lib/oxidized/model/opnsense.rb b/lib/oxidized/model/opnsense.rb new file mode 100644 index 0000000..b874fca --- /dev/null +++ b/lib/oxidized/model/opnsense.rb @@ -0,0 +1,21 @@ +class OpnSense < Oxidized::Model + + # minimum required permissions: "System: Shell account access" + # must enable SSH and password-based SSH access + + cmd :all do |cfg| + cfg.each_line.to_a[1..-1].join + end + + cmd 'cat /conf/config.xml' do |cfg| + cfg.gsub! /\s\s*