diff --git a/README.md b/README.md index 7ad5dd3..d144f7b 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Build and install with pip ## Configuration -Edit [configuration.ini](./configuration.ini) and fill in your information for the InfluxDB and the modem. +Edit [configuration.ini](./data/configuration.ini) and fill in your information for the InfluxDB and the modem. Valid strings for `ModemType`: @@ -64,6 +64,24 @@ You can monitor the container's status by running: `docker logs -f cablemodemstatus` +## Docker compose + +If you are using Docker Compose, building and installation is even easier. + +Assuming your configuration file is + +`/home/pi/config/configuration.ini` + +then all you need to add to your compose.yaml file is this: + +``` + cablemodem_exporter: + build: https://github.com/andresp/cablemodem-status.git + command: retriever + volumes: + - /home/pi/config:/app/data:ro +``` + ## Todo * Implement modules for additional modems: diff --git a/src/docsismodem/retriever.py b/src/docsismodem/retriever.py index 4a0891f..9dfaf06 100644 --- a/src/docsismodem/retriever.py +++ b/src/docsismodem/retriever.py @@ -105,4 +105,4 @@ def filter(self, record): lastUpdated = 0 if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/src/docsismodem/storage/influxdb.py b/src/docsismodem/storage/influxdb.py index 8cabc9b..e3974e7 100644 --- a/src/docsismodem/storage/influxdb.py +++ b/src/docsismodem/storage/influxdb.py @@ -15,10 +15,10 @@ def __init__(self, url: str, org: str, token: str, bucket: str, useTls: bool = T self.logger = logging.getLogger("influxdb") - self.logger.info("Connecting to InfluxDB") + self.logger.info("Connecting to InfluxDB " + url + ", org: " + org + ". Using TLS? " + str(useTls)) self.dbClient = InfluxDBClient(url=url, org=org, token=token, ssl=useTls) return def write(self, record: list): - self.dbClient.write_api(write_options=SYNCHRONOUS).write(bucket=self.bucket, record=record) \ No newline at end of file + self.dbClient.write_api(write_options=SYNCHRONOUS).write(bucket=self.bucket, record=record)