snmp-diode
snmp-diode is a Python tool designed to gather device data using SNMP and push it to NetBoxLabs Diode.
Features
- snmp-diode collects the following data using snmp:
| OID | NetBox Mapping |
|---|---|
| 1.3.6.1.2.1.1.5.0 | Device Name |
| 1.3.6.1.2.1.1.2.0 | Manufacturer and Device Type |
| 1.3.6.1.2.1.1.6.0 | Site |
| 1.3.6.1.2.1.2.2.1.2 | Interface Name |
| 1.3.6.1.2.1.31.1.1.1.18 | Interface Description |
| 1.3.6.1.2.1.2.2.1.6 | Interface Mac Address |
| 1.3.6.1.2.1.2.2.1.7 | Interface Enabled Status |
| 1.3.6.1.2.1.4.20.1.2 | Interface IP Address |
| 1.3.6.1.2.1.4.20.1.3 | Interface Ip Address Mask |
Installation
To install snmp-diode, follow these steps:
$ pip install snmp-diode
Usage
usage: snmp-diode [-h] [-t HOST] [-n NETWORK] -v VERSION
[-c COMMUNITY] [-u USERNAME] [-a AUTH]
[-A {MD5,SHA}] [-x PRIVACY]
[-X PRIVACY_PROTOCOL]
[-l {noAuthNoPriv,authNoPriv,authPriv}]
[-d DIODE] [-k API_KEY] [--apply] [-r ROLE]
[-s SITE]
SNMP Discovery Tool for NetBoxLabs Diode
options:
-h, --help show this help message and exit
-t HOST, --host HOST Target Host Address
-n NETWORK, --network NETWORK
Target Network Address
-v VERSION, --version VERSION
SNMP Version
-c COMMUNITY, --community COMMUNITY
SNMP Community String
-u USERNAME, --username USERNAME
SNMPv3 Username
-a AUTH, --auth AUTH SNMPv3 Auth Password
-A {MD5,SHA}, --auth_protocol {MD5,SHA}
SNMPv3 Auth Protocol
-x PRIVACY, --privacy PRIVACY
SNMPv3 Privacy Password
-X PRIVACY_PROTOCOL, --privacy_protocol PRIVACY_PROTOCOL
SNMPv3 Privacy Protocol
-l {noAuthNoPriv,authNoPriv,authPriv}, --level {noAuthNoPriv,authNoPriv,authPriv}
SNMPv3 Security Level
-d DIODE, --diode DIODE
Diode Server
-k API_KEY, --api_key API_KEY
Diode API Key
--apply Apply the changes to NetBox
-r ROLE, --role ROLE Role of the device
-s SITE, --site SITE Site of the device
Host mode
With -t flag snmp-diode discovers only the target host, usage sample:
$ export DIODE_API_KEY=1234567890098765432
$ snmp-diode -t 172.20.20.1 -v 2 -c public -d grpc://192.168.224.137:8081/diode --apply
Network mode
With -n flag snmp-diode discovers the target network (CIDR format, i.e. 10.0.0.0/24 ) including the network address and mask, usage sample:
$ export DIODE_API_KEY=1234567890098765432
$ snmp-diode -n 172.20.20.0/24 -v 2 -c public -d grpc://192.168.224.137:8081/diode --apply
Dry mode
Running snmp-diode without the --apply flag it gonna discover the target devices and print the Diode Entities.
$ snmp-diode -n 172.20.20.0/24 -v 2 -c public
Role and Site flags
By setting the Role or Site flags, snmp-diode setups those values to all discovered devices.
Contributing
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for more information.
Metadata
Release files for snmp-diode 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| snmp_diode-0.0.6.tar.gz | 914.3 kB | Without provenance | Details for snmp_diode-0.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| snmp_diode-0.0.6-py3-none-any.whl | Python 3 | none | any | Details for snmp_diode-0.0.6-py3-none-any.whl |
Total release size: 1.8 MB
Release files / snmp_diode-0.0.6.tar.gz
| Download URL | snmp_diode-0.0.6.tar.gz |
|---|---|
| Size | 914.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a690627bf6a39e572567c6e401b3b2d8cf36e637ad1f63158d8b402025063e8
|
|
BLAKE2b-256 checksum How to use checksums |
916d9408e3bdb99083f3459ec7beee28f886d8937e6586c37a8f3e31a222e57a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.12
|
Release files / snmp_diode-0.0.6-py3-none-any.whl
| Download URL | snmp_diode-0.0.6-py3-none-any.whl |
|---|---|
| Size | 926.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d36530aaec614082ed698312f868c54d228907a37d13da42c4a94cd04928a63
|
|
BLAKE2b-256 checksum How to use checksums |
8f294c83a4192df3b74f6336eb765976eba0f3e998557029025bc6a163d18310
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.12
|
Security for snmp-diode 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.