top 5 or 10 busy APs

Started by mgthump, April 16, 2019, 06:47:12 PM

Previous topic - Next topic

mgthump

I'm trying to figure out how to build a transform script to give us the top 5 or 10 busy access points on our network, or all access points with an airtime utilization over X amount for a given time period.    7 pm to 11 pm for example.   

I haven't had any luck searching around the forum for this, any suggestions?


Thank you!!!

Victor Kirhenshtein

Can you provide more details on in what form you have utilization data?

Best regards,
Victor

mgthump

the utilization data is collected from SNMP on .1.3.6.1.4.1.17713.21.2.1.113.0 and stored as an integer.  This returns a value on 1 to 1000 representing the % of air time used at the AP.


Thank you!

Tursiops

#3
Guess the answer depends on if you want to create a DCI (as you mentioned a transform script) that collects these top 5/top 10 at regular intervals or if you just want a script/tool you can execute at any given time to provide you with the data.

Not sure about the prior, but for the latter you have a couple of options.

  • Summary Table
  • Scripts
If you just want a top 5 of a DCI value, a summary table should do it.
It won't exactly be a top 5, as it will list all systems that match, but you can simply sort the result and look at the top 5 rows. That's the easy solution. Doesn't work for your "between 9pm and 11pm" though.

The more complex solution would be to write a script that goes through all relevant nodes and queries the DCI values (possibly by going via template, as per your previous post https://www.netxms.org/forum/general-support/adding-together-oids-from-many-different-nodes-within-a-tempate/). The per-system results (and system names) are placed in an array (would be easier if you could have arrays with strings as keys, but I believe it's only non-negative integers). You can sort the array as you add items or fill the array first followed by you implementing your favourite sorting algorithm (there may be a built-in way to sort an array, but I couldn't see one on https://wiki.netxms.org/wiki/NXSL_Function_Reference). Finally you only return the top 5 results.
Why go through that hassle when you can use a Summary Table? Because a small adjustment will allow you to get your 9pm-11pm solution, which I assume means "average value between any given time". You'd have to adjust the script to use the GetAvgDCIValue function instead of GetDCIValue and pass it the start and end time in UNIX Epoch format. If you call this script via an Object tool, you could have the Console pop up with window to ask you for the start/end time instead of you having to modify the script each time.

Sorry, no actual script from me for that one... :)

mgthump

Tursiops,

I haven't played with summary tables yet. i'll check into those.

I like your script idea, i'm still getting the hang of scripts, but i'll follow your advice and try and build that. if i get it, i'll post what I've come up with in case anyone else wants this tool.


Thank you!!!