System information

Switch Scripts
319
SNMP Scripts
Observer’s SNMP switch scripts are text files with the extension “.snm”. An example
SNMP switch script file name might be “3COM Switch SNMP Script.snm”. Scripts have
sections, which define specific parts of the switch initialization and control sequences.
SNMP scripts send specific SNMP “commands” directly to the switch in a timed fashion
to manipulate the management properties of the switch.
Note: SNMP scripts are preferred.
Specifically, in the case of Observer, the SNMP script can either loop the Probe’s listening
capabilities from port to port, or focus the Probe’s capture ability to a specific port (or
group of ports if your switch supports this feature).
All lines that begin with a “#” (pound sign or hash mark) are ignored and considered
comments.
Each section begins with a header enclosed in square brackets that describes the
section’s general functions.
Script tokens tell Observer to do specific actions and to send specific SNMP
commands to your switch’s SNMP interface.
Sections Headers
[Initialize]—the beginning of a script and area where any switch initialization takes place.
This may be to reset the port-monitoring feature or to enable switch management.
[PortXon]—enables port collection. For each port, replace the “X” with a number—
“[Port1on]” for example. You should have as many PortXon sections as you have ports on
your switch.
[PortXoff]—disables port collection. For each port, replace the “X” with a number—
“[Port1off]” for example. If your switch needs the specific port disabled prior to switching
to the next port, use this as the header for these sequences (see Cisco switch script
example earlier in this section).
SNMP Script Commands and Tokens
Most script activities will begin using Observers built in script editor. The script editor is
accessed by selecting
Tools > Edit Switch Scripts > Edit SNMP Switch Script File from
Observers main menu. Selecting this item will display the script editor. Note that it is not
required to use the script editor to edit and maintain scripts (they are text files), but using