Skip to content

Commit

Permalink
Minor tweaks to README.md (#29)
Browse files Browse the repository at this point in the history
* Explaining Docker compose

* Explaining Docker compose

* Fix link to example configuration.ini

* Fixed the reading of value 'useTls' from the configuration.ini file. It was always assuming 'True'.

---------

Co-authored-by: Andy Petralli <[email protected]>
  • Loading branch information
guusbosman and andresp authored Jan 16, 2024
1 parent 882e288 commit e302d71
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/docsismodem/retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ def filter(self, record):
lastUpdated = 0

if __name__ == '__main__':
main()
main()
4 changes: 2 additions & 2 deletions src/docsismodem/storage/influxdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
self.dbClient.write_api(write_options=SYNCHRONOUS).write(bucket=self.bucket, record=record)

0 comments on commit e302d71

Please sign in to comment.