Update 'README.md'

This commit is contained in:
2018-11-28 17:19:36 +01:00
parent 71d074af60
commit e5062b33f7

View File

@ -13,7 +13,53 @@ First, the timeout for agent checks needed to be raised to 5-6 seconds to work r
I never figured out why and what caused it; but with the setup provided in this repo it does not happen.
### How?
@TODO
The instructions are for Raspbian and the assumption that the script will be installed in */opt*
* Install dependencies:<br>
>
> sudo apt update<br>
> sudo apt install git python-pip<br>
> sudo python -m pip install --upgrade pip setuptools wheel<br>
* Download the repository:<br>
>
> cd /opt<br>
> git clone https://code.shdx.org/Der_Leopold/Zabbix-DHT.git
* Optional: Install the Adafruit tool that reads the sensor data<br>
Skip this step if you already have it.<br>
>
> cd Zabbix-DHT/external/Adafruit_Python_DHT<br>
> sudo python setup.py install
* Edit the *readSensor* script and change as needed. At least the two variables **SENSOR** and **GPIOPIN** have to be adjusted to your setup.
* Run the script:<br>
>
> ./readSensor<br>
* If everything works, it the script created the output file with content similar to this:<br>
>
> Timestamp=1543420306<br>
> Temperature=23.7<br>
> Humidity=39.7
* Set up a cronjob to keep the output file up to date:
>
> crontab -e
```
*/1 * * * * /opt/Zabbix-DHT/readSensor
```
* Copy the file userparameter_dht.conf to your Zabbix config directory:
>
> sudo cp userparameter_dht.conf /etc/zabbix/zabbix_agentd.conf.d/
* Restart Zabbix agent to pick up the change:
>sudo service zabbix_agentd restart
* Finally, import the template (*templatedht.xml*) into Zabbix and assign it to the host
After a few minutes you should see data starting to come in.
### Who?
I'm codeing purely as a hobby and do it far too infrequent to have any kind of practice. So please bear with me if the code is amateurish...