You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The inventory file that the poller uses describes a set of sources used to gather the list of devices, credentials to authenticate in the devices, default settings and eventually puts all together defining namespaces. An extensive explanation of each secation is provided on this page.
4
4
5
5
!!! warning
6
-
Starting with version 0.16.0 the old options `-D` and `-a` and the old inventory format are no longer supported.
7
-
See the section [Migrating to the new format](#migrating-to-new-format).
6
+
Starting with version 0.16.0 the old options `-D` and `-a` and the old inventory format are no longer supported.
7
+
See the section [Migrating to the new format](#migrating-to-new-format).
8
8
9
9
The new inventory is structured in 4 major pieces, explained in its own section:
10
10
@@ -17,68 +17,68 @@ Here is an example of an inventory file with a bunch of different options, but n
- **This is just an example** that covers all the possible combinations, **not an real life inventory**
84
84
- **Do not specify device type unless you're using REST**. SuzieQ automatically determines device type with SSH
@@ -102,7 +102,7 @@ Currently this method is used to specify passwords, passphrases and tokens.
102
102
The device sources currently supported are:
103
103
104
104
- Host list (the same used with the old option `-D` in SuzieQ 0.15.x or lower)
105
-
- Ansible inventory, specifing a path to a file that has to be the output of `ansible-inventory --list` command
105
+
- Ansible inventory, specifing a path to a file that has to be the output of ```ansible-inventory --list``` command
106
106
- Netbox
107
107
- Nautobot
108
108
@@ -116,13 +116,14 @@ Whenever a source has many fields in common with another, you don't have to rewr
116
116
token: your-api-token-here
117
117
url: http://127.0.0.1:8000
118
118
tag:
119
-
- suzieq-demo
119
+
- suzieq-demo
120
120
period: 3600
121
121
122
-
- name: netbox-copy # This source will use the same set of parameters of 'netbox-orig'
123
-
copy: netbox-orig # and only overrides the 'tag' field.
122
+
- name: netbox-copy # This source will use the same set of parameters of 'netbox-orig'
123
+
copy: netbox-orig # and only overrides the 'tag' field.
124
124
tag:
125
-
- suzieq-copy
125
+
- suzieq-copy
126
+
126
127
```
127
128
128
129
### <a name='source-host-list'></a>Host list
@@ -146,7 +147,7 @@ There's a template in the docs directory called `hosts-template.yml`. You can co
146
147
147
148
### <a name='source-ansible'></a>Ansible
148
149
149
-
If you are using Ansible to configure the devices, it is possible to set the output of the `ansible-inventory --list` command as an input source.
150
+
If you are using Ansible to configure the devices, it is possible to set the output of the ```ansible-inventory --list``` command as an input source.
150
151
Once you created a json file containing the result of the command, with:
151
152
152
153
```shell
@@ -161,9 +162,9 @@ Now you can set the path of the ansible inventory in the source:
161
162
path: /path/to/ansible.json
162
163
```
163
164
164
-
Since Ansible devices cannot really be split up, the device and auth sections apply to **all** the devices in the Ansible inventory file. This is a limitaion of the Ansible source input. We always assume ssh as the transport unless otherwise specified in the device section of the SuzieQ inventory file.
165
+
Since Ansible devices cannot really be split up, the device and auth sections apply to **all** the devices in the Ansible inventory file. This is a limitaion of the Ansible source input. We always assume ssh as the transport unless otherwise specified in the device section of the SuzieQ inventory file.
165
166
!!! info
166
-
From 0.21.0, with Ansible inventories, the device type and transport are taken from the specification in the device section of the suzieq inventory file. You must specify the transport as rest if you want to use rest as the transport for EOS devices. By default, we assume ssh as the transport. For PANOS also, you must specify the device type and transport. Before version 0.21.0, Ansible inventory assumed REST as the transport for EOS, even if the user specified the transport as SSH in the device section.
167
+
From 0.21.0, with Ansible inventories, the device type and transport are taken from the specification in the device section of the suzieq inventory file. You must specify the transport as rest if you want to use rest as the transport for EOS devices. By default, we assume ssh as the transport. For PANOS also, you must specify the device type and transport. Before version 0.21.0, Ansible inventory assumed REST as the transport for EOS, even if the user specified the transport as SSH in the device section.
167
168
168
169
### <a name='source-netbox'></a>Netbox
169
170
@@ -175,9 +176,9 @@ The token is considered a [sensitive data](#sensitive-data), so it can be specif
175
176
Since Netbox is a _dynamic source_, the data are periodically pulled, the period can be set to any desired number in seconds (default is 3600).
176
177
177
178
!!!Info
178
-
Each netbox source contains a parameter called `ssl-verify`.
179
-
This parameter is used to specify whether perform ssl certificate verify or not. By default `ssl-verify` is set to _true_ if the url contains an https host.
180
-
If the user manually sets `ssl-verify: true` with an http netbox server, an error will be notified.
179
+
Each netbox source contains a parameter called `ssl-verify`.
180
+
This parameter is used to specify whether perform ssl certificate verify or not. By default `ssl-verify` is set to _true_ if the url contains an https host.
181
+
If the user manually sets `ssl-verify: true` with an http netbox server, an error will be notified.
181
182
182
183
Here is an example of the configuration of a netbox type source:
183
184
@@ -186,10 +187,10 @@ Here is an example of the configuration of a netbox type source:
186
187
type: netbox
187
188
token: your-api-token-here
188
189
url: https://127.0.0.1:8000
189
-
tag: # if not present, default is "suzieq"
190
-
- suzieq-demo
191
-
period: 3600 # How frequently Netbox should be polled
192
-
ssl-verify: false # Netbox certificate validation will be skipped
190
+
tag: # if not present, default is "suzieq"
191
+
- suzieq-demo
192
+
period: 3600 # How frequently Netbox should be polled
193
+
ssl-verify: false # Netbox certificate validation will be skipped
193
194
```
194
195
195
196
#### Selecting devices from Netbox
@@ -204,15 +205,15 @@ A device is polled by SuzieQ if it matches at least one of the defined rules.
204
205
token: your-api-token-here
205
206
url: https://127.0.0.1:8000
206
207
tag:
207
-
- alpha
208
-
- bravo, charlie
208
+
- alpha
209
+
- bravo, charlie
209
210
```
210
211
211
212
For example, the source above tells SuzieQ to select from Netbox all the devices having the `alpha` OR `bravo & charlie` tags.
212
213
213
214
!!!Warning
214
-
SuzieQ versions older than 0.19 supported one single tag.
215
-
The old syntax, following the pattern `tag: netbox-tag`, is deprecated and it might be removed in the future releases.
215
+
SuzieQ versions older than 0.19 supported one single tag.
216
+
The old syntax, following the pattern `tag: netbox-tag`, is deprecated and it might be removed in the future releases.
216
217
217
218
#### Map Netbox sitenames to namespaces
218
219
@@ -223,38 +224,39 @@ Here is an example:
223
224
224
225
```yaml
225
226
sources:
226
-
- name: netbox-dc-01
227
-
type: netbox
228
-
token: your-api-token-here
229
-
url: http://127.0.0.1:8000
230
-
tag:
231
-
- tag1
232
-
- tag2, tag3
233
-
234
-
- name: netbox-dc-02
235
-
type: netbox
236
-
token: your-api-token-here
237
-
url: http://127.0.0.1:9000
238
-
tag:
239
-
- suzieq
227
+
- name: netbox-dc-01
228
+
type: netbox
229
+
token: your-api-token-here
230
+
url: http://127.0.0.1:8000
231
+
tag:
232
+
- tag1
233
+
- tag2, tag3
234
+
235
+
- name: netbox-dc-02
236
+
type: netbox
237
+
token: your-api-token-here
238
+
url: http://127.0.0.1:9000
239
+
tag:
240
+
- suzieq
240
241
241
242
auths:
242
-
- name: auth-st
243
-
username: user
244
-
password: my-password
243
+
- name: auth-st
244
+
username: user
245
+
password: my-password
245
246
246
247
namespaces:
247
-
- name: netbox-sitename # devices namespaces equal to their site names
248
-
source: netbox-dc-01
249
-
auth: auth-st
248
+
- name: netbox-sitename # devices namespaces equal to their site names
249
+
source: netbox-dc-01
250
+
auth: auth-st
251
+
252
+
- name: namespace01 # devices namespaces equal to 'namespace01'
253
+
source: netbox-dc-02
254
+
auth: auth-st
250
255
251
-
- name: namespace01 # devices namespaces equal to 'namespace01'
252
-
source: netbox-dc-02
253
-
auth: auth-st
254
256
```
255
257
256
258
!!! warning
257
-
Credentials are not pulled from netbox, you will need to define an authentication source under the [auths](#auths) get the nodes' credentials.
259
+
Credentials are not pulled from netbox, you will need to define an authentication source under the [auths](#auths) get the nodes' credentials.
258
260
259
261
### <a name='source-nautobot'></a>Nautobot
260
262
@@ -331,7 +333,7 @@ Moreover if all the devices inside a namespace run the same NOS, it is possible
331
333
```
332
334
333
335
!!! information
334
-
The fields specified in the `device` section are treated as default values, which are provided if the node does not have one. Fields such as `devtype` or `transport` could be already provided by the source, in this case device will not override them.
336
+
The fields specified in the `device` section are treated as default values, which are provided if the node does not have one. Fields such as `devtype` or `transport` could be already provided by the source, in this case device will not override them.
335
337
336
338
### Limiting commands and authentication attempts
337
339
@@ -387,19 +389,19 @@ The credential file should look like this:
387
389
```yaml
388
390
- namespace: testing
389
391
devices:
390
-
- hostname: leaf01
391
-
password: my-password
392
-
username: vagrant
393
-
- hostname: leaf02
394
-
keyfile: /path/to/private/key
395
-
username: vagrant
396
-
- hostname: leaf03
397
-
keyfile: /path/to/private/key
398
-
username: vagrant
399
-
key-passphrase: my-passphrase
400
-
- address: 10.0.0.1
401
-
username: vagrant
402
-
password: my-password
392
+
- hostname: leaf01
393
+
password: my-password
394
+
username: vagrant
395
+
- hostname: leaf02
396
+
keyfile: /path/to/private/key
397
+
username: vagrant
398
+
- hostname: leaf03
399
+
keyfile: /path/to/private/key
400
+
username: vagrant
401
+
key-passphrase: my-passphrase
402
+
- address: 10.0.0.1
403
+
username: vagrant
404
+
password: my-password
403
405
```
404
406
405
407
## <a name='namespaces'></a>Namespaces
@@ -409,10 +411,10 @@ For example the following namespace will be defined by the source named `netbox-
409
411
410
412
```yaml
411
413
namespaces:
412
-
- name: example
413
-
source: netbox-1
414
-
device: ssh-jump-devs
415
-
auth: dc-01-credentials
414
+
- name: example
415
+
source: netbox-1
416
+
device: ssh-jump-devs
417
+
auth: dc-01-credentials
416
418
```
417
419
418
420
In case you are using the SuzieQ native or ansible source types, `auth` field is optional since the settings can be defined per-device in the source.
@@ -495,21 +497,21 @@ The new inventory format consists of four sections (sources, auths, devices, nam
495
497
Here is how the new format will look like:
496
498
497
499
!!! important
498
-
Sections [auths](#auths) and [devices](#devices) are optional. See the full documentation to know how to use them.
500
+
Sections [auths](#auths) and [devices](#devices) are optional. See the full documentation to know how to use them.
499
501
500
502
```yaml
501
503
sources:
502
-
- name: eos-source # namespace is defined below, this is only a name to be used as reference
0 commit comments