Miscellaneous utilities and tools for collection, manipulation, and logging of arbitrary metrics
The standard license under which these tools, utilities, and files here are released.
This file (the one being read).
A list of tools and utilities provided here.
Periodic monitoring of UBNT EdgeRouter metrics not otherwise available via SNMP. Supports publishing to remote InfluxDB and/or writing to local log files.
Currently this script will collect temperatures, fan speeds, and power usage from those units that include such sensors. To determine if a given EdgeRouter supports these use show hardware temperature
, show hardware fan
, and show hardware power
from a shell prompt on the ER.
The script as-configured will not actually perform any logging of data. At minimum one of the two options for logging should be enabled by editing the configuration at the beginning of the script. Additionally details such as database host, etc should be configured as appropriate.
This is a quick interim tool created for a specific use but may be useful to others.
Publishing to InfluxDB requires additional support libraries that are not part of the EdgeOS distribution. These are easily obtained however.
The primary dependency is on InfluxDB-Python, which in turn has a few dependencies.
The current EdgeOS distribution is based upon Debian Wheezy, which does not itself include influxdb-python. All of the required dependencies are, however, platform-independent. The quickest solution would be to copy the few dependent python libraries from a standard Debian Jessie distribution:
- On Debian 8 (Jessie) OS:
sudo apt install python-influxdb
This will ensure all dependencies are included.cd /usr/lib/python2.7/dist-packages
tar zcf /tmp/pdepend.tgz chardet pytz six.py six.pyc urllib3 dateutil influxdb requests
scp /tmp/pdepend.tgz <edgerouter>:/tmp
- On <edgerouter>:
mkdir /config/scripts/stats-er
cd /config/scripts/stats-er
tar xpf /tmp/pdepend.tgz
- Copy the
stats-er.py
into/config/scripts/stats-er
and edit appropriately. The script will find the dependent libraries from within the directory where it is located.
Sample Grafana dashboard for use with the above stats-er.py
publishing to InfluxDB.
To use, configure the database used by stats-er.py
as a new datasource in your local Grafana instance, then import the .json into that same instance.