Skip to content

Commit

Permalink
Little cleanup, default to python3 in setup and .service
Browse files Browse the repository at this point in the history
  • Loading branch information
janw committed Feb 9, 2019
1 parent 3effa22 commit e44a180
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -6,13 +6,13 @@ A simple daemonized script to report Pi-Hole stats to an InfluxDB, ready to be d

## Requirements and Setup

As Pi-hole (as the name suggests) is built specifically with the Raspberry Pi in mind (and I run it on there as well), the following steps assume an instance of Pi-hole on Raspbian Strech Lite, with no additional modifications so far. Piholestatus will be configured to run on the same Pi.
As Pi-hole (as the name suggests) is built specifically with the Raspberry Pi in mind (and I run it on there as well), the following steps assume an instance of Pi-hole on Raspbian Strech Lite, with no additional modifications so far. Piholestatus will be configured to run on the same Pi.

First install the necessary packages via apt as Raspbian Lite does have neither git nor pip installed.

```bash
sudo apt update
sudo apt install git python-pip -y
sudo apt install git python3-pip -y
```

Now clone the repo, install the Python dependencies, and make sure to copy and adjust the example configuation file to match your setup.
Expand All @@ -22,7 +22,7 @@ git clone https://github.com/janw/pi-hole-influx.git ~/pi-hole-influx
cd ~/pi-hole-influx

# Install requirements via pip
pip install -r requirements.txt
pip3 install -r requirements.txt

# Copy config.example and modify it (should be self-explanatory)
cp config.ini.example config.ini
Expand Down Expand Up @@ -59,7 +59,7 @@ The status should look as follows. Note the `Status:` line showing the last time



## Set up a Grafana Dashboard
## Set up a Grafana Dashboard

The example dashboard seen [at the top](#pi-hole-influx) uses the collected data and displays it in concise and sensible graphs and single stats. The dashboard can be imported into your Grafana instance from the `dashboard.json` file included in the repo, or by using ID `6603` to [import it from Grafana's Dashboard Directory](https://grafana.com/dashboards/6603).

Expand Down
2 changes: 1 addition & 1 deletion piholeinflux.py
Expand Up @@ -8,7 +8,6 @@
from os import path
import traceback
import sdnotify
from datetime import datetime
import sys

HERE = path.dirname(path.realpath(__file__))
Expand All @@ -34,6 +33,7 @@
n = sdnotify.SystemdNotifier()
n.notify("READY=1")


def send_msg(resp):
if 'gravity_last_updated' in resp:
del resp['gravity_last_updated']
Expand Down
2 changes: 1 addition & 1 deletion piholeinflux.service
Expand Up @@ -8,7 +8,7 @@ After=network-online.target
User=pi
Type=notify
Environment=PYTHONUNBUFFERED=true
ExecStart=/usr/bin/python /home/pi/pi-hole-influx/piholeinflux.py
ExecStart=/usr/bin/python3 /home/pi/pi-hole-influx/piholeinflux.py
Restart=always
RestartSec=30

Expand Down

0 comments on commit e44a180

Please sign in to comment.