oxidized 0.28.0 → 0.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/publishdocker.yml +8 -1
- data/.github/workflows/ruby.yml +42 -0
- data/.rubocop.yml +30 -10
- data/.rubocop_todo.yml +95 -41
- data/CHANGELOG.md +139 -2
- data/Dockerfile +13 -9
- data/README.md +66 -32
- data/Rakefile +2 -0
- data/docs/Configuration.md +49 -7
- data/docs/Creating-Models.md +10 -4
- data/docs/Hooks.md +35 -6
- data/docs/Model-Notes/ADVA.md +12 -0
- data/docs/Model-Notes/Cumulus.md +7 -1
- data/docs/Model-Notes/IOS.md +36 -0
- data/docs/Model-Notes/JunOS.md +3 -3
- data/docs/Model-Notes/LenovoNOS.md +29 -0
- data/docs/Model-Notes/LinksysSRW.md +15 -0
- data/docs/Model-Notes/Nokia.md +3 -0
- data/docs/Model-Notes/OS10.md +33 -0
- data/docs/Model-Notes/PanOS_API.md +28 -0
- data/docs/Model-Notes/README.md +2 -0
- data/docs/Sources.md +18 -0
- data/docs/Supported-OS-Types.md +51 -6
- data/docs/Troubleshooting.md +1 -1
- data/extra/gitdiff-msteams.sh +91 -0
- data/extra/nagios_check_failing_nodes.rb +6 -9
- data/extra/oxidized-report-git-commits +71 -14
- data/extra/oxidized.init +2 -5
- data/extra/oxidized.logrotate +1 -0
- data/extra/oxidized.runit +4 -1
- data/extra/oxidized.service +5 -8
- data/extra/rest_client.rb +1 -1
- data/extra/syslog.rb +2 -2
- data/lib/oxidized/cli.rb +1 -1
- data/lib/oxidized/config/vars.rb +5 -2
- data/lib/oxidized/config.rb +6 -3
- data/lib/oxidized/core.rb +1 -1
- data/lib/oxidized/hook/exec.rb +6 -6
- data/lib/oxidized/hook/githubrepo.rb +42 -11
- data/lib/oxidized/hook/slackdiff.rb +2 -2
- data/lib/oxidized/hook/xmppdiff.rb +45 -25
- data/lib/oxidized/hook.rb +4 -8
- data/lib/oxidized/input/exec.rb +1 -1
- data/lib/oxidized/input/input.rb +1 -0
- data/lib/oxidized/input/ssh.rb +23 -20
- data/lib/oxidized/input/telnet.rb +52 -44
- data/lib/oxidized/job.rb +1 -0
- data/lib/oxidized/jobs.rb +11 -6
- data/lib/oxidized/manager.rb +1 -0
- data/lib/oxidized/model/acmepacket.rb +38 -0
- data/lib/oxidized/model/adtran.rb +5 -3
- data/lib/oxidized/model/adva.rb +66 -0
- data/lib/oxidized/model/airfiber.rb +1 -1
- data/lib/oxidized/model/aoscx.rb +96 -0
- data/lib/oxidized/model/aosw.rb +1 -1
- data/lib/oxidized/model/asa.rb +2 -0
- data/lib/oxidized/model/awplus.rb +1 -1
- data/lib/oxidized/model/bdcom.rb +49 -0
- data/lib/oxidized/model/cambiumepmp.rb +17 -0
- data/lib/oxidized/model/casa.rb +4 -1
- data/lib/oxidized/model/ciscoce.rb +12 -0
- data/lib/oxidized/model/ciscosmb.rb +2 -0
- data/lib/oxidized/model/comware.rb +16 -1
- data/lib/oxidized/model/cumulus.rb +58 -44
- data/lib/oxidized/model/dellx.rb +1 -3
- data/lib/oxidized/model/dlink.rb +2 -1
- data/lib/oxidized/model/edgecos.rb +22 -2
- data/lib/oxidized/model/edgeswitch.rb +4 -4
- data/lib/oxidized/model/eltex.rb +48 -0
- data/lib/oxidized/model/enterasys.rb +18 -3
- data/lib/oxidized/model/enterasys800.rb +29 -0
- data/lib/oxidized/model/eos.rb +2 -1
- data/lib/oxidized/model/fabricos.rb +1 -1
- data/lib/oxidized/model/fastiron.rb +3 -2
- data/lib/oxidized/model/fortios.rb +24 -11
- data/lib/oxidized/model/fortiwlc.rb +24 -0
- data/lib/oxidized/model/gaiaos.rb +40 -3
- data/lib/oxidized/model/h3c.rb +40 -0
- data/lib/oxidized/model/hatteras.rb +2 -2
- data/lib/oxidized/model/hios.rb +38 -0
- data/lib/oxidized/model/hpebladesystem.rb +1 -1
- data/lib/oxidized/model/ios.rb +13 -10
- data/lib/oxidized/model/iosxe.rb +1 -1
- data/lib/oxidized/model/ironware.rb +8 -4
- data/lib/oxidized/model/junos.rb +5 -1
- data/lib/oxidized/model/lancom.rb +23 -0
- data/lib/oxidized/model/lenovonos.rb +82 -0
- data/lib/oxidized/model/linksyssrw.rb +71 -0
- data/lib/oxidized/model/mlnxos.rb +2 -0
- data/lib/oxidized/model/model.rb +29 -3
- data/lib/oxidized/model/necix.rb +30 -0
- data/lib/oxidized/model/netgear.rb +5 -2
- data/lib/oxidized/model/netscaler.rb +38 -1
- data/lib/oxidized/model/nodegrid.rb +23 -0
- data/lib/oxidized/model/nxos.rb +3 -2
- data/lib/oxidized/model/openbsd.rb +9 -0
- data/lib/oxidized/model/opengear.rb +1 -1
- data/lib/oxidized/model/opnsense.rb +12 -4
- data/lib/oxidized/model/panos_api.rb +71 -0
- data/lib/oxidized/model/pfsense.rb +12 -7
- data/lib/oxidized/model/powerconnect.rb +1 -3
- data/lib/oxidized/model/procurve.rb +2 -2
- data/lib/oxidized/model/purityos.rb +8 -1
- data/lib/oxidized/model/quantaos.rb +1 -5
- data/lib/oxidized/model/routeros.rb +15 -2
- data/lib/oxidized/model/slxos.rb +1 -0
- data/lib/oxidized/model/smartcs.rb +40 -0
- data/lib/oxidized/model/sonicos.rb +9 -1
- data/lib/oxidized/model/srosmd.rb +97 -0
- data/lib/oxidized/model/stoneos.rb +6 -2
- data/lib/oxidized/model/supermicro.rb +1 -1
- data/lib/oxidized/model/swos.rb +9 -0
- data/lib/oxidized/model/timos.rb +1 -1
- data/lib/oxidized/model/tmos.rb +2 -1
- data/lib/oxidized/model/tplink.rb +2 -0
- data/lib/oxidized/model/trango.rb +11 -11
- data/lib/oxidized/model/truenas.rb +20 -0
- data/lib/oxidized/model/vrp.rb +1 -1
- data/lib/oxidized/model/xos.rb +4 -3
- data/lib/oxidized/model/yamaha.rb +57 -0
- data/lib/oxidized/model/zteolt.rb +52 -0
- data/lib/oxidized/model/zy1308.rb +11 -0
- data/lib/oxidized/node/stats.rb +1 -0
- data/lib/oxidized/node.rb +16 -11
- data/lib/oxidized/nodes.rb +7 -6
- data/lib/oxidized/output/file.rb +2 -1
- data/lib/oxidized/output/git.rb +4 -3
- data/lib/oxidized/output/gitcrypt.rb +5 -8
- data/lib/oxidized/output/http.rb +2 -0
- data/lib/oxidized/source/csv.rb +1 -0
- data/lib/oxidized/source/http.rb +4 -0
- data/lib/oxidized/source/source.rb +7 -2
- data/lib/oxidized/source/sql.rb +15 -5
- data/lib/oxidized/string.rb +9 -3
- data/lib/oxidized/version.rb +2 -2
- data/lib/oxidized/worker.rb +5 -5
- data/oxidized.gemspec +22 -16
- metadata +116 -29
- data/.travis.yml +0 -10
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Oxidized
|
2
|
-
|
2
|
+
|
3
|
+
[![Build Status](https://github.com/ytti/oxidized/actions/workflows/ruby.yml/badge.svg)](https://github.com/ytti/oxidized/actions/workflows/ruby.yml)
|
3
4
|
[![codecov.io](https://codecov.io/gh/ytti/oxidized/coverage.svg?branch=master)](https://codecov.io/gh/ytti/oxidized?branch=master)
|
4
5
|
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5a90cb22db6a4d5ea23ad0dfb53fe03a)](https://www.codacy.com/app/ytti/oxidized?utm_source=github.com&utm_medium=referral&utm_content=ytti/oxidized&utm_campaign=Badge_Grade)
|
5
6
|
[![Code Climate](https://codeclimate.com/github/ytti/oxidized/badges/gpa.svg)](https://codeclimate.com/github/ytti/oxidized)
|
@@ -8,7 +9,7 @@
|
|
8
9
|
|
9
10
|
Oxidized is a network device configuration backup tool. It's a RANCID replacement!
|
10
11
|
|
11
|
-
Light and extensible, Oxidized supports
|
12
|
+
Light and extensible, Oxidized supports over 130 operating system types.
|
12
13
|
|
13
14
|
Feature highlights:
|
14
15
|
|
@@ -76,7 +77,7 @@ Check out the [Oxidized TREX 2014 presentation](http://youtu.be/kBQ_CTUuqeU#t=3h
|
|
76
77
|
|
77
78
|
### Debian and Ubuntu
|
78
79
|
|
79
|
-
Debian "buster" or newer and Ubuntu 17.10 (artful) or newer are recommended. On Ubuntu, begin by enabling the `universe`
|
80
|
+
Debian "buster" or newer and Ubuntu 17.10 (artful) or newer are recommended. On Ubuntu, begin by enabling the `universe`
|
80
81
|
repository (required for libssh2-1-dev):
|
81
82
|
|
82
83
|
```shell
|
@@ -98,14 +99,14 @@ gem install oxidized-script oxidized-web # If you don't install oxidized-web, en
|
|
98
99
|
|
99
100
|
### CentOS, Oracle Linux, Red Hat Linux
|
100
101
|
|
101
|
-
On CentOS 6 and 7 / RHEL 6 and 7, begin by installing Ruby 2.3 or greater. This can be accomplished in one of
|
102
|
+
On CentOS 6 and 7 / RHEL 6 and 7, begin by installing Ruby 2.3 or greater. This can be accomplished in one of several ways:
|
102
103
|
|
103
104
|
Install Ruby 2.3 from [SCL](https://www.softwarecollections.org/en/scls/rhscl/rh-ruby23/):
|
104
105
|
|
105
106
|
```shell
|
106
107
|
yum install centos-release-scl
|
107
|
-
yum install rh-
|
108
|
-
scl enable rh-
|
108
|
+
yum install rh-ruby30 rh-ruby30-ruby-devel
|
109
|
+
scl enable rh-ruby30 bash
|
109
110
|
```
|
110
111
|
|
111
112
|
The following additional packages will be required to build the dependencies:
|
@@ -114,15 +115,35 @@ The following additional packages will be required to build the dependencies:
|
|
114
115
|
yum install make cmake which sqlite-devel openssl-devel libssh2-devel ruby gcc ruby-devel libicu-devel gcc-c++
|
115
116
|
```
|
116
117
|
|
117
|
-
Alternatively, install Ruby 2.
|
118
|
+
Alternatively, install Ruby 2.6 via RVM by following the instructions:
|
119
|
+
|
120
|
+
Make sure you dont have any leftover ruby:
|
121
|
+
```yum erase ruby```
|
118
122
|
|
119
|
-
|
123
|
+
Then, install gpg key and rvm
|
120
124
|
|
121
125
|
```shell
|
122
|
-
|
123
|
-
|
126
|
+
sudo gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
|
127
|
+
curl -sSL https://get.rvm.io | bash -s stable
|
128
|
+
source /etc/profile.d/rvm.sh
|
129
|
+
rvm requirements run
|
130
|
+
rvm install 3.0
|
131
|
+
rvm use 3.0
|
124
132
|
```
|
125
133
|
|
134
|
+
Install oxidized requirements:
|
135
|
+
```yum install make cmake which sqlite-devel openssl-devel libssh2-devel gcc libicu-devel gcc-c++```
|
136
|
+
|
137
|
+
Install the gems:
|
138
|
+
```gem install oxidized oxidized-web```
|
139
|
+
|
140
|
+
You need to wrap the gem and reference the wrap in the systemctl service file:
|
141
|
+
```rvm wrapper oxidized```
|
142
|
+
|
143
|
+
You can see where the wrapped gem is via
|
144
|
+
```rvm wrapper show oxidized```
|
145
|
+
Use that path in the oxidized.service file, restart the systemctl daemon, run oxidized by hand once, edit config file, start service.
|
146
|
+
|
126
147
|
### FreeBSD
|
127
148
|
|
128
149
|
[Use RVM to install Ruby v2.3](#installing-ruby-23-using-rvm), then install all required packages and gems:
|
@@ -177,7 +198,7 @@ Run the container for the first time to initialize the config:
|
|
177
198
|
_Note: this step in only required for creating the Oxidized configuration file and can be skipped if you already have one._
|
178
199
|
|
179
200
|
```shell
|
180
|
-
docker run --rm -v /etc/oxidized:/
|
201
|
+
docker run --rm -v /etc/oxidized:/home/oxidized/.config/oxidized -p 8888:8888/tcp -t oxidized/oxidized:latest oxidized
|
181
202
|
```
|
182
203
|
|
183
204
|
If the RESTful API and Web Interface are enabled, on the docker host running the container
|
@@ -188,15 +209,23 @@ Alternatively, you can use docker-compose to launch the oxidized container:
|
|
188
209
|
```yaml
|
189
210
|
# docker-compose.yml
|
190
211
|
# docker-compose file example for oxidized that will start along with docker daemon
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
212
|
+
---
|
213
|
+
version: "3"
|
214
|
+
services:
|
215
|
+
oxidized:
|
216
|
+
restart: always
|
217
|
+
image: oxidized/oxidized:latest
|
218
|
+
ports:
|
219
|
+
- 8888:8888/tcp
|
220
|
+
environment:
|
221
|
+
CONFIG_RELOAD_INTERVAL: 600
|
222
|
+
volumes:
|
223
|
+
- config:/home/oxidized/.config/oxidized/config
|
224
|
+
- router.db:/home/oxidized/.config/oxidized/router.db
|
225
|
+
- model:/home/oxidized/.config/oxidized/model
|
226
|
+
# if git is use as input
|
227
|
+
- data:/home/oxidized/.config/oxidized/backupcfg/
|
228
|
+
|
200
229
|
```
|
201
230
|
|
202
231
|
Create the `/etc/oxidized/router.db` (see [CSV Source](docs/Sources.md#source-csv) for further info):
|
@@ -208,7 +237,7 @@ vim /etc/oxidized/router.db
|
|
208
237
|
Run container again to start oxidized with your configuration:
|
209
238
|
|
210
239
|
```shell
|
211
|
-
docker run -v /etc/oxidized:/
|
240
|
+
docker run -v /etc/oxidized:/home/oxidized/.config/oxidized -p 8888:8888/tcp -t oxidized/oxidized:latest
|
212
241
|
oxidized[1]: Oxidized starting, running as pid 1
|
213
242
|
oxidized[1]: Loaded 1 nodes
|
214
243
|
Puma 2.13.4 starting...
|
@@ -220,13 +249,13 @@ Puma 2.13.4 starting...
|
|
220
249
|
If you want to have the config automatically reloaded (e.g. when using a http source that changes):
|
221
250
|
|
222
251
|
```shell
|
223
|
-
docker run -v /etc/oxidized:/
|
252
|
+
docker run -v /etc/oxidized:/home/oxidized/.config/oxidized -p 8888:8888/tcp -e CONFIG_RELOAD_INTERVAL=3600 -t oxidized/oxidized:latest
|
224
253
|
```
|
225
254
|
|
226
255
|
If you need to use an internal CA (e.g. to connect to an private github instance):
|
227
256
|
|
228
257
|
```shell
|
229
|
-
docker run -v /etc/oxidized:/
|
258
|
+
docker run -v /etc/oxidized:/home/oxidized/.config/oxidized -v /path/to/MY-CA.crt:/usr/local/share/ca-certificates/MY-CA.crt -p 8888:8888/tcp -e UPDATE_CA_CERTIFICATES=true -t oxidized/oxidized:latest
|
230
259
|
```
|
231
260
|
|
232
261
|
### Installing Ruby 2.3 using RVM
|
@@ -260,7 +289,7 @@ Oxidized configuration is in YAML format. Configuration files are subsequently s
|
|
260
289
|
It is recommended practice to run Oxidized using its own username. This username can be added using standard command-line tools:
|
261
290
|
|
262
291
|
```shell
|
263
|
-
useradd oxidized
|
292
|
+
useradd -s /bin/bash -m oxidized
|
264
293
|
```
|
265
294
|
|
266
295
|
> It is recommended __not__ to run Oxidized as root.
|
@@ -324,9 +353,9 @@ Run `oxidized` again to take the first backups.
|
|
324
353
|
|
325
354
|
## Extra
|
326
355
|
|
327
|
-
### Ubuntu
|
356
|
+
### Ubuntu init setup
|
328
357
|
|
329
|
-
The
|
358
|
+
The systemd service assumes that you have a user named 'oxidized' and that oxidized is in one of the following paths:
|
330
359
|
|
331
360
|
```text
|
332
361
|
/sbin
|
@@ -336,18 +365,23 @@ The init script assumes that you have a user named 'oxidized' and that oxidized
|
|
336
365
|
/usr/local/bin
|
337
366
|
```
|
338
367
|
|
339
|
-
1. Copy
|
340
|
-
|
368
|
+
1. Copy systemd service file from extra/ folder to /etc/systemd/system
|
369
|
+
|
370
|
+
```shell
|
371
|
+
sudo cp extra/oxidized.service /etc/systemd/system
|
372
|
+
```
|
373
|
+
|
374
|
+
2. Setup `/var/run/`
|
341
375
|
|
342
376
|
```shell
|
343
|
-
mkdir /
|
344
|
-
chown oxidized:oxidized /
|
377
|
+
mkdir /run/oxidized
|
378
|
+
chown oxidized:oxidized /run/oxidized
|
345
379
|
```
|
346
380
|
|
347
381
|
3. Make oxidized start on boot
|
348
382
|
|
349
383
|
```shell
|
350
|
-
|
384
|
+
sudo systemctl enable oxidized.service
|
351
385
|
```
|
352
386
|
|
353
387
|
## Help
|
@@ -385,7 +419,7 @@ If you would like to be a maintainer for Oxidized then please read through the b
|
|
385
419
|
|
386
420
|
## YES, I WANT TO HELP
|
387
421
|
|
388
|
-
Awesome! Simply send an
|
422
|
+
Awesome! Simply send an e-mail to Saku Ytti at <saku@ytti.fi>.
|
389
423
|
|
390
424
|
## Further reading
|
391
425
|
|
data/Rakefile
CHANGED
data/docs/Configuration.md
CHANGED
@@ -124,7 +124,7 @@ Finally, multiple private keys can be specified as an array of file paths, such
|
|
124
124
|
|
125
125
|
## SSH Proxy Command
|
126
126
|
|
127
|
-
Oxidized can `ssh` through a proxy as well. To do so we just need to set `ssh_proxy` variable with the proxy host information and optionally set the `ssh_proxy_port` with the SSH port if it is not listening
|
127
|
+
Oxidized can `ssh` through a proxy as well. To do so we just need to set `ssh_proxy` variable with the proxy host information and optionally set the `ssh_proxy_port` with the SSH port if it is not listening on port 22.
|
128
128
|
|
129
129
|
This can be provided on a per-node basis by mapping the proper fields from your source.
|
130
130
|
|
@@ -184,7 +184,11 @@ model: junos
|
|
184
184
|
interval: 3600 #interval in seconds
|
185
185
|
log: ~/.config/oxidized/log
|
186
186
|
debug: false
|
187
|
-
threads: 30
|
187
|
+
threads: 30 # maximum number of threads
|
188
|
+
# use_max_threads:
|
189
|
+
# false - the number of threads is selected automatically based on the interval option, but not more than the maximum
|
190
|
+
# true - always use the maximum number of threads
|
191
|
+
use_max_threads: false
|
188
192
|
timeout: 20
|
189
193
|
retries: 3
|
190
194
|
prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
|
@@ -238,13 +242,51 @@ groups:
|
|
238
242
|
password: ubnt
|
239
243
|
```
|
240
244
|
|
241
|
-
|
245
|
+
Model specific variables within groups
|
242
246
|
|
243
247
|
```yaml
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
+
groups:
|
249
|
+
foo:
|
250
|
+
models:
|
251
|
+
arista:
|
252
|
+
vars:
|
253
|
+
ssh_keys: "~/.ssh/id_rsa_foo_arista"
|
254
|
+
vyatta:
|
255
|
+
vars:
|
256
|
+
ssh_keys: "~/.ssh/id_rsa_foo_vyatta"
|
257
|
+
bar:
|
258
|
+
models:
|
259
|
+
routeros:
|
260
|
+
vars:
|
261
|
+
ssh_keys: "~/.ssh/id_rsa_bar_routeros"
|
262
|
+
vyatta:
|
263
|
+
vars:
|
264
|
+
ssh_keys: "~/.ssh/id_rsa_bar_vyatta"
|
265
|
+
```
|
266
|
+
|
267
|
+
For mapping multiple group values to a common name
|
268
|
+
|
269
|
+
```yaml
|
270
|
+
group_map:
|
271
|
+
alias1: groupA
|
272
|
+
alias2: groupA
|
273
|
+
alias3: groupB
|
274
|
+
alias4: groupB
|
275
|
+
aliasN: groupZ
|
276
|
+
...
|
277
|
+
```
|
278
|
+
|
279
|
+
add group mapping to a source
|
280
|
+
|
281
|
+
```yaml
|
282
|
+
source:
|
283
|
+
...
|
284
|
+
<source>:
|
285
|
+
...
|
286
|
+
map:
|
287
|
+
model: 0
|
288
|
+
name: 1
|
289
|
+
group: 2
|
248
290
|
```
|
249
291
|
|
250
292
|
For model specific credentials
|
data/docs/Creating-Models.md
CHANGED
@@ -10,11 +10,11 @@ This methodology allows local site changes to be preserved during Oxidized versi
|
|
10
10
|
|
11
11
|
An Oxidized model, at minimum, requires just three elements:
|
12
12
|
|
13
|
-
* A model file, this file should be placed in the ~/.config/oxidized directory and named after the target OS type.
|
13
|
+
* A model file, this file should be placed in the ~/.config/oxidized/model directory and named after the target OS type.
|
14
14
|
* A class defined within this file with the same name as the file itself that inherits from `Oxidized::Model`, the base model class.
|
15
15
|
* At least one command that will be executed and the output of which will be collected by Oxidized.
|
16
16
|
|
17
|
-
A bare-bone example for a fictional model running the OS type `rootware` could be introduced by creating the file `~/.config/oxidized/rootware.rb`, with the following content:
|
17
|
+
A bare-bone example for a fictional model running the OS type `rootware` could be introduced by creating the file `~/.config/oxidized/model/rootware.rb`, with the following content:
|
18
18
|
|
19
19
|
```ruby
|
20
20
|
class RootWare < Oxidized::Model
|
@@ -124,13 +124,19 @@ This functionality is supported for `cfg`, `cmd`, `pre`, `post`, and `expect` bl
|
|
124
124
|
Examples:
|
125
125
|
|
126
126
|
```ruby
|
127
|
-
cmd :secret clear: true do
|
127
|
+
cmd :secret, clear: true do
|
128
128
|
... "(new code for secret removal which replaces the existing :secret definition in the model)" ...
|
129
129
|
end
|
130
130
|
```
|
131
131
|
|
132
132
|
```ruby
|
133
|
-
cmd
|
133
|
+
cmd 'show version', clear: true do |cfg|
|
134
|
+
... "(new code for parsing 'show version', replaces the existing definition in the model)" ...
|
135
|
+
end
|
136
|
+
```
|
137
|
+
|
138
|
+
```ruby
|
139
|
+
cmd :ssh, prepend: true do
|
134
140
|
... "(code that should run first, before any code in the existing :ssh definition in the model)" ...
|
135
141
|
end
|
136
142
|
```
|
data/docs/Hooks.md
CHANGED
@@ -36,6 +36,8 @@ OX_JOB_STATUS
|
|
36
36
|
OX_JOB_TIME
|
37
37
|
OX_REPO_COMMITREF
|
38
38
|
OX_REPO_NAME
|
39
|
+
OX_ERR_TYPE
|
40
|
+
OX_ERR_REASON
|
39
41
|
```
|
40
42
|
|
41
43
|
Exec hook recognizes the following configuration keys:
|
@@ -62,12 +64,15 @@ hooks:
|
|
62
64
|
|
63
65
|
## Hook type: githubrepo
|
64
66
|
|
67
|
+
Note: You must not use the same name as any local repo configured under output. Make sure your 'git' output has a unique name that does not match your remote_repo.
|
68
|
+
|
65
69
|
The `githubrepo` hook executes a `git push` to a configured `remote_repo` when the specified event is triggered.
|
66
70
|
|
67
71
|
Several authentication methods are supported:
|
68
72
|
|
69
73
|
* Provide a `password` for username + password authentication
|
70
74
|
* Provide both a `publickey` and a `privatekey` for ssh key-based authentication
|
75
|
+
* Provide only a `privatekey` (public key filename is assumed to be `privatekey` + "`.pub`"
|
71
76
|
* Don't provide any credentials for ssh-agent authentication
|
72
77
|
|
73
78
|
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.
|
@@ -79,10 +84,15 @@ For ssh key-based authentication, it is possible to set the environment variable
|
|
79
84
|
* `remote_repo`: the remote repository to be pushed to.
|
80
85
|
* `username`: username for repository auth.
|
81
86
|
* `password`: password for repository auth.
|
82
|
-
* `publickey`: public key file path for repository auth.
|
87
|
+
* `publickey`: public key file path for repository auth. (optional)
|
83
88
|
* `privatekey`: private key file path for repository auth.
|
89
|
+
* NOTE: this key needs to be in the legacy PEM format, not the newer OpenSSL format [#1877](https://github.com/ytti/oxidized/issues/1877), [#2324](https://github.com/ytti/oxidized/issues/2324)
|
90
|
+
* To convert a key beginning with `BEGIN OPENSSH PRIVATE KEY` to the legacy PEM format, run this command:
|
91
|
+
`ssh-keygen -p -m PEM -f $MY_KEY_HERE`
|
92
|
+
|
93
|
+
When using groups, `remote_repo` must be a dictionary of groups that the hook should apply to. If a group is missing from the dictionary, no action will be taken.
|
84
94
|
|
85
|
-
|
95
|
+
The dictionary entry can either be a url alone:
|
86
96
|
|
87
97
|
```yaml
|
88
98
|
hooks:
|
@@ -93,6 +103,25 @@ hooks:
|
|
93
103
|
firewalls: git@git.intranet:oxidized/firewalls.git
|
94
104
|
```
|
95
105
|
|
106
|
+
... or it can be a dictionary with `url` and `privatekey` specified:
|
107
|
+
|
108
|
+
```yaml
|
109
|
+
hooks:
|
110
|
+
push_to_remote:
|
111
|
+
remote_repo:
|
112
|
+
routers:
|
113
|
+
url: git@git.intranet:oxidized/routers.git
|
114
|
+
privatekey: /root/.ssh/id_rsa_routers
|
115
|
+
switches:
|
116
|
+
url: git@git.intranet:oxidized/switches.git
|
117
|
+
privatekey: /root/.ssh/id_rsa_switches
|
118
|
+
firewalls:
|
119
|
+
url: git@git.intranet:oxidized/firewalls.git
|
120
|
+
privatekey: /root/.ssh/id_rsa_firewalls
|
121
|
+
```
|
122
|
+
|
123
|
+
Both forms can be mixed and matched.
|
124
|
+
|
96
125
|
### githubrepo hook configuration example
|
97
126
|
|
98
127
|
Authenticate with a username and a password without groups in use:
|
@@ -150,12 +179,12 @@ Your AWS credentials should be stored in `~/.aws/credentials`.
|
|
150
179
|
|
151
180
|
## Hook type: slackdiff
|
152
181
|
|
153
|
-
The `slackdiff` hook posts colorized config diffs to a [Slack](
|
182
|
+
The `slackdiff` hook posts colorized config diffs to a [Slack](https://www.slack.com) channel of your choice. It only triggers for `post_store` events.
|
154
183
|
|
155
|
-
You will need to manually install the `slack-
|
184
|
+
You will need to manually install the `slack-ruby-client` gem on your system:
|
156
185
|
|
157
186
|
```shell
|
158
|
-
gem install slack-
|
187
|
+
gem install slack-ruby-client
|
159
188
|
```
|
160
189
|
|
161
190
|
### slackdiff hook configuration example
|
@@ -169,7 +198,7 @@ hooks:
|
|
169
198
|
channel: "#network-changes"
|
170
199
|
```
|
171
200
|
|
172
|
-
The token parameter is a
|
201
|
+
The token parameter is a Slack API token that can be generated following [this tutorial](https://api.slack.com/tutorials/tracks/getting-a-token). Until Slack stops supporting them, legacy tokens can also be used.
|
173
202
|
|
174
203
|
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.
|
175
204
|
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# ADVA Configuration
|
2
|
+
|
3
|
+
To ensure Oxidized can fetch the configuration, you have to make sure that `cli-paging` is set to `disabled` for the user that is used to connect to the ADVA devices.
|
4
|
+
|
5
|
+
## Restoring the configuration
|
6
|
+
|
7
|
+
In order to trick the device into restoring the files you need to add the following remarks as first line of the file.
|
8
|
+
```
|
9
|
+
# DO NOT EDIT THIS LINE. FILE_TYPE=CONFIGURATION_FILE
|
10
|
+
```
|
11
|
+
|
12
|
+
Back to [Model-Notes](README.md)
|
data/docs/Model-Notes/Cumulus.md
CHANGED
@@ -8,11 +8,15 @@ With the release of Cumulus Linux 3.4.0 the platform moved the routing daemon to
|
|
8
8
|
|
9
9
|
A variable has been added to enable users running Cumulus Linux > 3.4.0 to target the new `frr` routing daemon.
|
10
10
|
|
11
|
+
## NCLU
|
12
|
+
It is possible to switch to [NCLU](https://docs.nvidia.com/networking-ethernet-software/cumulus-linux-44/System-Configuration/Network-Command-Line-Utility-NCLU/) as a configuration collecting method, by setting `cumulus_use_nclu` to true
|
13
|
+
|
11
14
|
### Example usage
|
12
15
|
|
13
16
|
```yaml
|
14
17
|
vars:
|
15
18
|
cumulus_routing_daemon: frr
|
19
|
+
cumulus_use_nclu: true
|
16
20
|
```
|
17
21
|
|
18
22
|
Alternatively map a column for the `cumulus_routing_daemon` variable.
|
@@ -35,6 +39,8 @@ And set the `cumulus_routing_daemon` variable in the `router.db` file.
|
|
35
39
|
cumulus1:192.168.121.134:cumulus:cumulus:frr
|
36
40
|
```
|
37
41
|
|
38
|
-
The default
|
42
|
+
The default value for `cumulus_routing_daemon` is `quagga` so existing installations continue to operate without interruption.
|
43
|
+
|
44
|
+
The default value for `cumulus_use_nclu` is `false`, in case NCLU is not installed.
|
39
45
|
|
40
46
|
Back to [Model-Notes](README.md)
|
data/docs/Model-Notes/IOS.md
CHANGED
@@ -26,4 +26,40 @@ class IOS
|
|
26
26
|
end
|
27
27
|
```
|
28
28
|
|
29
|
+
## Support Lower Privilege Level (Readonly RBAC) User Accounts
|
30
|
+
|
31
|
+
If Oxidized is configured to use a lower privilege level (readonly) local
|
32
|
+
account, it may be necessary for it to run "show running-config view full"
|
33
|
+
instead of "show running-config". In these cases, the ```ios_rbac: true```
|
34
|
+
variable needs to be set either as a top-level variable or at the groups
|
35
|
+
level.
|
36
|
+
|
37
|
+
Below are examples showing how each option can be enabled in the oxidized config:
|
38
|
+
|
39
|
+
### Top Level Variable
|
40
|
+
|
41
|
+
```yaml
|
42
|
+
vars:
|
43
|
+
ios_rbac: true
|
44
|
+
```
|
45
|
+
|
46
|
+
### Group Level Variable
|
47
|
+
|
48
|
+
```yaml
|
49
|
+
groups:
|
50
|
+
cisco:
|
51
|
+
vars:
|
52
|
+
ios_rbac: true
|
53
|
+
source:
|
54
|
+
default: csv
|
55
|
+
csv:
|
56
|
+
file: /home/oxidized/.config/oxidized/router.db
|
57
|
+
delimiter: !ruby/regexp /:/
|
58
|
+
map:
|
59
|
+
name: 0
|
60
|
+
ip: 1
|
61
|
+
model: 2
|
62
|
+
group: 2
|
63
|
+
```
|
64
|
+
|
29
65
|
Back to [Model-Notes](README.md)
|
data/docs/Model-Notes/JunOS.md
CHANGED
@@ -23,9 +23,9 @@ The commands Oxidized executes are:
|
|
23
23
|
3. show version
|
24
24
|
4. show chassis hardware
|
25
25
|
5. show system license
|
26
|
-
6. show system license keys
|
27
|
-
7. show virtual-chassis (
|
28
|
-
8. show chassis fabric reachability
|
26
|
+
6. show system license keys
|
27
|
+
7. show virtual-chassis (ex22|ex33|ex4|ex8|qfx only)
|
28
|
+
8. show chassis fabric reachability (MX960 only)
|
29
29
|
9. show configuration
|
30
30
|
|
31
31
|
Oxidized can now retrieve your configuration!
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Lenovo Network OS
|
2
|
+
|
3
|
+
## Remove unstable lines
|
4
|
+
|
5
|
+
Some configuration lines change each time you issue the `show running-config` command. These are strings with user passwords and keys (TACACS, RADIUS, etc). In order not to create many elements in the configuration history, these changing lines can be replaced with a stub line. This is what the `remove_unstable_lines` variable is for. Configuration example:
|
6
|
+
|
7
|
+
```yaml
|
8
|
+
vars:
|
9
|
+
remove_unstable_lines: true
|
10
|
+
```
|
11
|
+
|
12
|
+
Alternatively map a column for the `remove_unstable_lines` variable.
|
13
|
+
|
14
|
+
```yaml
|
15
|
+
source:
|
16
|
+
csv:
|
17
|
+
map:
|
18
|
+
name: 0
|
19
|
+
ip: 1
|
20
|
+
model: 2
|
21
|
+
group: 3
|
22
|
+
vars_map:
|
23
|
+
remove_unstable_lines: 4
|
24
|
+
```
|
25
|
+
|
26
|
+
If the value of the variable is `true`, then changing lines will be replaced with a `<unstable line hidden>` stub. Otherwise, the configuration will be saved unchanged. The default value of the variable is `false`.
|
27
|
+
|
28
|
+
Back to [Model-Notes](README.md)
|
29
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# LinksysSRW model notes
|
2
|
+
|
3
|
+
This is a switch model with a horible IE5 only web interface that is unusable in any modern browser due to broken and buggy html and javascript.
|
4
|
+
|
5
|
+
On a first glance the serial or telnet interface isn't any more usable, but there is a way to break out of the menu driven interface and start a more usable cli.
|
6
|
+
|
7
|
+
This is what this model does and dumps the config in there.
|
8
|
+
|
9
|
+
As far as I know, the Linksys SRW 2008, SRW2016 , SRW2024 and SRW2048 are the only switches running this os/ui, but there might be others out there.
|
10
|
+
|
11
|
+
Over snmp they identifes them self as Operating System: Cisco Small Business Software, so that might be a clue to look for if you're trying to figure out if your switch could have this hidden cli.
|
12
|
+
|
13
|
+
The author of this model isn't the one who found this "hidden" cli but only someone who integrated it with oxidized. The real credits goes out to some unknown hero out there on the internet who figured this out a long time ago.
|
14
|
+
|
15
|
+
Back to [Model-Notes](README.md)
|
data/docs/Model-Notes/Nokia.md
CHANGED
@@ -7,3 +7,6 @@ Nokia ISAM might require disabling SSH keepalives.
|
|
7
7
|
[Reference](https://github.com/ytti/oxidized/issues/1482)
|
8
8
|
|
9
9
|
Back to [Model-Notes](README.md)
|
10
|
+
|
11
|
+
## Model-driven CLI in Nokia SR OS (starting from versions 16.1.R1)
|
12
|
+
New model `srosmd` is introduced which collects information in model-driven format.
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# OS10 Configuration
|
2
|
+
|
3
|
+
Disable banner/motd
|
4
|
+
|
5
|
+
```text
|
6
|
+
banner login disable
|
7
|
+
banner motd disable
|
8
|
+
```
|
9
|
+
|
10
|
+
Add allowed commands to privilege level 4
|
11
|
+
|
12
|
+
```text
|
13
|
+
privilege exec priv-lvl 4 "show inventory"
|
14
|
+
privilege exec priv-lvl 4 "show inventory media"
|
15
|
+
privilege exec priv-lvl 4 "show running-configuration"
|
16
|
+
```
|
17
|
+
|
18
|
+
Create the user will the role sysadmin (it will see the full config, including auth info and users) and the privilege level 4
|
19
|
+
|
20
|
+
```text
|
21
|
+
username oxidized password verysecurepassword role sysadmin priv-lvl 4
|
22
|
+
```
|
23
|
+
|
24
|
+
The commands Oxidized executes are:
|
25
|
+
|
26
|
+
1. terminal length 0
|
27
|
+
2. show inventory
|
28
|
+
3. show inventory media
|
29
|
+
4. show running-configuration
|
30
|
+
|
31
|
+
Oxidized can now retrieve your configuration!
|
32
|
+
|
33
|
+
Back to [Model-Notes](README.md)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# PanOS API
|
2
|
+
|
3
|
+
Backup Palo Alto XML configuration via the HTTP API. Works for PanOS and Panorama.
|
4
|
+
|
5
|
+
Logs in using username and password and fetches an API key.
|
6
|
+
|
7
|
+
## Requirements
|
8
|
+
|
9
|
+
- Create a user with a `Superuser (read-only)` admin role in Panorama or PanOS
|
10
|
+
- Make sure the `nokogiri` gem is installed with your oxidized host
|
11
|
+
|
12
|
+
## Configuration
|
13
|
+
|
14
|
+
Make sure the following is configured in the oxidized config:
|
15
|
+
|
16
|
+
```yaml
|
17
|
+
# allow ssl host name verification
|
18
|
+
resolve_dns: false
|
19
|
+
input:
|
20
|
+
default: ssh, http
|
21
|
+
http:
|
22
|
+
secure: true
|
23
|
+
ssl_verify: true
|
24
|
+
|
25
|
+
# model specific configuration
|
26
|
+
#model:
|
27
|
+
# panos_api:
|
28
|
+
```
|
data/docs/Model-Notes/README.md
CHANGED
@@ -17,8 +17,10 @@ Cisco IOS|[IOS](IOS.md)|29 Mar 2019
|
|
17
17
|
Juniper|[MX/QFX/EX/SRX/J Series](JunOS.md)|18 Jan 2018
|
18
18
|
Netgear|[Netgear](Netgear.md)|11 Apr 2018
|
19
19
|
Nokia|[Nokia ISAM](Nokia.md)|22 Aug 2018
|
20
|
+
Dell/EMC|[Dell EMC Networking OS10](OS10.md)|07 Dec 2021
|
20
21
|
Viptela|[Viptela](Viptela.md)|1 Jul 2018
|
21
22
|
Zyxel|[XGS4600 Series](XGS4600-Zyxel.md)|1 Feb 2018
|
22
23
|
Linux|[LinuxGeneric](LinuxGeneric.md)|10 Jun 2019
|
24
|
+
Lenovo|[Lenovo Network OS](LenovoNOS.md)|5 Apr 2022
|
23
25
|
|
24
26
|
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.
|