What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

HTTP Push Data Advanced does not reliably display the "Last Value"

Votes:

0

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).

curl "http://blah-blah-blah.com:5050/1?content=<prtg><result><channel>IP-Octet-1</channel><valuevalue>10</value></result></prtg>"

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

last-value prtg push-notifications

Created on Dec 10, 2018 7:28:22 PM



Best Answer

Accepted Answer

Votes:

1

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?

Created on Dec 11, 2018 3:14:08 PM



10 Replies

Votes:

0

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

Created on Dec 10, 2018 9:21:03 PM by  Stephan Linke [Paessler Support]



Votes:

0

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

Created on Dec 11, 2018 2:19:43 PM



Votes:

0

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

www.it-admins.com

Created on Dec 11, 2018 2:46:57 PM



Votes:

0

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

Created on Dec 11, 2018 2:54:53 PM

Last change on Dec 11, 2018 3:04:57 PM by  Stephan Linke [Paessler Support]



Votes:

0

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

Created on Dec 11, 2018 2:57:57 PM



Votes:

0

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

Created on Dec 11, 2018 3:00:09 PM



Accepted Answer

Votes:

1

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?

Created on Dec 11, 2018 3:14:08 PM



Votes:

0

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

Created on Dec 11, 2018 3:40:49 PM



Votes:

0

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

Created on Dec 11, 2018 3:45:48 PM



Votes:

0

As always, thanks for the help! :)


PRTG Scheduler | PRTGapi | Feature Requests | WMI Issues | SNMP Issues

Kind regards,
Stephan Linke, Tech Support Team

Created on Dec 11, 2018 3:49:26 PM by  Stephan Linke [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.