I'm using "HTTP Push Data Advanced" to create four channels. I've parsed the IP of the remote machine into four values. I'm pushing the via four times (with different channels).
The "Last Value" column of the sensor should show the value 10 in this case. And oddly it does but only very occasionally. It doesn't seem to do it reliably. It will catch one of the four values occasionally. Just enough it seems to have the min/max columns work. How to get the Last value columns to work?
Thanks
Article Comments
Gah! Yes, that's a copy/past from my SSH terminal issue.
Here's the actual line (edited for privacy): curl "http://blah-blah-blah:5050/1l?content=<prtg><result><channel>IP-Octet-1</channel><value>10</value></result></prtg>"
Thanks, Doug
Dec, 2018 - Permalink
I am personally using this sensor pretty happy in a different use case with counters and other values like temp and humidity and time-differences.
In the end we talk about multiple of those sensors, all with multiple channels.
No issues at all - proven by various graphics and data validation that we did on this.
Not sure what is going on exactly in your case - but it might help if you can post the script you are using or as mention re-validate the output - e.g. <valuevalue>...
Hopefully we can sort it out and find a working solution for you!
Regards
Florian Rossmark
Dec, 2018 - Permalink
I'm using the HTTP Push Sensor to capture the IP address of Raspberry Pi units on my network that are also HTTP Pushing Temp/Humidity/Pressure data. The units are set for DHCP and therefore I don't know what their IP address will be. Given the number of units and the varied network environments I must use DHCP. This script runs in /etc/rc.local and should push the IP address in four separate values. (Don't ask what will happen when we get to IPv6!)
#!/bin/bash mac_col=$(cat /sys/class/net/$(ip route show default | awk '/default/ {print $5}')/address) #echo $mac_col mac_dash=${mac_col//:/-} #echo $mac_dash mac_dash_all="$mac_dash-ip" #echo $mac_dash_all #exit while true; do #Public IP #ip=$(curl -s https://api.ipify.org) #Private IP ip=$(/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') oct1=$(echo ${ip} | tr "." " " | awk '{ print $1 }') oct2=$(echo ${ip} | tr "." " " | awk '{ print $2 }') oct3=$(echo ${ip} | tr "." " " | awk '{ print $3 }') oct4=$(echo ${ip} | tr "." " " | awk '{ print $4 }') echo $mac_dash_all echo $ip echo $oct1 echo $oct2 echo $oct3 echo $oct4 curl "http://blah.blah.blah.com:5050/$mac_dash_all?content=<prtg><result><channel>IP-Octet-1</channel><value>$oct1</value></result></prtg>" sleep 1 curl "http://blah.blah.blah.com:5050/$mac_dash_all?content=<prtg><result><channel>IP-Octet-2</channel><value>$oct2</value></result></prtg>" sleep 1 curl "http://blah.blah.blah.com:5050/$mac_dash_all?content=<prtg><result><channel>IP-Octet-3</channel><value>$oct3</value></result></prtg>" sleep 1 curl "http://blah.blah.blah.com:5050/$mac_dash_all?content=<prtg><result><channel>IP-Octet-4</channel><value>$oct4</value></result></prtg>" sleep 5 done
Dec, 2018 - Permalink
When the sensor is setup and I run the script manually once (before it's looping and running automatically) I can see that all four values are being reported to PRTG because I can see all four values in the "Maximum" column of the sensor. Even though the "Last Value" column will often report only one of the four values. Which of the four seems random.
Thanks, Doug
Dec, 2018 - Permalink
PS I've tried to edit the original question SEVERAL times (to correct my type-o) from different PCs and each time I click submit I get kicked to the error screen with the guy dabbing and my edits are gone. Just an FYI.
Doug
Dec, 2018 - Permalink
Why do you actually send the IP octets in four steps?
curl "http://blah.blah.blah.com:5050/$mac_dash_all?content=<prtg><result><channel>IP-Octet-1</channel><value>$oct1</value></result></prtg>" sleep 1 curl "http://blah.blah.blah.com:5050/$mac_dash_all?content=<prtg><result><channel>IP-Octet-2</channel><value>$oct2</value></result></prtg>" sleep 1 curl "http://blah.blah.blah.com:5050/$mac_dash_all?content=<prtg><result><channel>IP-Octet-3</channel><value>$oct3</value></result></prtg>" sleep 1 curl "http://blah.blah.blah.com:5050/$mac_dash_all?content=<prtg><result><channel>IP-Octet-4</channel><value>$oct4</value></result></prtg>" sleep 5
it would be easier to do this in one API call.. there are even better ways to do it - but I would recommend to test this for a brief change and validation:
curl "http://blah.blah.blah.com:5050/$mac_dash_all?content=<prtg><result><channel>IP-Octet-1</channel><value>$oct1</value></result><result><channel>IP-Octet-2</channel><value>$oct2</value></result><result><channel>IP-Octet-3</channel><value>$oct3</value></result><result><channel>IP-Octet-4</channel><value>$oct4</value></result></prtg>"
I think you might actually confuse PRTG with those 4x calls - due to the channels not necessarily being fixed in this case and while sending the data in split API calls instead of in one single call..
Can you try and see if this helps?
Dec, 2018 - Permalink
Florian,
That did the trick and not only did that work, but I didn't know that you could put multiple values in one push.
Thanks!
Doug
Dec, 2018 - Permalink
You can put even more in that.. there are various ways to transfer the data as well and you could determine stuff like limits and even pass through a text-string (not per channel, only one per probe) etc..
Glad it worked :-)
Florian
Dec, 2018 - Permalink
As always, thanks for the help! :)
PRTG Scheduler |
PRTGapi |
Feature Requests |
WMI Issues |
SNMP Issues
Kind regards,
Stephan Linke, Tech Support Team
Dec, 2018 - Permalink
Last Value is always the latest value received within the sensor. Is this your actual output, because <valuevalue> is not correct - but I assume it's a copy/paste error?
PRTG Scheduler | PRTGapi | Feature Requests | WMI Issues | SNMP Issues
Kind regards,
Stephan Linke, Tech Support Team
Dec, 2018 - Permalink