Skip to content

Instantly share code, notes, and snippets.

{
"nut_host": "host",
"nut_ups": "salicru",
"nut_vars": {
"ups.load": {"type": "int", "measurement_name": "ups_load"},
"input.voltage": {"type": "float", "measurement_name": "ups_voltage"},
"battery.charge": {"type": "int", "measurement_name": "ups_charge"}
},
"influx_host": "http://influx1:8086",
"influx_creds": ["telegraf_w", "%AfqgnSb5Ye?p!qd"],
FROM python:3.7
ADD influx_nut.json /etc/influx_nut.json
ADD influx_nut /influx_nut
WORKDIR /influx_nut
RUN python setup.py install
CMD influx_nut --config /etc/influx_nut.json
{
"nut_host": "localhost",
"nut_ups": "salicru",
"nut_vars": {
"ups.load": {"type": "int", "measurement_name": "ups_load"},
"input.voltage": {"type": "float", "measurement_name": "ups_voltage"},
"battery.charge": {"type": "int", "measurement_name": "ups_charge"}
},
"influx_host": "http://localhost:8086",
"influx_creds": ["THE_INFLUXDB_USER", "THE_INFLUXDB_PASSWORD"],
#!/bin/bash
DEBUG=0
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
export PATH
TZ='Europe/Madrid'
export TZ
function log() {
if [ $DEBUG -eq 1 ];
#!/bin/bash
source config
function mailSend() {
TMP_FILE="/tmp/ups.email"
/bin/echo "To: $MAIL_NAME <$MAIL_RCPT>" > $TMP_FILE
/bin/echo "Subject: $1" >> $TMP_FILE
/bin/echo "" >> $TMP_FILE
/bin/echo "$2" >> $TMP_FILE
version: "3"
services:
homer:
image: b4bz/homer
container_name: homer
volumes:
- ./assets/:/www/assets
environment:
- UID=1000
- GID=100
version: "3.7"
services:
node-red:
container_name: node-red
image: nodered/node-red:latest
environment:
- TZ=Europe/Madrid
volumes:
- /dev:/host/dev
- /etc/localtime:/etc/localtime:ro
version: '3.8'
services:
nginx:
image: nginx:latest
container_name: nginx
restart: unless-stopped
volumes:
- ./etc:/etc/nginx:ro
- ./logs:/var/logs/nginx
- ./html:/usr/share/nginx/html:ro
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
version: '3.8'
services:
grafana:
container_name: grafana
image: grafana/grafana
restart: unless-stopped
environment:
- TZ="Europe/Madrid"
volumes:
- /etc/localtime:/etc/localtime:ro