I have a large population of gigabit switches and I am looking to decide where to deploy replacement 10gigabit switches.

I want to target locations where links are close to saturation at 1gbps and could benefit from the additional bandwidth.

I have bandwidth sensors on all of the switch ports and from the web interface I can look at the sensor channels and see the maximum values for Traffic In and Traffic Out. I want to be able to write a script that will extract these Maximum values and provide me with a report on the switches with the highest peak traffic interfaces.

I guess I can pull the full data set and then find the maximum value myself but since the Maximum is shown in the web interface I was wondering if it can be extracted more efficiently.


Article Comments

I actually found that I was able to get that value via the API.

<YourPRTGServer>/api/table.json?content=channels&output=json&columns=name,maximum_&id=69214&username=*******&passhash=******
{
  "prtg-version": "19.4.54.1506",
  "treesize": 0,
  "channels": [
    {
      "name": "Broadcast in",
      "name_raw": "Broadcast in",
      "maximum": "1,137 #",
      "maximum_raw": 1136.9242
    },

:
    {
      "name": "Traffic In",
      "name_raw": "Traffic In",
      "maximum": "3,069,067 KByte",
      "maximum_raw": 3142724860.0000
    },
    {
      "name": "Traffic Out",
      "name_raw": "Traffic Out",
      "maximum": "3,250,588 KByte",
      "maximum_raw": 3328601710.6920
    },
:
    {
      "name": "Unicast out",
      "name_raw": "Unicast out",
      "maximum": "2,251,595 #",
      "maximum_raw": 2251595.0507
    }
  ]
}

I took the maximum_raw value and multiplied by 8 to get a bits count, then divided by my polling interval size ( 300 seconds in my case ).

I had hoped to be able to apply a filter on the returned channels because I only want 'Traffic In' and 'Traffic Out' but I don't think it can be done.

What I also found though was that the absolute peak value isn't as useful to me as I hoped. One freak event can generate this peak value and it may not be reflective of what I really wanted which would be the "average daily peak" a measure of the maximum demand regularly placed on the links. I think I am going to look at pulling out raw data through the Report API and then filtering out weekends and non-business hours before looking at the data.


Dec, 2019 - Permalink

Hi there,

Thanks for sharing your knowledge. Yes, you are right, one time peeks are usually not very expressive.


Kind regards,
Birk Guttmann, Tech Support Team


Dec, 2019 - Permalink