Paessler PRTG Traffic Grapher with Auto Tab Change Script

13 Apr

I wrote this one a little while back and to be honest it looks after itself so well that I rarely have to touch it. Anyway, I wanted an easy way to keep tabs on what’s happening on the network, mostly the bandwidth, but it’s also handy to know if certain servers stop responding and when remote users are connected etc.

I’m running Paessler PRTG Traffic Grapher, a free version (up to 20 sensors) is available here

The software runs as a service, and I have it sitting on an old XP machine. It taps in to SNMP enabled devices and keeps logs of everything. It supports V1, V2 and V3 encrypted SNMP.

I had 2 managed 48 Port Linksys Gigabit switches running all the machines in the office until recently when I upgraded by adding in a Netgear 24 Port gigabit Unmanaged Switch. Previously I knew exactly which users PCs were connected to which port on the Linksys boxes and that enabled me to keep tabs on individuals usage, but since I can’t monitor the ports on the new gigabit switch, I’ve stopped monitoring users and now just monitor the firewall ports, Cisco ports, server latency, home workers (Via their Vigor Routers) and then also the OpenDNS server that I use. I might add in a bit more down the line.

The Paessler software has a nice little WebGUI that I can access from my machine but I wanted something that was more readily available and on show 24/7, I also think it looks g33ky cool, which is a bonus. So, I wrote an extremely simple VB Script to change the tabs within the software every 5 seconds. I set the taskbar to auto-hide on the PC and changed the GP so that the particular user account that this software runs under doesn’t auto lock after 15 minutes and also has pretty much no network access (as this machine is left turned on generally)

This is the script: (ChangeTabs.vbs)

set WshShell = WScript.CreateObject(“WScript.Shell”)
WScript.Sleep 10000
while 1=1
WshShell.SendKeys “{HOME}”
WScript.Sleep 5000
WshShell.SendKeys “{RIGHT}”
WScript.Sleep 5000
WshShell.SendKeys “{RIGHT}”
WScript.Sleep 5000
WshShell.SendKeys “{RIGHT}”
WScript.Sleep 5000
WshShell.SendKeys “{RIGHT}”
WScript.Sleep 5000
WshShell.SendKeys “{RIGHT}”
WScript.Sleep 5000
wend

As you can see it starts, waits 10 seconds (enough time to open the Paessler software) and then emulates the home key button being pressed (which in the software takes you to the first tab). It then waits 5 seconds and then emulates the right key being pressed (this moves right to the next tab). It does this 5 times (I have 6 tabs in total) and then returns home and does it all over again.

If I want more in depth detail, I simply open the WebGUI from my PC. 

If I ever want to stop it, I just open task manager and stop the WScript.exe process.

A list of all the keys can be found here.