38.107.179.23038.107.179.230 An Example Probe File
InterMapper.comiMapper Community 
 
An Example Probe File

The following is a Custom SNMP probe file. It doesn't do anything very useful, but it shows the various
sections of a custom probe file.

You can download this Example Probe File For more information, you can refer to the Developer Guide.



-- WARNING: This probe is provided as an example, of a custom probe. It is a 
--          tutorial and therefore is wordier than your real probe needs to be.
--          You should use the "Prototype Custom SNMP Probe" as the basis 
--          for all new probe work. 
--          It's simpler, and you won't have to "rip anything out" as you begin.

"type" = "custom-snmp" "package" = "com.dartware" "probe_name" = "snmp.example" "human_name" = "Example SNMP probe" "version" = "1.0" "address_type" = "IP,AT" "port_number" = "161" display_name = "Miscellaneous/Example SNMP Probe"
-- none required; see the Developer Guide for the values that go here. -- The contains text that will be displayed in the probe -- configuration window. -- Describe the probe as much as necessary so that people will understand what it -- does and how it works. \GB\Example SNMP Probe\P\ This probe is an example of an InterMapper Custom SNMP probe, and many of the features that are described in the Custom Probes section of the \u2=http://dartware.com/go.php?to=intermapper.devguide\Developer Guide\P0. If you have questions about this probe, \u2=mailto: This e-mail address is being protected from spambots. You need JavaScript enabled to view it \please contact us.\p0\ This probe probably isn't really useful for production work. However, it provides an example of various techniques available in custom SNMP probes. It retrieves a few SNMP values from a device by specifying their OIDs and how to display those values in the device's Status Window. The probe also has thresholds for setting the device into alarm or warning. In this example, the device has will go into alarm or warning if it has been rebooted recently (controlled by the \i\RebootAlarm\p\ and \i\RebootWarn\p\ parameters - two and three minutes, by default) or if there aren't as many interfaces as expected in the ifTable (controlled by the \i\ExpectedInterfaces\p\ parameter.) The parameters are: \b\RebootAlarm\p\ Put the device into alarm if the sysUptime is less than this many minutes. \b\RebootWarn\p\ Put the device into warning if the sysUptime is less than this many minutes. \b\ExpectedInterfaces\p\ Put the device into warning if the ifNumber is greater or equal to this value. \b\InterfaceToMonitor\p\ is the ifIndex of the interface to monitor for traffic. \b\TrafficWarn\p\ and \b\TrafficAlarm\p\ are thresholds for traffic alarms on the named interface. In addition, this probe shows:
  • CALCULATION variables, the conversion from centi-seconds (hundredths of a second) to seconds
  • Formatting of the Status Window, in the section>
  • Marking up text in the \i\description\p\ and \i\snmp-device-display\p\ sections using IMML (InterMapper Markup Language) to get bold, italic, colored text, etc.
  • IMML also allows you to create a link to a URL, using the \U2=http://xxxx\ notation shown in the \i\snmp-device-display\p\ section.
-- Parameters are user-settable values that the probe uses for its comparisons. -- Specify the default values here. The customer can change them and -- they will be retained for each device. "RebootAlarm" = "2" -- 2 min = 120 seconds = 12,000 centi-seconds "RebootWarn" = "3" -- 3 min = 180 seconds = 18,000 centi-seconds "ExpectedInterfaces" = "3" -- expected number of interfaces "InterfaceToMonitor" = "1" -- Interface to monitor for traffic "TrafficWarn" = "200" -- traffic to get a warning "TrafficAlarm" = "1000" -- traffic to get an alarm -- SNMP values to be retrieved from the device, and -- Specify the variable name, its OID, a format (usually DEFAULT) and a -- short description. -- CALCULATION variables are computed from other values already retrieved -- from the device. sysDescr, 1.3.6.1.2.1.1.1.0 , DEFAULT, "System's Description" sysUptime, 1.3.6.1.2.1.1.3.0 , INTEGER, "Uptime - in centi-seconds" sysContact, 1.3.6.1.2.1.1.4.0 , DEFAULT, "Name of person to contact" sysName, 1.3.6.1.2.1.1.5.0 , DEFAULT, "Name assigned to system" sysLocation, 1.3.6.1.2.1.1.6.0 , DEFAULT, "Location of the system" ifNumber, 1.3.6.1.2.1.2.1.0 , DEFAULT, "Num. of rows in the ifTable" ifInOctets1, 1.3.6.1.2.1.2.2.1.10.$InterfaceToMonitor,PER-SECOND, "Number of received octets on interface 1" sysUptimeMinutes, ($sysUpTime / (100 * 60)), CALCULATION, "Uptime in minutes" -- Specify rules for setting the device into Alarm or Warning state alarm: $ifInOctets1 > $TrafficAlarm "Traffic above the alarm threshold" alarm: $sysUptimeMinutes < $RebootAlarm "Rebooted less than $RebootAlarm minutes ago" warning: $ifInOctets1 > $TrafficWarn "Traffic above the warning threshold" warning: $sysUptimeMinutes < $RebootWarn "Rebooted less than $RebootAlarm minutes ago" warning: $ifNumber != $ExpectedInterfaces "Not as many interfaces as expected" -- The section specifies the text that will be -- appended to the device's Staus Window. \B5\Prototype SNMP Probe\0P\ \U2=http://${deviceaddress}\Go to the device's web page\P0\ \4\ sysDescr:\0\ $sysDescr \4\ sysContact:\0\ $sysContact \4\ sysName:\0\ $sysName \4\ sysLocation:\0\ $sysLocation \4\ sysUpTime:\0\ $sysUptimeMinutes \3\minutes (\0\$sysUptime \3\ hundredths of seconds)\p\ \4\Num. of Intf:\0\ $ifNumber \3(expected $ExpectedInterfaces)\0\ \4\Input traffic:\0\ $ifInOctets1 \3(bytes/second)\0\