UniFi/EdgeSwitch port-counter plugin for rdc-proxy.
Project description
rdc-proxy-unifi
UniFi/EdgeSwitch port-counter plugin for rdc-proxy.
Adds a "switch" side channel to the rdc-proxy dashboard containing live port
counters polled via SSH from a UniFi/EdgeSwitch running swctrl.
Prerequisites
- rdc-proxy already installed on the same host (it provides the plugin loader + dashboard).
- A UniFi/EdgeSwitch (any model supporting
swctrl port show counters). - An SSH key that the rdc-proxy service user can use to log into the switch.
Install
Assuming rdc-proxy is already running at /opt/rdc-proxy:
# Clone and install into the rdc-proxy venv
sudo git clone https://github.com/andrewroydshayes/rdc-proxy-unifi.git /opt/rdc-proxy-unifi
sudo /opt/rdc-proxy/venv/bin/pip install /opt/rdc-proxy-unifi
# Place your SSH key where the service can read it (0600 root:root)
sudo cp ~/.ssh/id_rsa_unifi /etc/rdc-proxy/id_rsa_unifi
sudo chmod 600 /etc/rdc-proxy/id_rsa_unifi
# Configure via env vars in /etc/rdc-proxy/rdc-proxy.env (see below), then:
sudo systemctl restart rdc-proxy
The rdc-proxy service will log [plugins] loaded: unifi on startup.
Or use the included installer:
curl -fsSL https://raw.githubusercontent.com/andrewroydshayes/rdc-proxy-unifi/main/install/install-unifi.sh \
| sudo bash
Configuration
Add to /etc/rdc-proxy/rdc-proxy.env:
RDC_UNIFI_SWITCH_IP=10.0.0.97
RDC_UNIFI_SWITCH_USER=root
RDC_UNIFI_SSH_KEY=/etc/rdc-proxy/id_rsa_unifi
RDC_UNIFI_PORT_ID=9
RDC_UNIFI_POLL_INTERVAL=30
RDC_UNIFI_SIDE_CHANNEL=switch
All env vars have defaults — only set the ones you need to change.
How the side channel surfaces
The plugin calls state.update_side_channel("switch", {...counters...}) once
per poll. rdc-proxy's dashboard collector merges all side channels into the
JSON returned by /api/status, under side_channels. For UI back-compat the
"switch" channel is ALSO mirrored at the top level as switch in each
dashboard history point.
Development
pip install -e ".[dev]"
pytest
License
MIT.
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 rdc_proxy_unifi-0.2.0.tar.gz.
File metadata
- Download URL: rdc_proxy_unifi-0.2.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c09fe0c549619e9ff13fca125422e45f543dbd8e7540bc8fbd205bdfd23bb509
|
|
| MD5 |
219208673b1b55a9aa122b2eec21dba7
|
|
| BLAKE2b-256 |
ae9a890f1f97a2e730ce763c003e0f28761cb47d26591c462207bfef15dbbb3c
|
Provenance
The following attestation bundles were made for rdc_proxy_unifi-0.2.0.tar.gz:
Publisher:
publish.yml on andrewroydshayes/rdc-proxy-unifi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rdc_proxy_unifi-0.2.0.tar.gz -
Subject digest:
c09fe0c549619e9ff13fca125422e45f543dbd8e7540bc8fbd205bdfd23bb509 - Sigstore transparency entry: 1340831723
- Sigstore integration time:
-
Permalink:
andrewroydshayes/rdc-proxy-unifi@25a2febb8a888f3801ceaff4c24221bbc85d3f15 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/andrewroydshayes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@25a2febb8a888f3801ceaff4c24221bbc85d3f15 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rdc_proxy_unifi-0.2.0-py3-none-any.whl.
File metadata
- Download URL: rdc_proxy_unifi-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84d3dd64f3887aa45a3c23481a83619bae5d83f8a0a6e6609cfcdf3bf5222c1a
|
|
| MD5 |
314309ab5bb47993f847b5a7ba7b9668
|
|
| BLAKE2b-256 |
6030db097e47c89c9fd07ad5b0c6d4cf011833f4434a297f823317796ac8e4ad
|
Provenance
The following attestation bundles were made for rdc_proxy_unifi-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on andrewroydshayes/rdc-proxy-unifi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rdc_proxy_unifi-0.2.0-py3-none-any.whl -
Subject digest:
84d3dd64f3887aa45a3c23481a83619bae5d83f8a0a6e6609cfcdf3bf5222c1a - Sigstore transparency entry: 1340831724
- Sigstore integration time:
-
Permalink:
andrewroydshayes/rdc-proxy-unifi@25a2febb8a888f3801ceaff4c24221bbc85d3f15 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/andrewroydshayes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@25a2febb8a888f3801ceaff4c24221bbc85d3f15 -
Trigger Event:
push
-
Statement type: