Skip to main content

A library for interacting with Netgear Plus switches.

Project description

Python Library for NETGEAR Plus Switches

What it does

Grabs statistical network data from supported NETGEAR Switches from the Plus Managed Network Switch line. These switches can only be managed using a Web interface and not through SNMP or cli. This library uses web scraping to collect the switch configuration, statistics and some basic configuration updates.

How it works

  1. Detecting Switch Model/Product in login.cgi
  2. Connects to the Switch and asks for a cookie (http://IP_OF_SWITCH/login.cgi)
  3. HTTP-Request send to the Switch twice (http://IP_OF_SWITCH/portStatistics.cgi) and compared with previous data ("in response time")

List of port statistics

Name key from get_switch_infos() Unit
Port {port} Traffic Received port_{port}_traffic_rx_mbytes MB (in response time)
Port {port} Traffic Sent port_{port}_traffic_tx_mbytes MB (in response time)
Port {port} Receiving port_{port}_speed_rx_mbytes MB/s
Port {port} Transferring port_{port}_speed_tx_mbytes MB/s
Port {port} IO port_{port}_speed_io_mbytes MB/s
Port {port} Total Received port_{port}_sum_rx_mbytes MB (since last switch reboot/reset)
Port {port} Total Transferred port_{port}_sum_tx_mbytes MB (since last switch reboot/reset)
Port {port} Connection Speed port_{port}_connection_speed MB/s
Port {port} Status port_{port}_status "on"/"off"
Port {poe_port} POE Power port_{poe_port}_poe_power_active "on"/"off"

List of aggregated statistics

Sensor Name key from get_switch_infos() Unit
Switch IO sum_port_speed_bps_io MB/s
Switch Traffic Received sum_port_traffic_rx MB (in response time)
Switch Traffic Sent sum_port_traffic_tx MB (in response time)

Supported and tested NETGEAR Models/Products and firmware versions

Model Ports Firmware versions Bootloader versions
GS105E 5 ?
GS105Ev2 5 V1.6.0.15 V1.4.0.5-VB
GS105PE 5 V1.6.0.17 V1.6.0.2-VB
GS108E 8 V1.00.11 V1.00.03
GS105Ev3 5 ?
GS108Ev3 8 V2.00.05, V2.06.10, V2.06.17, V2.06.24 V2.06.01 - V2.06.03
GS108Ev4 8 V1.0.1.3
GS108PEv3 8 V2.06.24 V0.00.00
GS110EMX 10 V1.0.2.8
GS116Ev2 16 V2.6.0.48, V2.6.0.50
GS305E 5 V1.0.0.16 V1.0.0.2
GS305EP 5 V1.0.1.1
GS305EPP 5 V1.0.1.4
GS308E 8 V1.00.11 V1.00.03
GS308EP 8 V1.0.0.10, V1.0.1.4, V2.0.0.5
GS308EPP 8 V1.0.1.4
GS308Ev4 8 V1.0.1.3
GS316EP 16 V1.0.4.4
GS316EPP 16 V1.0.4.4
JGS516PE 16 V2.6.0.48
JGS24Ev2 24 V2.6.0.48
MS305E 5 ?
MS308E 8 v1.0.0.9
XS512EM 12 V1.0.2.8

Supported firmware languages: GR (German), EN (English)

Unsupported models

Model Support status
JGS524PE See #93
MS108EUP See #91

HOWTO_Add_New_Models.md contains instructions to add unsupported models.

CLI usage

export NETGEAR_PLUS_PASSWORD=s3cr3t # replace with your password
ngp-cli login 192.168.178.68 # replace with IP address of your switch
ngp-cli status
ngp-cli logout
ngp-cli -h

Library Usage

Create a python virtual environment

python3 -m venv .venv
source .venv/bin/activate
pip install py-netgear-plus

Using this VENV go to your local source folder

Example calls

cd src
python3
ip = '192.168.178.68' # replace with IP address of your switch
p = 'fyce4gKZemkqjDY' # replace with your password
import py_netgear_plus
sw = py_netgear_plus.NetgearSwitchConnector(ip, p)
sw.autodetect_model()
sw.get_login_cookie()

data = sw.get_switch_infos()
print(sw.switch_model.MODEL_NAME)
print(data["port_1_sum_rx_mbytes"])
print(data)
sw.turn_off_poe_port(1) # Supported only on PoE capable models
sw.turn_on_poe_port(1)

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

py_netgear_plus-0.5.1.tar.gz (210.6 kB view details)

Uploaded Source

Built Distribution

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

py_netgear_plus-0.5.1-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file py_netgear_plus-0.5.1.tar.gz.

File metadata

  • Download URL: py_netgear_plus-0.5.1.tar.gz
  • Upload date:
  • Size: 210.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for py_netgear_plus-0.5.1.tar.gz
Algorithm Hash digest
SHA256 c83b597c85c664bf3ae532f57cf7f08abac192e60aa5c528c997152aeab10049
MD5 90fa3ff885743c6b58ebf674237f3a43
BLAKE2b-256 f53d147710226a7977f3506fee361e391a4cb6e683991e391836c25246b2edf0

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_netgear_plus-0.5.1.tar.gz:

Publisher: release.yml on foxey/py-netgear-plus

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

File details

Details for the file py_netgear_plus-0.5.1-py3-none-any.whl.

File metadata

File hashes

Hashes for py_netgear_plus-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eb0e2ce4c8ea63eefe1e8e0d35a57dcd1ad7e10ec7b1111c6a55f398faf19ace
MD5 9b04ef8709afcfb0320f218434755c21
BLAKE2b-256 a7fbac9a979dae49872b8eca8b24d1b70ffe7882aa31f9d27b93b84f5f5d56b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_netgear_plus-0.5.1-py3-none-any.whl:

Publisher: release.yml on foxey/py-netgear-plus

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