16 Apr 2021 04:40 PM - last edited on 18 May 2023 01:50 PM by Michal_Gebacki
All I've been asked to try and show the overall port utilization of a Cisco MDS switch in a custom plugin (network switches as well). I've gotten all the ports to graph with SNMP just fine. Including putting the Description and Alias as the Dimension values. The issue I've come across is the switches all report data as "relative" values.
To graph the speed of the port dynatrace takes the current value reported and subtracts the previous value reported and that gives me how many bytes have changed since xxx seconds.
It then displays that data which is perfect. To get the utilization of the port I need to know what this delta is so I can divide the overall port speed. Is there a way to get this delta value from dynatrace when the plugin is gathering metrics? I'm trying to avoid putting this into some type of local file and doing all this math myself.
Thanks!
Solved! Go to Solution.
16 Apr 2021 04:43 PM - edited 16 Apr 2021 04:44 PM
Custom extensions can do both absolute and relative in the python code. simply change "absolute" to "relative" when sending the metric data to Dynatrace. Look here for an example under "Python": https://www.dynatrace.com/support/help/extend-dynatrace/extensions/oneagent-extensions/oneagent-exte...
16 Apr 2021 08:18 PM
Thanks Mike I am already graphing the data using the relative for metric collection. The issue is I need to know what the DIFFERENCE is from the previous relative measurement to the current relative measurement as well as the timeframe involved. I dont see a way to get that info all I can do is tell it that its relative and send it up. That works great but I have no way to use that data to graph a "percent utilized" metric. Any way to get this?
16 Apr 2021 08:42 PM
Hi,
you can store any value in the code as long as you have it outside the query method (for example, using self.previous_timestamp). If you then store the previous value and time stamp you can do any calculation you want on it.
24 Jun 2021 11:30 PM
Thanks! Yeah we found this out that it basically just runs in a loop so the previous value is always "there".
24 Jun 2021 11:31 PM
I was also able to use the per_second as well which did what we wanted as well. I wanted the MB per second not minute. relative is per minute.