An interface between Network UPS Tools and influxdb.
This allows sending metrics from NUT to an influxdb database.
# cd /path/to/git/clone
# pip3 install .
# cp config.example.json /etc/influx_nut.json # edit to set up for your needs
$ influx_nut --config /etc/influx_nut.json
{
"nut_host": "nutcase",
"nut_ups": "cp1500avr",
"nut_vars": {
"ups.load": {"type": "int", "measurement_name": "ups_load"},
"input.voltage": {"type": "float", "measurement_name": "ups_voltage"}
},
"influx_host": "http://influxbox:8086",
"influx_creds": ["user", "lamepassword"],
"influx_db": "systems",
"influx_tags": {
"ups": "cp1500avr"
}
}
How frequently is the data sent to Influx in seconds? Default: 20
.
Hostname NUT is accessible at. Default: "127.0.0.1"
.
Port number to use to connect to the NUT server. Default: 3493
.
UPS name on that NUT server. Default: "ups1"
.
Variables to send from NUT to influxdb. Example:
"nut_vars": {
"ups.realpower.nominal": {
"type": "int",
"measurement_name": "ups1_power"
}
}
Valid types are "float", "int", "bool", and "str".
URL of influxdb server to send data to, without a trailing slash.
Default: "http://127.0.0.1:8086"
.
Database on the influxdb server to put data in. Default: "systems"
.
Tags (in mapping form) to send to the influxdb server. These are static for all measurements sent from influx_nut. Example:
{"tag1": "value1", "tag2": "value2"}
Credentials to use to connect to the influxdb server. Example: ["user", "sekrit"]
.
Default is null
(no authentication).