Hello! I connect to may rasberryt temperature probe ds18b20. On rasberry i can read temperature but i canot configure rasberry snmp oid value to prtg.
anyone has experience how add GPIO value from rasberry to PRTG ?
ThankYou....
Regards, Damjan
Article Comments
Thank you for answer. First of all, im totaly beginer with linux and rasberry. I use prtg for monitor temperature with lan controler - device with web server and fixed oid value. Work fine, but is posiblle only 6 temp. Senzor. Thats why i buy rasberry. I try this project http://projects.privateeyepi.com/home/temperature-sensor-project-using-ds18b20 Work fine ( ok i dont know how set reading temperature every 60s ,but work ), but i want read in prtg. I look for template or manual for project for reading gpio (temp., relay state, etc.... ) and send oid snmp to prtg.
Thank you.
May, 2016 - Permalink
The thing is, you will have to enable SNMP first, and then have a script running, that provides the temperature value via an OID. This script needs to run all the time.
In comparison, a python script, that runs every 5 minutes (using cron: Scheduling tasks with Cron and that pushes the value to PRTG as a HTTP Push Data Sensor will likely be easier, than implementing your own SNMP daemon. A basic python script to do this push could look like:
import urllib2 URL="http://IP_OR_HOSTNAME_OF_YOUR_PRTG_PROBE:5050/_TOKEN_?value=_YOUR_TEMPERATURE_&text=_YOUR_TEXT #print(URL) try: r = urllib2.urlopen(URL) except: print("Error") #print r.getcode()
You will need to adjust the script to first gather the temperature value of course.
May, 2016 - Permalink
During this time I solve the problem. I use this code from forum :
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=83286&p=976878&hilit=prtg#p976878
Anyway thank you very much !!!
Regards
May, 2016 - Permalink
Hello,
Thank you very much for your KB-Post. How exactly do you read the temperature value from the GPIO-Interface? If using a python script on the pi, then you could extend the script to simply push the value with a HTTP Request to PRTG into a HTTP Push Data Sensor.
best regards.
May, 2016 - Permalink