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]
Add comment