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

Get the network volume with the API

Votes:

0

Hello, Is it possible to retrieve, via the API, the total volume on a NIC for the current day (for example) ?

Thanks

api network traffic-volume

Created on Jun 19, 2018 3:35:19 PM



2 Replies

Accepted Answer

Votes:

1

Hello there and thank you for your inquiry.

There is no query for the "current day", you always have to provide the start and end date (in UTC) when doing the query. For example, to query the daily volume of a sensor (ID 2808) from 2018-06-06-10-31-00 to 2018-06-13-10-31-00 you can use:

/api/historicdata.xml?id=2808&sdate=2018-06-06-10-31-00&edate=2018-06-13-10-31-00&avg=86400&pctavg=300&pctshow=false&pct=95&pctmode=false
  • avg=86400 tells PRTG that you want daily averages (one reading per day in the period(86400 Seconds = 1 day))

That will result in multiple entries, each entry will look like this:

<item>
	<datetime>12.06.2018</datetime>
	<datetime_raw>43263.8750000000</datetime_raw>
	<value channel="Traffic Total (volume)" channelid="-1">3.944 MByte</value>
	<value_raw channel="Traffic Total (volume)" channelid="-1">4135535619.0572</value_raw>
	<value channel="Traffic Total (speed)" channelid="-1">0,38 Mbit/s</value>
	<value_raw channel="Traffic Total (speed)" channelid="-1">47868.8351</value_raw>
	<value channel="Traffic In (volume)" channelid="0">651 MByte</value>
	<value_raw channel="Traffic In (volume)" channelid="0">682854522.3689</value_raw>
	<value channel="Traffic In (speed)" channelid="0">0,06 Mbit/s</value>
	<value_raw channel="Traffic In (speed)" channelid="0">7904.0428</value_raw>
	<value channel="Traffic Out (volume)" channelid="1">3.293 MByte</value>
	<value_raw channel="Traffic Out (volume)" channelid="1">3452681096.6883</value_raw>
	<value channel="Traffic Out (speed)" channelid="1">0,32 Mbit/s</value>
	<value_raw channel="Traffic Out (speed)" channelid="1">39964.7923</value_raw>
	<value channel="Downtime" channelid="-4">0 %</value>
	<value_raw channel="Downtime" channelid="-4">0.0000</value_raw>
	<coverage>100 %</coverage>
	<coverage_raw>0000009999</coverage_raw>
</item>

This allows you to get the "Volume" for any channel from the SNMP Traffic Sensor for any period.

You can find further details about the API here or within your PRTG's web-interface under Setup > PRTG API.

Best Regards,
Luciano Lingnau [Paessler Support]

Created on Jun 20, 2018 10:52:39 AM by  Luciano Lingnau [Paessler]

Last change on Jun 20, 2018 11:05:24 AM by  Luciano Lingnau [Paessler]



Votes:

1

Thank you for your answer, it's perfect ;-)

Created on Jun 20, 2018 4:41:11 PM




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.