In this example, we will demonstrate how to setup a system that switches off port 21 of a switch when the load (in bytes/10s) on the port exceeds a certain threshold. The example described here is not very realistic and you'll probably never use it in a real-life situation but is however very instructive!
The instructions given below are based on the following assumptions:
The threshold Shooter can be build with the Shooter-wizard. Switch to Designer mode, right-click the switch object/icon on the map for which to build the Shooter (be aware that Shooters are build at the class level, not for an individual device!) and select Define Shooters (Wizard).
The new Shooter should now be active. Verify this by choosing Options|Threshold control from the menu on the main window
The threshold that we just built will display a system generated message in case the threshold value is exceeded (the Shooter wizard" did not allow us to specify a custom message!). Because it is possible to have more than one threshold Shooter running for a switch at the same time, we need a unique "threshold exceeded" message to test on! The following steps describe how to specify a unique message.
Open notepad.exe and create a command file “EventScript.cmd” with the code as shown below and save the command file in a directory on disk (we chose “c:\Temp”):
| @echo off if %2 == "Switch20" goto labelA goto Finish :labelA if not %5 == "Port21 overload!" goto Finish "C:\Program Files\FineConnection\Monitor one\FineSNMPSet.exe" 192.168.2.20 private 1.3.6.1.2.1.2.2.1.7.21 integer 2 :Finish |
Note that in the commandfile we test on the device-name (%2 = "Switch20") and the event-message (%5 = "Port21 overload!")
FineSNMPSet is a small and simple free-ware program, developed by FineConnection that can be used to set an arbitrary SNMP object to a specified value. FineSNMPSet can be downloaded here . Install FineSNMPSet.exe in your Monitor one installation directory (“c:\Program Files\FineConnection\Monitor one\”. More information on FineSNMPSet can be found at: http://www.fineconnection.com/SNMPSet
You can now test the configuration. If the load on port 21 of the switch exceeds 100000 bytes/10s then the switchport is switched off.
P.S. Port21 can be switched on again by entering the following command in a shell/command box:
| "C:\Program Files\FineConnection\Monitor one\FineSNMPSet.exe" 192.168.2.20 private 1.3.6.1.2.1.2.2.1.7.21 integer 1 |