Toptalker scripts
I have two scripts. One is for the older version of MRTG that has Rateup as it's backend. The other is for RRDTool.
Download
This script reads all the .html files in a specific directory and grabs the following:
- Maximum Inbound
- Average Inbound
- Current Inbound
- Maximum Outbound
- Average Outbound
- Current Outbound
It then sorts them based on whatever value you want. Right now it just does descending (highest to lowest) percent utilization, but I'm thinking about doing ascending (lowest to highest) and also based on units. The only qualifier for running this is you need to make sure that in your title, somewhere after the name of the router, there is at least an open parenthesis - "(" and a close parenthesis - ")". The target name extraction is based solely on this. Something like This router ()
will work fine. Something like This router (ATM Serial 3/0 link) will show up as just "This router". Something like (This router) will be blank. Try not to do that...
Below is a table that was created by the toptalker script. The names have been changed to protect the innocent:
What the script did is went through all .html files in the directory (there were 40 or so) and gave me back the top ten. It reads in all the values on the web page like so:
- Daily Max in is subscript [0]
- Daily average in is subscript [1]
- Daily current in is subscript [2]
- Daily Max out is subscript [3]
- Daily average out is subscript [4]
- Daily current out is subscript [5]
- For weekly, add 6 to the daily subscript
- For monthly, add 12 to the daily subscript
- For yearly, add 18 to the daily subscript
It's in the program that way. You'll just have to believe me until you download it and look at the code. You'll have to look at the code and modify it a bit anyway, since you may want to rank on Yearly Max In, and the default is Daily Max In. You'll want to change it. If you want to modify the code and send patches to me to make it better, please do. I'll check out the proposed change and let you know if I incorporate it or not. Please find me e-mail address elsewhere in the site.
Download
This script is totally different that the rateup script. Since MRTG does not do automatic graphing, hence, no html pages, it's impossible to do the same kind of thing. This caused me to team up with Daniel McDonald to assist with writing this script. The script only ranks all links in a single config file (I'll explain in a bit) via either through browser or batch mode. It works similar to 14all in its resolution. As a matter of fact, I snagged the graphparams hash right from 14all. That really taught me how resolution works. I'm still not 100% clear on it, but at least now I can graph the last 12 hours with a 5 minute resolution and understand how and why it's done. I'll have plenty of examples on graphing when I get time.
If you really can't wait, check out David Sawyer's site for a user's perspective on the configuration and the script.