diff --git a/README.md b/README.md index 1683929..bef1635 100644 --- a/README.md +++ b/README.md @@ -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:
+> +> sudo apt update
+> sudo apt install git python-pip
+> sudo python -m pip install --upgrade pip setuptools wheel
+ +* Download the repository:
+> +> cd /opt
+> git clone https://code.shdx.org/Der_Leopold/Zabbix-DHT.git + +* Optional: Install the Adafruit tool that reads the sensor data
+Skip this step if you already have it.
+> +> cd Zabbix-DHT/external/Adafruit_Python_DHT
+> 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:
+> +> ./readSensor
+ +* If everything works, it the script created the output file with content similar to this:
+> +> Timestamp=1543420306
+> Temperature=23.7
+> 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... \ No newline at end of file