Selaa lähdekoodia

update readme

subDesTagesMitExtraKaese 2 vuotta sitten
vanhempi
commit
90e8c9aaf0
1 muutettua tiedostoa jossa 34 lisäystä ja 11 poistoa
  1. 34 11
      README.md

+ 34 - 11
README.md

@@ -1,26 +1,46 @@
 # pihole-to-influxdb
+
 ## Introduction
 Based slightly on my other project, [speedtest-to-influxdb](https://github.com/chriscn/speedtest-to-influxdb). This project leverages the [Pi-Hole](https://pi-hole.net/) API to gather data about your PiHole instance and store it inside of InfluxDB for your future projects.
 
 This project is automatically built through GitHub actions and the DockerHub file can be found [here](https://hub.docker.com/r/chriscn/pihole-to-influxdb).
+
 ## Setup
+
 ### Configuring the script
 The InfluxDB connection settings can be configured as followed:
-- "INFLUX_DB_URL=http://192.168.xxx.xxx:8086"
-- "INFLUX_DB_ORG=\<your org name\>"
-- "INFLUX_DB_TOKEN=\<token\>"
-- "INFLUX_DB_BUCKET=pihole"
+- `INFLUX_DB_URL=http://192.168.xxx.xxx:8086`
+- `INFLUX_DB_ORG=<your org name>`
+- `INFLUX_DB_TOKEN=<token>`
+- `INFLUX_DB_BUCKET=pihole`
 
 The PiHole settings can be configured as followed:
-- PIHOLE_HOSTNAME=192.168.xxx.xxx
-- PIHOLE_INTERVAL=15 *Interval in seconds*
+- `PIHOLE_URL=http://192.168.xxx.xxx`
+- `PIHOLE_INTERVAL=15` *Interval in seconds*
+
+Optionally you can also configure the following:
+- `PIHOLE_AUTHENTICATION=<token>`
+- `LOG_LEVEL=DEBUG`
+- `APP_MODE=Totals`
+
 ### Authentication
-Certain parts of the API require you to be authenticated, this can be achieved by supplying the `PIHOLE_AUTHENTICATION` token with the token from the API settings page of the admin interface.  
+Certain parts of the API require you to be authenticated, this can be achieved by supplying the `PIHOLE_AUTHENTICATION` token with the token from the API settings page of the admin interface.
+
 By doing this you'll gain access to two new measurements (tables): 
 - query_types
 - forward_destinations
+
+and the following app modes:
+- `APP_MODE=Totals` *This is the default mode*
+- `APP_MODE=Live`
+- `APP_MODE=Raw`
+
 #### Sidenote
-This does mean that your password is stored in plaintext as an environmental variable and as such as malicious actor could find it and access your PiHole instance. You are advised to use this at your own risk.
+This does mean that your token is stored in plaintext as an environment variable and as such as malicious actor could find it and access your PiHole instance. You are advised to use this at your own risk.
+
+### App Modes
+The `APP_MODE` changes the way the script works. The default mode is `Totals` which will only send the daily totals of the PiHole instance, as displayed in the GUI. Another mode is `Live` which will send a summary of the Pi-hole queries of the last `PIHOLE_INTERVAL` seconds. The last mode is `Raw` which will send the raw data of the Pi-hole queries.
+
 ### Docker Command
 ```
     docker run -d --name pihole-to-influx \
@@ -29,7 +49,7 @@ This does mean that your password is stored in plaintext as an environmental var
     -e 'INFLUX_DB_TOKEN'='<influxdb token>' \
     -e 'INFLUX_DB_BUCKET'='pihole' \
     -e 'PIHOLE_INTERVAL'='1800' \
-    -e 'PIHOLE_HOSTNAME'='192.168.xxx.xxx'  \
+    -e 'PIHOLE_URL'='192.168.xxx.xxx'  \
     chriscn/pihole-to-influxdb
 ```
 ### docker-compose
@@ -41,9 +61,12 @@ services:
         container_name: pihole-to-influxdb
         environment:
         - "INFLUX_DB_URL=http://192.168.xxx.xxx:8086"
-        - "INFLUX_DB_ORG=<your org name>"
+        - "INFLUX_DB_ORG=myOrg"
         - "INFLUX_DB_TOKEN=<token>"
         - "INFLUX_DB_BUCKET=pihole"
-        - "PIHOLE_HOSTNAME=192.168.xxx.xxx"
+        - "PIHOLE_URL=http://192.168.xxx.xxx"
         - "PIHOLE_INTERVAL=15"
+        - "PIHOLE_AUTHENTICATION=<token>"
+        - "LOG_LEVEL=DEBUG"
+        - "APP_MODE=Totals"
 ```