oxidized 0.35.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/.coderabbit.yaml +21 -0
  3. data/.github/workflows/publishdocker.yml +11 -9
  4. data/.github/workflows/ruby.yml +1 -3
  5. data/.rubocop.yml +13 -2
  6. data/.rubocop_todo.yml +21 -2
  7. data/CHANGELOG.md +50 -3
  8. data/README.md +2 -3
  9. data/docs/Configuration.md +30 -1
  10. data/docs/Creating-Models.md +128 -13
  11. data/docs/Docker.md +2 -1
  12. data/docs/Inputs.md +29 -0
  13. data/docs/Model-Notes/APC.md +72 -0
  14. data/docs/Model-Notes/ExaLink.md +43 -0
  15. data/docs/Model-Notes/Fortinet.md +75 -0
  16. data/docs/Model-Notes/IvantiConnectSecure.md +59 -0
  17. data/docs/Model-Notes/TrueNAS.md +19 -0
  18. data/docs/ModelUnitTests.md +23 -0
  19. data/docs/Outputs.md +18 -4
  20. data/docs/Release.md +1 -1
  21. data/docs/Ruby-API.md +86 -5
  22. data/docs/Supported-OS-Types.md +20 -9
  23. data/docs/Troubleshooting.md +1 -1
  24. data/extra/device2yaml.rb +2 -3
  25. data/extra/hooks/modelrules.rb +55 -0
  26. data/extra/hooks/modelrulesadvanced.rb +168 -0
  27. data/extra/hooks/srcipmap.rb +54 -0
  28. data/lib/oxidized/hook/githubrepo.rb +2 -1
  29. data/lib/oxidized/hook.rb +56 -8
  30. data/lib/oxidized/input/exec.rb +0 -4
  31. data/lib/oxidized/input/ftp.rb +0 -13
  32. data/lib/oxidized/input/http.rb +38 -13
  33. data/lib/oxidized/input/input.rb +33 -13
  34. data/lib/oxidized/input/scp.rb +10 -64
  35. data/lib/oxidized/input/ssh.rb +10 -60
  36. data/lib/oxidized/input/sshbase.rb +107 -0
  37. data/lib/oxidized/input/telnet.rb +0 -4
  38. data/lib/oxidized/input/tftp.rb +7 -3
  39. data/lib/oxidized/model/aoscx.rb +5 -3
  40. data/lib/oxidized/model/aosw.rb +10 -11
  41. data/lib/oxidized/model/apc_aos.rb +4 -0
  42. data/lib/oxidized/model/apcaos.rb +39 -0
  43. data/lib/oxidized/model/arubainstant.rb +11 -20
  44. data/lib/oxidized/model/asa.rb +7 -7
  45. data/lib/oxidized/model/comware.rb +3 -1
  46. data/lib/oxidized/model/defacto.rb +26 -0
  47. data/lib/oxidized/model/dslcommands.rb +93 -0
  48. data/lib/oxidized/model/dslsetup.rb +102 -0
  49. data/lib/oxidized/model/efos.rb +5 -5
  50. data/lib/oxidized/model/exalink.rb +36 -0
  51. data/lib/oxidized/model/fastiron.rb +2 -2
  52. data/lib/oxidized/model/firelinuxos.rb +1 -3
  53. data/lib/oxidized/model/fortigate.rb +160 -0
  54. data/lib/oxidized/model/fortios.rb +28 -69
  55. data/lib/oxidized/model/fsos.rb +1 -3
  56. data/lib/oxidized/model/h3c.rb +1 -1
  57. data/lib/oxidized/model/ios.rb +21 -15
  58. data/lib/oxidized/model/ironware.rb +5 -3
  59. data/lib/oxidized/model/ivanti.rb +54 -0
  60. data/lib/oxidized/model/macros.rb +60 -0
  61. data/lib/oxidized/model/mlnxos.rb +11 -7
  62. data/lib/oxidized/model/model.rb +28 -126
  63. data/lib/oxidized/model/ndms.rb +6 -0
  64. data/lib/oxidized/model/netgear.rb +5 -3
  65. data/lib/oxidized/model/nxos.rb +2 -2
  66. data/lib/oxidized/model/outputs.rb +5 -0
  67. data/lib/oxidized/model/perle.rb +14 -8
  68. data/lib/oxidized/model/smartbyte.rb +48 -0
  69. data/lib/oxidized/model/truenas.rb +10 -1
  70. data/lib/oxidized/model/voss.rb +3 -0
  71. data/lib/oxidized/model/vyos.rb +3 -1
  72. data/lib/oxidized/node.rb +25 -23
  73. data/lib/oxidized/nodes.rb +2 -0
  74. data/lib/oxidized/output/file.rb +7 -1
  75. data/lib/oxidized/output/git.rb +11 -1
  76. data/lib/oxidized/output/gitcrypt.rb +1 -1
  77. data/lib/oxidized/output/http.rb +12 -3
  78. data/lib/oxidized/source/csv.rb +5 -0
  79. data/lib/oxidized/source/jsonfile.rb +5 -0
  80. data/lib/oxidized/source/sql.rb +5 -0
  81. data/lib/oxidized/version.rb +2 -2
  82. data/lib/oxidized/worker.rb +36 -15
  83. data/lib/refinements.rb +18 -0
  84. data/oxidized.gemspec +28 -24
  85. metadata +98 -55
  86. data/docs/Model-Notes/APC_AOS.md +0 -65
  87. data/docs/Model-Notes/FortiOS.md +0 -44
@@ -0,0 +1,43 @@
1
+ # Cisco Nexus 3550-F (ExaLink Fusion)
2
+
3
+ The Cisco Nexus 3550-F (formerly Exablaze ExaLink Fusion) is an ultra-low-latency
4
+ Layer 1/2 switch platform based on FPGA technology, primarily used in high-frequency
5
+ trading and HPC environments. It runs a custom Linux-based OS with a proprietary CLI
6
+ and JSON RPC API.
7
+
8
+ ## Device Configuration
9
+
10
+ Create a read-only user for Oxidized on the device:
11
+
12
+ ```
13
+ admin@N3550-F> configure user oxidized password <password>
14
+ admin@N3550-F> configure user oxidized privilege read-only
15
+ ```
16
+
17
+ ## Oxidized Configuration
18
+
19
+ ```yaml
20
+ source:
21
+ default: csv
22
+ csv:
23
+ file: "/home/oxidized/.config/oxidized/router.db"
24
+ delimiter: !ruby/regexp /:/
25
+ map:
26
+ name: 0
27
+ model: 1
28
+ ```
29
+
30
+ Example `router.db` entry:
31
+
32
+ ```bash
33
+ myswitch.example.com:exalink
34
+ ```
35
+
36
+ ## Notes
37
+
38
+ - Both SSH and Telnet are supported. SSH is recommended.
39
+ - The model collects `show version` (excluding uptime to avoid noisy diffs),
40
+ `show port`, and `show running-config`.
41
+ - Timestamps (`!Time:`) are stripped from the running config to avoid noisy diffs.
42
+ - The device prompt format is `hostname#` or `hostname>`.
43
+ - This model was developed and tested against software version 1.16.0.
@@ -0,0 +1,75 @@
1
+ # Fortinet models
2
+ There are two models for Fortinet devices:
3
+ - fortigate: for the FortiGate firewalls
4
+ - fortios: for VM-Based appliances (FortiManager, FortiADC, FortiAnalyzer...)
5
+
6
+ # Notes for both models
7
+ ## Configuration changes / hiding passwords
8
+ Fortigate and Fortios re-encrypt their passwords every time the configuration is shown.
9
+ This results in a lot of apparent configuration changes on every pull.
10
+
11
+ To avoid this, you have two options:
12
+ - remove secrets
13
+ - save significant changes only
14
+
15
+ ### Remove secrets
16
+ If you don't want to have a new version every time the configuration is
17
+ downloaded, you can hide all secrets. Beware that you won't have a full backup, as all passwords will be replaced with <configuration removed>
18
+
19
+ ```yaml
20
+ models:
21
+ fortigate:
22
+ vars:
23
+ remove_secret: true
24
+ ```
25
+
26
+ ### Save significant changes only
27
+ You can [store the configuration only on significant changes](/docs/Configuration.md#store-configuration-only-on-significant-changes)
28
+ by setting the [variable](#options-credentials-vars-etc-precedence)
29
+ `output_store_mode` to `on_significant`. On FortiGate and FortiOS, this
30
+ prevents Oxidized from saving a configuration when there were only changes to
31
+ the encrypted passwords. Beware that you won't have the last backup if you only
32
+ changed a password.
33
+
34
+ ```yaml
35
+ vars:
36
+ output_store_mode: on_significant
37
+ ```
38
+
39
+ # Notes for the FortiGate model
40
+ ## Create user oxidized with ED25519 public key
41
+ You can use a user/password for retrieving the configuration or use a SSH public key:
42
+
43
+ ```text
44
+ config system admin
45
+ edit oxidized
46
+ set trusthost1 192.0.2.1 255.255.255.255
47
+ set accprofile "super_admin_readonly"
48
+ set ssh-public-key1 "ssh-ed25519 AAAAThisIsJustAnExampleKey_UseYourOxidizedPUBLICKEY oxidized@librenms"
49
+ end
50
+ ```
51
+
52
+ ## config vs. full config
53
+ On FortiGate, you can get a configuration without default values (`show`) or
54
+ including all default values (`show full-configuration`).
55
+
56
+ The full configuration can be long and may cause timeouts.
57
+ Starting with with oxidized 0.30.1, the default is to get the short configuration.
58
+
59
+ If you need the full configuration, you can activate it in oxidized config file:
60
+ ```yaml
61
+ models:
62
+ fortigate:
63
+ vars:
64
+ fullconfig: true
65
+ ```
66
+ ## Autoupdate
67
+ You can get the result of `diagnose autoupdate version` by setting the [variable](#options-credentials-vars-etc-precedence) `fortigate_autoupdate` to `true`:
68
+
69
+ ```yaml
70
+ vars:
71
+ fortigate_autoupdate: true
72
+ ```
73
+
74
+ Note that the variable `fortios_autoupdate` is deprecated and will be removed
75
+ in a future Version of Oxidized. Use `fortigate_autoupdate` instead.
@@ -0,0 +1,59 @@
1
+ ### Ivanti Connect Secure (ICS)
2
+
3
+ #### Overview
4
+
5
+ This model provides support for Ivanti Connect Secure (ICS) appliances using REST API ([official documentation](https://help.ivanti.com/ps/help/en_US/ICS/22.x/22.7R2/22.xICSAG.pdf)).
6
+ ICS stores its configuration as a binary ZIP archive (with `system.cfg` and `user.cfg` files) which is retrieved using the `/api/v1/system/binary-configuration` endpoint.
7
+
8
+ The model performs an initial authentication against `/api/v1/realm_auth` using Basic Auth (`username`/`password`) and retrieves a temporary `api_key`.
9
+ This key is then used for all further API requests during the Oxidized collection cycle.
10
+
11
+ The model is designed to work with standard ICS deployments without requiring command-line access to the device.
12
+
13
+ #### How Configuration Is Retrieved
14
+
15
+ 1. Oxidized authenticates using:
16
+
17
+ ```bash
18
+ POST /api/v1/realm_auth
19
+ ```
20
+
21
+ with:
22
+ - Basic Auth: `username` + `password`
23
+ - JSON body `{"realm": "<realm>"}`
24
+
25
+
26
+ 2. ICS returns a temporary:
27
+
28
+ ```json
29
+ { "api_key": "<token>" }
30
+ ```
31
+
32
+
33
+ 3. The configuration is fetched from:
34
+
35
+ ```bash
36
+ GET /api/v1/system/binary-configuration
37
+ ```
38
+
39
+ with:
40
+ - `api_key` as `username`
41
+ - `''` as `password`
42
+
43
+ ICS responds with a BASE64-encoded ZIP archive containing the device configuration.
44
+ The model stores this BASE64 value as a single uninterrupted line.
45
+
46
+
47
+ #### Required Node Configuration
48
+
49
+ In source (CSV, HTTP, SQL, etc.), simply define:
50
+
51
+ ```yaml
52
+ model: ivanti
53
+ username: <your username>
54
+ password: <your password>
55
+ vars:
56
+ realm: <your realm> # Optional, default = "Users"
57
+ ```
58
+
59
+ The model will automatically handle authentication and obtain the API key as stated above.
@@ -0,0 +1,19 @@
1
+ # TrueNAS
2
+
3
+ This should support both older TrueNAS CORE (FreeBSD-based) and newer
4
+ TrueNAS SCALE (Linux-based) devices.
5
+
6
+ ## Authentication
7
+
8
+ Ensure that the user configured for oxidized to login to your device has the
9
+ permissions to read the configuration database. On older devices, this would
10
+ just work.
11
+
12
+ On newer devices, the `/data/freenas-v1.db` file can only be read by the
13
+ root user. You can make sure that the user that oxidized uses to login
14
+ (`oxidized` in this example) can dump the configuration using `sudo` by
15
+ adding something like this to your `/etc/sudoers` file:
16
+
17
+ ```
18
+ oxidized ALL=(ALL) NOPASSWD: /usr/bin/sqlite3 file\:///data/freenas-v1.db?mode\=ro&immutable\=1 .dump
19
+ ```
@@ -4,6 +4,7 @@ effort to use. There are three different default unit tests for models:
4
4
  - [Device Simulation](ModelUnitTests.md#device-simulation)
5
5
  - [Device Prompt](ModelUnitTests.md#device-prompt)
6
6
  - [Secrets](ModelUnitTests.md#secrets)
7
+ - [Significant Changes](ModelUnitTests.md#significant-changes)
7
8
 
8
9
  You only need to provide test files under [/spec/model/data](/spec/model/data),
9
10
  and the tests will be run automatically with `rake test`. See
@@ -187,6 +188,28 @@ pass:
187
188
  - 'hash-mgmt-user rocks password hash <secret removed> usertype read-only'
188
189
  ```
189
190
 
191
+ ## Significant Changes
192
+ You can test if the model correctly detects significant changes from a YAML
193
+ simulation file (`#simulation.yaml`) when run with variable
194
+ `output_store_mode` set to `on_significant`.
195
+
196
+ The output is checked against a file with the same
197
+ prefix as the yaml simulation file, but with the suffix
198
+ `#significant_changes.yaml`.
199
+
200
+ The `#significant_changes.yaml` file contains two sections with a list of
201
+ strings or regular expressions to test:
202
+ - pass: the test passes only if the output contains these strings (significant changes).
203
+ - fail: the test fails if the output contain these strings (non-significant changes).
204
+
205
+ ```yaml
206
+ pass:
207
+ - "! Processor ID: FCL2XXXXXXX"
208
+ fail:
209
+ - "! Last configuration change at 13:57:08 CET Wed Mar 13 2024"
210
+ - "! NVRAM config last updated at 15:26:39 CET Wed Mar 13 2024 by oxidized"
211
+ ```
212
+
190
213
  ## Custom tests
191
214
  When you write custom tests for your models, please do not use the filenames
192
215
  mentioned above, as it will interfere with the standard tests. If you need to
data/docs/Outputs.md CHANGED
@@ -211,9 +211,9 @@ output:
211
211
 
212
212
  Please note that user list is only updated once at creation.
213
213
 
214
- ## Output: Http
214
+ ## Output: HTTP
215
215
 
216
- The HTTP output will POST a config to the specified HTTP URL. Basic username/password authentication is supported.
216
+ The HTTP output will POST a config as JSON to the specified HTTP URL. It supports HTTP Basic Authentication, custom headers, and SSL/TLS verification control.
217
217
 
218
218
  Example HTTP output configuration:
219
219
 
@@ -221,11 +221,25 @@ Example HTTP output configuration:
221
221
  output:
222
222
  default: http
223
223
  http:
224
- user: admin
225
- password: changeit
226
224
  url: "http://192.168.162.50:8080/db/coll"
225
+ user: admin # Optional - for HTTP basic auth
226
+ password: changeit # Optional - for HTTP basic auth
227
+ ssl_verify: false # Optional - verify SSL certs (default: false)
228
+ headers: # Optional - custom HTTP headers
229
+ X-Custom-Header: "value"
230
+ X-API-Key: "secret"
227
231
  ```
228
232
 
233
+ ### Configuration Options
234
+
235
+ | Option | Required | Description |
236
+ |--------------|----------|---------------------------------------------------------|
237
+ | `url` | Yes | Full HTTP/HTTPS URL to POST the config to |
238
+ | `user` | No | Username for HTTP Basic Authentication |
239
+ | `password` | No | Password for HTTP Basic Authentication |
240
+ | `ssl_verify` | No | When `true`, verify SSL certificates (default: `false`) |
241
+ | `headers` | No | Hash of custom HTTP headers to include in the request |
242
+
229
243
  ## Output types
230
244
 
231
245
  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).
data/docs/Release.md CHANGED
@@ -61,7 +61,7 @@ They test different ruby versions an run security checks on the code (codeql).
61
61
  6. Install an test the gem locally
62
62
  ```shell
63
63
  gem install --user-install pkg/oxidized-0.xx.yy.gem
64
- ~/.local/share/gem/ruby/3.1.0/bin/oxidized
64
+ ~/.local/share/gem/ruby/3.3.0/bin/oxidized
65
65
  ```
66
66
 
67
67
  ## Release in github
data/docs/Ruby-API.md CHANGED
@@ -10,11 +10,15 @@ The following objects exist in Oxidized.
10
10
  - [Model](#model)
11
11
  - [At the top level](#at-the-top-level)
12
12
  - [cfg](#cfg)
13
+ - [inputs](#inputs)
13
14
  - [cmd](#cmd)
14
15
  - [comment](#comment)
15
16
  - [prompt](#prompt)
16
17
  - [expect](#expect)
17
18
  - [pre / post](#pre--post)
19
+ - [macro :enable](#macro-enable)
20
+ - [clean :escape_codes](#clean-escape_codes)
21
+ - [clean :cut](#clean-cut)
18
22
  - [At the second level](#at-the-second-level)
19
23
  - [comment](#comment-1)
20
24
  - [password](#password)
@@ -26,9 +30,11 @@ The following objects exist in Oxidized.
26
30
  - [clear: true](#clear-true)
27
31
  - [prepend: true](#prepend-true)
28
32
  - [Refinements - String Convenience Methods](#refinements)
29
- - [cut_tail](#cut_tail)
30
- - [cut_head](#cut_head)
31
- - [cut_both](#cut_both)
33
+ - [cut_tail](#cut_tail)
34
+ - [cut_head](#cut_head)
35
+ - [cut_both](#cut_both)
36
+ - [keep_lines](#keep_lines)
37
+ - [reject_lines](#reject_lines)
32
38
 
33
39
  ## Input
34
40
 
@@ -87,6 +93,40 @@ The block may contain commands to change some behaviour for the given methods
87
93
 
88
94
  Supports [monkey patching](#monkey-patching).
89
95
 
96
+ #### 'inputs'
97
+ `inputs` can be used to specify multiple inputs to be run on the model. It
98
+ takes a list of either input symbols or lists of input symbols:
99
+ ```ruby
100
+ inputs [:ssh, %i[scp ftp]]
101
+ inputs [:ssh, :scp]
102
+ ```
103
+
104
+ Oxidized will run the model against each item of `inputs`. If an item is a
105
+ list of symbols (`%i[scp ftp]`), it will try each input in the order
106
+ configured in the `input/default` section of the oxidized configuration file.
107
+
108
+ If `inputs` is not specified, Oxidized will try each input that has a `cfg`
109
+ section in the model, in the order configured in the `input/default` section
110
+ of the oxidized configuration file.
111
+
112
+ To specify which command is to run against which input, use the `input`
113
+ parameter of the `cmd` configuration:
114
+ ```ruby
115
+ cmd 'upsabout', input: :ssh do |cfg|
116
+ comment cfg
117
+ end
118
+
119
+ cmd 'config.ini', input: %i[scp ftp] do |cfg|
120
+ "; ========== config.ini ==========\n" + cfg
121
+ end
122
+ ```
123
+
124
+ `cmd` without `input` parameter will run against every input.
125
+
126
+
127
+ See the [ApcAos model](/lib/oxidized/model/apcaos.rb) for a full example.
128
+
129
+
90
130
  #### `cmd`
91
131
 
92
132
  Is used to specify commands that should be executed on a model in order to
@@ -96,6 +136,7 @@ gather its configuration. It can be called with:
96
136
  * A string and a block
97
137
  * `:all` and a block
98
138
  * `:secret` and a block
139
+ * `:significant_changes` and a block
99
140
 
100
141
  The block takes a single parameter `cfg` containing the output of the command
101
142
  being processed.
@@ -116,14 +157,27 @@ given block before emitting it to hide secrets if secret hiding is enabled. The
116
157
  block should replace any secrets with `'<hidden>'` and return the resulting
117
158
  string.
118
159
 
160
+ Calling `cmd` with `:significant_changes` and a block will pass the final
161
+ configuration to the given block. The resulting string should contain
162
+ significant changes only and will be used to
163
+ [decide if the configuration should be stored](Configuration.md#store-configuration-only-on-significant-changes).
164
+
119
165
  Execution order is `:all`, `:secret`, and lastly the command specific block, if
120
166
  given.
121
167
 
122
- The `cmd "string"` method for accepts a lambda function via the `:if` argument
168
+ The `cmd "string"` method accepts a lambda function via the `:if` argument
123
169
  to execute the command only when the lambda evaluates to true.
124
170
  The lambda function is evaluated at runtime in the instance context.
125
171
  See [Conditional `cmd`](Creating-Models.md#conditional-cmd) for details.
126
172
 
173
+ The `cmd "string"` method accepts a list of supported inputs via the `:input`
174
+ argument to limit this command to specific inputs.
175
+ ```ruby
176
+ cmd 'config.ini', input: %i[scp ftp] do |cfg|
177
+ "; ========== config.ini ==========\n" + cfg
178
+ end
179
+ ```
180
+
127
181
  Supports [monkey patching](#monkey-patching).
128
182
 
129
183
  #### pre / post
@@ -167,6 +221,28 @@ it's further processed.
167
221
 
168
222
  Supports [monkey patching](#monkey-patching).
169
223
 
224
+ #### `macro :enable`
225
+ Implements an [handling of enable](Creating-Models.md#handling-enable-mode) for the model.
226
+
227
+ #### `clean :escape_codes`
228
+ [Remove ANSI escape codes](Creating-Models.md#remove-ansi-escape-codes) from the output.
229
+
230
+ #### `clean :cut`
231
+ Removes (default) the first and last line of the outputs (most of the time
232
+ command echo and prompt).
233
+ Arguments: head (default: 1), tail (default: 1)
234
+ ```ruby
235
+ clean :cut, head: 2, tail: 0
236
+ ```
237
+
238
+ Equivalent to:
239
+ ```ruby
240
+ cmd :all do |cfg|
241
+ cfg.cut_both(2, 0)
242
+ end
243
+ ```
244
+
245
+
170
246
  ### At the second level
171
247
 
172
248
  The following methods are available:
@@ -223,7 +299,6 @@ This functionality is supported by `cfg`, `cmd`, `pre_*`, `post_*`, and `expect`
223
299
  blocks.
224
300
 
225
301
  #### `clear: true`
226
-
227
302
  Resets the existing block, allowing the user to completely override its contents.
228
303
 
229
304
  #### `prepend: true`
@@ -253,3 +328,9 @@ single line was present.
253
328
 
254
329
  Returns a multi-line string without the first and last lines, or an empty string
255
330
  if fewer than three lines were present.
331
+
332
+ #### `keep_lines`
333
+ Returns a multi-line string with only the lines matching any pattern (String or Regexp) given in an array.
334
+
335
+ #### `reject_lines`
336
+ Returns a multi-line string without the lines matching any pattern (String or Regexp) given in an array.
@@ -2,6 +2,7 @@
2
2
 
3
3
  |Vendor |OS model |oxidized model |model maintainers|comment / model notes|
4
4
  |--------------------|------------------------------|-------------------------------------------------|-----------------|---------------------|
5
+ |-generic- |Cisco-like |[defacto](/lib/oxidized/model/defacto.rb) |@ytti, @robertcheramy|[The defacto model may work on cisco like CLIs](/docs/Creating-Models.md#use-the-defacto-model)|
5
6
  |6WIND |VSR |[sixwind](/lib/oxidized/model/sixwind.rb) |@hcaldicott |
6
7
  |A10 Networks |ACOS |[acos](/lib/oxidized/model/acos.rb) | |
7
8
  |Accedian Performance Elements (NIDs)|AEN |[aen](/lib/oxidized/model/aen.rb)
@@ -17,7 +18,7 @@
17
18
  |Allied Telesis |Alliedware Plus |[awplus](/lib/oxidized/model/awplus.rb)
18
19
  | |AT-8000S, AT-8000GS series |[powerconnect](/lib/oxidized/model/powerconnect.rb)
19
20
  |Alvarion |BreezeACCESS |[alvarion](/lib/oxidized/model/alvarion.rb)
20
- |APC |AOS |[apc_aos](/lib/oxidized/model/apc_aos.rb) |@robertcheramy |[APC AOS](Model-Notes/APC_AOS.md)
21
+ |APC |AOS |[apcaos](/lib/oxidized/model/apcaos.rb) |@robertcheramy |[APC](Model-Notes/APC.md)
21
22
  |Arbor Networks |ArbOS |[arbos](/lib/oxidized/model/arbos.rb) | |[ArbOS](Model-Notes/ArbOS.md)
22
23
  |Arista |EOS |[eos](/lib/oxidized/model/eos.rb) | |[EOS](Model-Notes/EOS.md)
23
24
  |Arris |C4CMTS |[c4cmts](/lib/oxidized/model/c4cmts.rb)
@@ -52,6 +53,7 @@
52
53
  | |AsyncOS |[asyncos](/lib/oxidized/model/asyncos.rb)
53
54
  | |CatOS |[catos](/lib/oxidized/model/catos.rb)
54
55
  | |Cisco Catalyst Express |[ciscoce](/lib/oxidized/model/ciscoce.rb)
56
+ | |ExaLink Fusion (Nexus 3550-F) |[exalink](/lib/oxidized/model/exalink.rb) |@obol89 |[ExaLink](Model-Notes/ExaLink.md)
55
57
  | |FireLinuxOS |[firelinuxos](/lib/oxidized/model/firelinuxos.rb)
56
58
  | |IOS |[ios](/lib/oxidized/model/ios.rb) |@robertcheramy |[IOS](Model-Notes/IOS.md)
57
59
  | |IOSXR |[iosxr](/lib/oxidized/model/iosxr.rb)
@@ -74,7 +76,7 @@
74
76
  |DELL |PowerConnect |[powerconnect](/lib/oxidized/model/powerconnect.rb)
75
77
  | |AOSW |[aosw](/lib/oxidized/model/aosw.rb) | |Same model as Aruba Wireless
76
78
  | |DellX |[dellx](/lib/oxidized/model/dellx.rb)
77
- | |Dell EMC Networking OS6 |[os6](/lib/oxidized/model/os6.rb) | |[Dell EMC Networking OS6](Model-Notes/OS6.md)
79
+ | |Dell EMC Networking OS6 |[os6](/lib/oxidized/model/os6.rb) | |[Dell EMC Networking OS6](Model-Notes/OS6.md)
78
80
  | |Dell EMC Networking OS10 |[os10](/lib/oxidized/model/os10.rb) | |[Dell EMC Networking OS10](Model-Notes/OS10.md)
79
81
  |D-Link |D-Link |[dlink](/lib/oxidized/model/dlink.rb)
80
82
  | |D-Link cisco like CLI |[dlinknextgen](/lib/oxidized/model/dlinknextgen.rb)
@@ -98,10 +100,12 @@
98
100
  |Firebrick |FBxxxx |[firebrick](/lib/oxidized/model/firebrick.rb)
99
101
  |Force10 |DNOS |[dnos](/lib/oxidized/model/dnos.rb)
100
102
  | |FTOS |[ftos](/lib/oxidized/model/ftos.rb)
101
- |FortiGate |FortiOS |[fortios](/lib/oxidized/model/fortios.rb) | |[FortiOS](Model-Notes/FortiOS.md)
102
- |FortiWLC |FortiWLC |[fortiwlc](/lib/oxidized/model/fortiwlc.rb)
103
+ |Fortinet |FortiGate |[fortigate](/lib/oxidized/model/fortigate.rb) |@robertcheramy |[Fortinet](Model-Notes/Fortinet.md)
104
+ | |FortiOS |[fortios](/lib/oxidized/model/fortios.rb) |@robertcheramy |[Fortinet](Model-Notes/Fortinet.md)
105
+ | |FortiWLC |[fortiwlc](/lib/oxidized/model/fortiwlc.rb)
103
106
  |Fujitsu |PRIMERGY Blade switch 1/10Gbe |[fujitsupy](/lib/oxidized/model/fujitsupy.rb)
104
107
  | |1FINITY Switches |[onefinity](/lib/oxidized/model/onefinity.rb)
108
+ |[Garderos](https://garderos.com/) |GRS (Garderos Router Software) |[garderos](/lib/oxidized/model/garderos.rb) | @robertcheramy |Routers for harsh environments
105
109
  |GCOM Technologies |Broadband Network Platform Software|[gcombnps](/lib/oxidized/model/gcombnps.rb)
106
110
  |Grandstream Networks|GSX |[grandstream](/lib/oxidized/model/grandstream.rb)
107
111
  |Hatteras |Hatteras |[hatteras](/lib/oxidized/model/hatteras.rb)
@@ -119,6 +123,7 @@
119
123
  |Icotera |6400 series |[icotera](/lib/oxidized/model/icotera.rb)
120
124
  |Ingate |SIParator/Firewalls |[ingate](/lib/oxidized/model/ingate.rb) |@thanegill
121
125
  |IP Infusion |OcNOS |[ocnos](/lib/oxidized/model/ocnos.rb)
126
+ |Ivanti |Ivanti Connect Secure (ICS) |[ivanti](/lib/oxidized/model/ivanti.rb) |@candleflip |[ICS](Model-Notes/IvantiConnectSecure.md)
122
127
  |Juniper |JunOS |[junos](/lib/oxidized/model/junos.rb) | |[MX/QFX/EX/SRX/J Series](Model-Notes/JunOS.md)
123
128
  | |ScreenOS (Netscreen) |[screenos](/lib/oxidized/model/screenos.rb)
124
129
  |LANCOM Systems GmbH |LCOS |[lancom](/lib/oxidized/model/lancom.rb)
@@ -127,7 +132,7 @@
127
132
  |Linuxgeneric |CentOS |[linuxgeneric](/lib/oxidized/model/linuxgeneric.rb)| |[LinuxGeneric](Model-Notes/LinuxGeneric.md)
128
133
  |Mellanox |MLNX-OS |[mlnxos](/lib/oxidized/model/mlnxos.rb)
129
134
  | |Voltaire |[voltaire](/lib/oxidized/model/voltaire.rb)
130
- |Mikrotik |RouterOS |[routeros](/lib/oxidized/model/routeros.rb) | |[RouterOS](Model-Notes/RouterOS.md)
135
+ |Mikrotik |RouterOS |[routeros](/lib/oxidized/model/routeros.rb) | |[RouterOS](Model-Notes/RouterOS.md)
131
136
  | |SwOS and SwOS Lite |[swos](/lib/oxidized/model/swos.rb)
132
137
  |Mimosa |Mimosa (B11) |[mimosab11](/lib/oxidized/model/mimosab11.rb)
133
138
  |Motorola |RFS |[mtrlrfs](/lib/oxidized/model/mtrlrfs.rb)
@@ -138,6 +143,7 @@
138
143
  |Netgear |Netgear switches |[netgear](/lib/oxidized/model/netgear.rb) | |[Netgear](Model-Notes/Netgear.md)
139
144
  |Netonix |WISP Switch (As Netonix) |[netonix](/lib/oxidized/model/netonix.rb)
140
145
  |Nokia (formerly TiMetra, Alcatel, Alcatel-Lucent)|SR OS (TiMOS)|[sros](/lib/oxidized/model/sros.rb) | |[Nokia ISAM](Model-Notes/Nokia.md)
146
+ | |SR OS Model-Driven CLI (7705 SAR, 7210 SAS, 7450 ESS, 7750 SR, 7950 XRS, NSP) |[srosmd](/lib/oxidized/model/srosmd.rb) | |
141
147
  |OneAccess |OneOS |[oneos](/lib/oxidized/model/oneos.rb)
142
148
  | |TDRE |[tdre](/lib/oxidized/model/tdre.rb)
143
149
  |OpenBSD | |[openbsd](/lib/oxidized/model/openbsd.rb)
@@ -152,13 +158,16 @@
152
158
  |Pure Storage |PurityOS |[purityos](/lib/oxidized/model/purityos.rb)
153
159
  |Radware |AlteonOS |[alteonos](/lib/oxidized/model/alteonos.rb)
154
160
  |Raisecom |Raisecom |[raisecom](/lib/oxidized/model/raisecom.rb)
161
+ |Riverbed |SteelHead |[riverbed](/lib/oxidized/model/riverbed.rb)
155
162
  |Ruijie Networks |RGOS |[rgos](/lib/oxidized/model/rgos.rb)
156
163
  |QTECH |QSW-2800, QSW-3400, QSW-3450, QSW-3500|[qtech](/lib/oxidized/model/qtech.rb)
157
164
  |Quanta |Quanta / VxWorks 6.6 (1.1.0.8)|[quantaos](/lib/oxidized/model/quantaos.rb)
158
165
  |Siklu |EtherHaul |[siklu](/lib/oxidized/model/siklu.rb) |@bdg-robert
159
166
  | |Multihaul TG |[siklumhtg](/lib/oxidized/model/siklumhtg.rb) |@bdg-robert |[Siklu Multihaul TG](Model-Notes/SikluMHTG.md)
160
167
  |Seiko Solutions |SmartCS, SmartCS mini |[smartcs](/lib/oxidized/model/smartcs.rb)
168
+ |SmartByte |LT-S8228G series |[smartbyte](/lib/oxidized/model/smartbyte.rb) |@freddy36
161
169
  |SonicWALL |SonicOS |[sonicos](/lib/oxidized/model/sonicos.rb)
170
+ |[SONiC](https://sonicfoundation.dev/) |Enterprise SONiC |[enterprise_sonic](/lib/oxidized/model/enterprise_sonic.rb) | |
162
171
  |SNR |SNR-S300G, S2xxx, S3xxx, S4xxx|[dcnos](/lib/oxidized/model/dcnos.rb)
163
172
  |Speedtouch |Thomson Speedtouch |[speedtouch](/lib/oxidized/model/speedtouch.rb)
164
173
  |Supermicro |SSE-G2252, G2252P |[edgecos](/lib/oxidized/model/edgecos.rb)
@@ -176,14 +185,14 @@
176
185
  | |Edgeos |[edgeos](/lib/oxidized/model/edgeos.rb)
177
186
  | |EdgeSwitch |[edgeswitch](/lib/oxidized/model/edgeswitch.rb)
178
187
  | |AirFiber |[airfiber](/lib/oxidized/model/airfiber.rb)
179
- | |UnifiAP |[unifiap](/lib/oxidized/model/unifiap.rb) |@clifcox |Also suports AirOS, and some Unifi switches
180
- |Uplink |EP4440-DP |[EP4440](/lib/oxidized/model/uplinkolt.rb) | |Might support all EP4440 series
188
+ | |UnifiAP |[unifiap](/lib/oxidized/model/unifiap.rb) |@clifcox |Also suports AirOS, and some Unifi switches
189
+ |Uplink |EP4440-DP |[EP4440](/lib/oxidized/model/uplinkolt.rb) | |Might support all EP4440 series
181
190
  |VMWare |NSX Edge (configuration) |[nsxconfig](/lib/oxidized/model/nsxconfig.rb)
182
191
  | |NSX Edge (firewall rules) |[nsxfirewall](/lib/oxidized/model/nsxfirewall.rb)
183
192
  | |NSX Distributed Firewall |[nsxdfw](/lib/oxidized/model/nsxdfw.rb)
184
- |VYOS Networks |VYOS |[vyos](/lib/oxidized/model/vyos.rb)
185
- | |Fork of Vyatta, tracking the supported versions (>= 1.4.x)
193
+ |VYOS Networks |VYOS |[vyos](/lib/oxidized/model/vyos.rb) | |Fork of Vyatta, tracking the supported versions (>= 1.4.x)
186
194
  |Watchguard |Fireware OS |[firewareos](/lib/oxidized/model/firewareos.rb)
195
+ |Waystream (PacketFront)|iBOS (Intelligent Broadband OS)|[ibos](/lib/oxidized/model/ibos.rb)
187
196
  |Westell |Westell 8178G, Westell 8266G |[weos](/lib/oxidized/model/weos.rb)
188
197
  |Yadro |KornfeldOS |[kornfeldos](/lib/oxidized/model/kornfeldos.rb)
189
198
  |YAMAHA |YAMAHA NVR/RTX Series |[yamaha](/lib/oxidized/model/yamaha.rb)
@@ -193,5 +202,7 @@
193
202
  |Zyxel |ZyNOS |[zynos](/lib/oxidized/model/zynos.rb) | |[XGS4600 Series](Model-Notes/XGS4600-Zyxel.md)
194
203
  | |ZyNOS GS-series variant |[zynosgs](/lib/oxidized/model/zynosgs.rb)
195
204
  | |ZyNOS ADSL |[zynosadsl](/lib/oxidized/model/zynosadsl.rb)
205
+ | |ZyNOS CLI (DSLAMs, e.g. SAM1316)|[zynoscli](/lib/oxidized/model/zynoscli.rb)
206
+ | |ZyNOS MGS series |[zynosmgs](/lib/oxidized/model/zynosmgs.rb)
196
207
  | |NDMS |[ndms](/lib/oxidized/model/ndms.rb)
197
208
  | |1308 |[zy1308](/lib/oxidized/model/zy1308.rb)
@@ -86,7 +86,7 @@ ssh-keyscan gitserver.git.com >> ~/.ssh/known_hosts
86
86
 
87
87
  If you are running oxidized in a container, you need to map /home/oxidized/.ssh in the
88
88
  container to a local repository and save the known_hosts in the local repository. You can
89
- find an example how to do this under [examples/podman-compose](/examples/podman-compose/)
89
+ find an example how to do this under [Docker.md](Docker.md#store-the-ssh-keys-a-remote-git-repository)
90
90
 
91
91
  ## Oxidized ignores the changes I made to its git repository
92
92
  First of all: you shouldn't manipulate the git repository of oxidized. Don't
data/extra/device2yaml.rb CHANGED
@@ -91,9 +91,8 @@ def yaml_output(prepend = '')
91
91
 
92
92
  prepend = @sequence_prepend_output + prepend
93
93
 
94
- # as we want to prepend 'prepend' to each line, we need each_line and chomp
95
- # chomp removes the trainling \n
96
- @ssh_output.each_line(chomp: true) do |line|
94
+ # each_line(chomp: true) would remove \r\n, so we prefer split
95
+ @ssh_output.split("\n", -1).each do |line|
97
96
  # encode line and remove the first and the trailing double quote
98
97
  line = line.dump[1..-2]
99
98
  if firstline
@@ -0,0 +1,55 @@
1
+ ### script in ~/config/oxidized/hook/modelrules.rb ## or OXDIZED_HOME equivalent
2
+ ###
3
+ ### router.db:
4
+ ### router1:1.1.1.1:routeros::mikrotik
5
+ ### router2:2.2.2.2:ios:switch:cisco
6
+ ### router3:3.3.3.3:routeros:switch:mikrotik
7
+ ###
8
+ ### config:
9
+ ### source:
10
+ ### default: csv
11
+ ### csv:
12
+ ### file: "/Users/ytti/.config/oxidized/router.db"
13
+ ### delimiter: !ruby/regexp /:/
14
+ ### map:
15
+ ### name: 0
16
+ ### ip: 1
17
+ ### model: 2
18
+ ### group: 3
19
+ ### hooks:
20
+ ### somename:
21
+ ### type: modelrules
22
+ ### events: ["source_node_transform"]
23
+ ### rules:
24
+ ### - vendor: mikrotik
25
+ ### group: switch
26
+ ### model: eltex
27
+ ###
28
+ ### Nodes BEFORE script:
29
+ ### {name: "router1", ip: "1.1.1.1", model: "routeros", group: ""}
30
+ ### {name: "router2", ip: "2.2.2.2", model: "ios", group: "switch"}
31
+ ### {name: "router3", ip: "3.3.3.3", model: "routeros", group: "switch"}
32
+ ###
33
+ ### Nodes AFTER script:
34
+ ### {name: "router1", ip: "1.1.1.1", model: "routeros", group: ""}
35
+ ### {name: "router2", ip: "2.2.2.2", model: "ios", group: "switch"}
36
+ ### {name: "router3", ip: "3.3.3.3", model: "eltex", group: "switch"}
37
+ class ModelRules < Oxidized::Hook
38
+ def validate_cfg!
39
+ raise KeyError, 'hook.rules is required' unless cfg.has_key?('rules')
40
+ end
41
+
42
+ def run_hook(ctx)
43
+ # node is the node[key] that we'd return without manipulation
44
+ node = ctx.node ## e.g. node[:ip], node[:model] - what ever config maps
45
+
46
+ ## node_raw is source specific, in CSV it is just the field number, in HTTP it is JSON
47
+ vendor = ctx.node_raw[4]
48
+
49
+ cfg.rules.each do |rule|
50
+ node[:model] = rule['model'] if node[:group] == rule['group'] && vendor == rule['vendor']
51
+ end
52
+
53
+ node
54
+ end
55
+ end