Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
psarossy committed Aug 12, 2019
1 parent 591ac91 commit 29612b1
Show file tree
Hide file tree
Showing 7 changed files with 4,979 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.git
.gitignore
.idea
build
LICENSE
README*
VERSION
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Pull base image.
FROM debian:jessie

MAINTAINER Peter Sarossy <[email protected]>

# Set environment.
ENV DEBIAN_FRONTEND noninteractive

# Install packages.
RUN apt-get update
RUN apt-get install -y curl mysql-client nano python python-mysqldb sqlite3 wget python-influxdb

# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Define working directory.
WORKDIR /opt/btmon

# Add files to the container.
ADD . /opt/btmon

# Define volumes.
VOLUME ["/etc/bind", "/var/lib/bind", "/var/run/named"]

# Define the command script.
CMD ["/bin/sh", "-c", "./btmon"]
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# btmon-influx
btmon.py with influxdb support
Btmon Docker Image w/ Influxdb
==============================

Docker image for running the btmon.py Brultech monitor script.

11 changes: 11 additions & 0 deletions btmon
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
set -e

# Exit with error if required environment is not present
if [ -z "${BTMON_CONFIG}" ] || [ ! -f "${BTMON_CONFIG}" ]; then
echo "Envrionment variable BTMON_CONFIG must be provided"
exit 1
fi

# Execute the btmon python script
./btmon.py -c ${BTMON_CONFIG}
18 changes: 18 additions & 0 deletions btmon.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[source]
device_type = gem
ip_read = true
ip_port = 5000
ip_mode = server
include_current = true
reverse_polarity = true
full_serials = true

[influxdb]
influxdb_out = true
influxdb_host = 10.0.0.72
influxdb_port = 8086
influxdb_upload_period = 10
influxdb_database = btmon
influxdb_measurement = energy
influxdb_mode = row
influxdb_db_schema = ecmreadext
Loading

0 comments on commit 29612b1

Please sign in to comment.