Skip to content

Commit 98b6600

Browse files
authored
feat: dynamic scan support (#257)
1 parent 111f7c0 commit 98b6600

File tree

2 files changed

+22
-30
lines changed

2 files changed

+22
-30
lines changed

docs/backends/device_discovery.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Current supported options:
5353
| Key | Type | Description |
5454
|:-----:|:----:|:-------------:|
5555
| platform_omit_version | bool | If True, only the driver name will be used as the NetBox platform name (defaults to 'False' if not specified) |
56+
| port_scan_ports | list | TCP ports to probe before discovery if hostname is a IP Range or a Subnet (defaults to [22,23,80,443,830,57400]) |
57+
| port_scan_timeout | float | TCP port probe timeout in seconds (defaults to 0.5) |
5658

5759
#### Defaults
5860
Current supported defaults:
@@ -114,7 +116,7 @@ The scope defines a list of devices that can be accessed and pulled data.
114116

115117
| Parameter | Type | Required | Description |
116118
|:---------:|:----:|:--------:|:-----------:|
117-
| hostname | string | yes | Device hostname |
119+
| hostname | string | yes | Device hostname. It also supports subnets (e.g. 192.168.1.0/28) and IP ranges in the format 192.168.0.1-192.168.0.10 or 192.168.0.1-10. |
118120
| username | string | yes | Device username |
119121
| password | string | yes | Device username's password |
120122
| driver | string | no | If defined, try to connect to device using the specified NAPALM driver. If not, it will try all the current installed drivers |

docs/backends/snmp_discovery.md

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ orb:
3030
## Policy
3131
SNMP discovery policies are broken down into two subsections: `config` and `scope`.
3232

33-
### Configuration Parameters
3433

35-
#### Config Section
34+
### Config Section
3635
| Parameter | Type | Required | Description |
3736
|:---------:|:----:|:--------:|:-----------:|
3837
| schedule | cron format | no | Cron expression for scheduling (e.g., "*/5 * * * *") |
3938
| timeout | integer | no | Timeout for whole policy in seconds (defaults to 120) |
4039
| snmp_timeout | integer | no | Timeout for SNMP operations in seconds for SNMP operations (defaults to 5) |
40+
| snmp_probe_timeout | integer | no | Timeout for SNMP probe operations in seconds (defaults to 1) |
4141
| retries | integer | no | Number of retries for SNMP operations (defaults to 0) |
4242
| lookup_extensions_dir | string | no | Directory containing device model lookup files |
4343
| defaults | map | no | Default values for entities (description, comments, tags, etc.) |
@@ -49,34 +49,24 @@ SNMP discovery policies are broken down into two subsections: `config` and `scop
4949
| site | string | no | Default site name for discovered devices |
5050
| location | string | no | Default location for discovered devices |
5151
| role | string | no | Default role for discovered devices |
52-
| ip_address | map | no | Default values for discovered IP addresses |
53-
| interface | map | no | Default values for discovered interfaces |
54-
| device | map | no | Default values for discovered devices |
5552

56-
#### IP Address Defaults Parameters
53+
##### Nested Defaults
54+
| device | map | Device-specific defaults |
55+
| ├─ description | string | Device description |
56+
| ├─ comments | string | Device comments |
57+
| interface | map | Interface-specific defaults |
58+
| ├─ description | string | Interface description |
59+
| ├─ if_type | string | Interface type (e.g. "ethernet", "virtual") |
60+
| ipaddress | map | IP address-specific defaults |
61+
| ├─ role | string | IP address role |
62+
| ├─ vrf | string | IP address vrf |
63+
| ├─ tenant | string | IP address tenant |
64+
| ├─ description | string | IP address description |
65+
66+
### Scope Section
5767
| Parameter | Type | Required | Description |
5868
|:---------:|:----:|:--------:|:-----------:|
59-
| description | string | no | Description for discovered IP addresses |
60-
| role | string | no | Role for discovered IP addresses (e.g. "management") |
61-
| tenant | string | no | Tenant name for discovered IP addresses |
62-
| vrf | string | no | VRF name for discovered IP addresses |
63-
64-
#### Interface Defaults Parameters
65-
| Parameter | Type | Required | Description |
66-
|:---------:|:----:|:--------:|:-----------:|
67-
| description | string | no | Description for discovered interfaces |
68-
| if_type | string | no | Interface type (e.g. "ethernet", "virtual") |
69-
70-
#### Device Defaults Parameters
71-
| Parameter | Type | Required | Description |
72-
|:---------:|:----:|:--------:|:-----------:|
73-
| description | string | no | Description for discovered devices |
74-
| comments | string | no | Comments for discovered devices |
75-
76-
#### Scope Section
77-
| Parameter | Type | Required | Description |
78-
|:---------:|:----:|:--------:|:-----------:|
79-
| targets | list | yes | List of SNMP targets to discover |
69+
| targets | list | yes | List of SNMP targets to discover. It also supports subnets (e.g. 192.168.1.0/28) and IP ranges in the format 192.168.0.1-192.168.0.10 or 192.168.0.1-10. |
8070
| authentication | map | yes | SNMP authentication settings |
8171

8272
#### Authentication Parameters
@@ -121,8 +111,8 @@ config:
121111
lookup_extensions_dir: "/opt/orb/snmp-extensions" # Specifies a directory containing device data yaml files (see below)
122112
scope:
123113
targets:
124-
- host: "192.168.1.1"
125-
- host: "192.168.1.254"
114+
- host: "192.168.1.1/24" # subnet support
115+
- host: "192.168.2.2-10" #range support
126116
- host: "10.0.0.1"
127117
port: 162 # Non-standard SNMP port
128118
authentication:

0 commit comments

Comments
 (0)