Skip to main content

netgear-switch-inventory

Inventory and monitoring for Netgear Easy Smart switches via HTTP scraping.

No SNMP, no official API — the package reverse-engineers the proprietary web UI used by Netgear ProSAFE Easy Smart switches (GS116Ev2, GS108Ev3 and compatible).

Device support

Model Auth Port status Features NSDP discovery
GS116Ev2 HMAC-MD5 (YOU_CAN_NOT_PASS) Yes Yes Yes
GS108Ev3 MD5-interleave(password, rand) No* Yes Yes

* GS108Ev3 serves port state via AJAX (/getstatus.cgi). This endpoint is not yet implemented. ports returns [] for GS108Ev3. All other data (identity, features) works correctly.

Install

pip install netgear-switch-inventory
# with CLI
pip install "netgear-switch-inventory[cli]"

Or with uv:

uv add netgear-switch-inventory
uv add "netgear-switch-inventory[cli]"

Configuration

Credentials are passed directly or via environment variables. Create a .env file (never commit it):

NETGEAR_HOST="192.168.1.100"
NETGEAR_PASSWORD="password"

CLI usage

# Collect and print inventory from a switch
netgear-inventory collect --host 192.168.1.100

# Collect and save to YAML file
netgear-inventory fetch --host 192.168.1.100 --output ./inventory/

# Discover switches on the LAN via NSDP broadcast
netgear-discover

Run --help on any command for all options.

Library usage

from netgear_switch.session import SwitchSession
from netgear_switch.models import load_catalog
from netgear_switch.inventory import snapshot, persist
from pathlib import Path

catalog = load_catalog()  # ships with package

sw = SwitchSession("192.168.1.100", "password")
sw.login()
snap = snapshot(sw, catalog)

print(snap.model, snap.firmware, snap.firmware_status)
print(f"{len(snap.ports_up)} ports up")

persist(snap, Path("inventory/"))

NSDP discovery

from netgear_switch.nsdp import probe

for switch in probe(timeout=3.0):
    print(switch.get("model"), switch.get("ip"), switch.get("_from"))

Requires the process to bind to UDP 63321. On Linux, use --network host in Docker or run as root/with CAP_NET_BIND_SERVICE.

Salt grains

Copy src/netgear_switch/contrib/salt_grains.py to your Salt _grains/ directory as netgear_switch.py, then configure the minion:

# /etc/salt/minion.d/netgear_switch.conf
netgear_switch:
  host: "192.168.1.100"
  password: "password"
  catalog_path: "/etc/salt/netgear/device_catalog.yaml"  # optional
  timeout: 10

Verify:

salt-call --local grains.item switch

The grains module returns switch identity and feature flags under the switch key, mirroring Salt built-in grain names where applicable (manufacturer, productname, serialnumber, osrelease).

Known limitations

  • GS108Ev3 port status: not implemented — AJAX endpoint not yet reverse-engineered. ports is always [] for this model.
  • Write operations: the package never calls any mutating web UI endpoint.
  • HTTPS: Netgear Easy Smart switches do not support HTTPS. All communication is HTTP.
  • Multi-switch: the CLI and library operate on one switch at a time. Iterate from a wrapper script for fleet inventory.

License

Apache License 2.0 — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netgear_switch_inventory-0.1.3.tar.gz (121.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netgear_switch_inventory-0.1.3-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file netgear_switch_inventory-0.1.3.tar.gz.

File metadata

  • Download URL: netgear_switch_inventory-0.1.3.tar.gz
  • Upload date:
  • Size: 121.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for netgear_switch_inventory-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c23a88fe3c89aadcedb5ba558ac38adafe1235a95ae457edaa019f9ed708d7d9
MD5 647f4523f5462646400db9aa4473c1cb
BLAKE2b-256 7e3d5a62808620773652f1df305ed8cbe58b291940e680c04a40570c58a01a02

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgear_switch_inventory-0.1.3.tar.gz:

Publisher: publish.yml on cprima-integrations/netgear-switch-inventory

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgear_switch_inventory-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for netgear_switch_inventory-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bd093a28c356031448448094d11ae1d0dd19bba6eb52fa36c05126839c252f2c
MD5 d92abc84f02588861c061831cba1c2d5
BLAKE2b-256 d8a6d3a886c39d05791a21634e2ab19da271252de6c0379ec2a383885083426e

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgear_switch_inventory-0.1.3-py3-none-any.whl:

Publisher: publish.yml on cprima-integrations/netgear-switch-inventory

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page