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
- Detecting Switch Model/Product in login.cgi
- Connects to the Switch and asks for a cookie (
http://IP_OF_SWITCH/login.cgi) - 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 | ? | |
| 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 |
| GS305EP | 5 | V1.0.1.1 | |
| GS305EPP | 5 | V1.0.1.4 | |
| GS308EP | 8 | V1.0.0.10, V1.0.1.4 | |
| GS308EPP | 8 | V1.0.1.4 | |
| GS316EP | 16 | V1.0.4.4 | |
| GS316EPP | 16 | V1.0.4.4 |
Supported firmware languages: GR (German), EN (English)
Unsupported models
| Model | Support status |
|---|---|
| JGS524Ev2 | In progress |
| GS108PEv3 | Not yet started |
| GS105Ev2 | Not yet started |
| GS110EMX | Not yet started |
| XS512EM | Not yet started |
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_netgear_plus-0.4.2.tar.gz.
File metadata
- Download URL: py_netgear_plus-0.4.2.tar.gz
- Upload date:
- Size: 112.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef2437e7a5442d59f0bfdd42723a7275681606d78b3cf244a43fbfd8d28f72c1
|
|
| MD5 |
72273664e5c5400313a815978f03e299
|
|
| BLAKE2b-256 |
caee8b581d2f894611cd3a66049e0721990d953d57f32e7b90f1b5751d4e96a8
|
Provenance
The following attestation bundles were made for py_netgear_plus-0.4.2.tar.gz:
Publisher:
ci.yml on foxey/py-netgear-plus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_netgear_plus-0.4.2.tar.gz -
Subject digest:
ef2437e7a5442d59f0bfdd42723a7275681606d78b3cf244a43fbfd8d28f72c1 - Sigstore transparency entry: 165680687
- Sigstore integration time:
-
Permalink:
foxey/py-netgear-plus@b873e59436503d972c7813ccc4f9cf28a940ce4e -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/foxey
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@b873e59436503d972c7813ccc4f9cf28a940ce4e -
Trigger Event:
push
-
Statement type:
File details
Details for the file py_netgear_plus-0.4.2-py3-none-any.whl.
File metadata
- Download URL: py_netgear_plus-0.4.2-py3-none-any.whl
- Upload date:
- Size: 28.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c31fbed7511cd43febe59984487ccbed6fdbbd92b6a12c4d7f50113b72a196d7
|
|
| MD5 |
3eb45f3153535e05e27216103b6c378e
|
|
| BLAKE2b-256 |
cbbe5b2dd0f234ef6cffba9e188fe17bdd0c1bd100fbb47ab1610731025a6b43
|
Provenance
The following attestation bundles were made for py_netgear_plus-0.4.2-py3-none-any.whl:
Publisher:
ci.yml on foxey/py-netgear-plus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_netgear_plus-0.4.2-py3-none-any.whl -
Subject digest:
c31fbed7511cd43febe59984487ccbed6fdbbd92b6a12c4d7f50113b72a196d7 - Sigstore transparency entry: 165680689
- Sigstore integration time:
-
Permalink:
foxey/py-netgear-plus@b873e59436503d972c7813ccc4f9cf28a940ce4e -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/foxey
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@b873e59436503d972c7813ccc4f9cf28a940ce4e -
Trigger Event:
push
-
Statement type: