Skip to content

atorma/nr7101-influxdb-collector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zyxel NR7101 InfluxDB collector

Periodically gets the status of your NR7101 modem, pings a host of your choosing, and stores the results in InfluxDB. Includes sample Grafana dashboards.

Requirements

Installation

Specific tag, e.g. v2.2.3:

pip install git+https://github.com/atorma/[email protected]

Master version:

pip install git+https://github.com/atorma/nr7101-influxdb-collector.git

Usage

Note! Use the https protocol in NR7101 URL. Authentication does not work when using http.

Using configuration file:

nr7101-collector --config-file=/path/to/config.ini

config.ini

[influx2]
url=http://localhost:8086
org=my-org
token=my-token

[tags]
my_tag=my_default_value
other_tag=other_tag_default_value

[nr7101]
url=https://192.168.1.1
username=admin
password=my-password

[collector]
bucket=nr7101
measurement=status
interval=5000
influxdb_max_retries=5
influxdb_max_retry_time=180000
influxdb_max_retry_delay=125000
influxdb_exponential_base=2
ping_host=google.com
ping_timeout=1

Using environment properties (see https://pypi.org/project/influxdb-client for InfluxDB client environment properties):

INFLUXDB_V2_URL=http://localhost:8086 \
 INFLUXDB_V2_ORG=my-org \
 INFLUXDB_V2_TOKEN=my-token \
 NR7101_URL=https://192.168.1.1 \
 NR7101_USERNAME=admin \
 NR7101_PASSWORD=my-password \
 COLLECTOR_BUCKET=nr7101 \
 COLLECTOR_MEASUREMENT=status \
 COLLECTOR_PING_HOST=google.com \
 nr7101-collector

Using both environment properties and config file (the former take precedence):

INFLUXDB_V2_TOKEN=my-token NR7101_PASSWORD=my-password nr7101-collector --config-file=/path/to/config.ini

Using Docker

docker build -t nr7101-collector .
docker run -v /path/to/config.ini:/config.ini:ro nr7101-collector --config-file=/config.ini

With the ping_host option you may have to use the --network host Docker run option.

Configuration

[influx2]

See https://github.com/influxdata/influxdb-client-python. For InfluxDB 1.8+ see API compatibility.

[tags]

Optional default tags to add to all data points. Can also be given as environment properties.

[nr7101]

  • url / NR7101_URL - The https URL of the NR7101 web interface. Required.
  • username / NR7101_USERNAME: The username of the NR7101 user. Required.
  • password / NR7101_PASSWORD: The password of the NR7101 user. Required.

[collector]

About

Collects Zyxel NR7101 status data into an InfluxDB

Resources

Stars

Watchers

Forks

Packages

No packages published