QUESTION:
How to generate a rule file template from a MIB?
RESOLUTION:
Requirements
-
net-snmp-utils (net-snmp for Windows) binary downloaded and installed in order to utilize snmptranslate.
Linuxyum install net-snmp-utils
Windows (The default components of the install package should be sufficient)
http://www.net-snmp.org/download.html - Linux
perl-CGI package installed in order to have access to the CGI::Carp module
Step 1
Place the MIB that contains trap information and any dependency MIBs (e.g. CISCO-SMI.MIB) into the <TRAVERSE_HOME>/plugin/mibs directory
Step 2
Open a command prompt and navigate to <TRAVERSE_HOME>/plugin/mibs
cd <TRAVERSE_HOME>/plugin/mibs
Step 3
Run <TRAVERSE_HOME>/utils/trap2xml.pl with the -i and -o parameter, where -i is the input and -o is the output xml of the rule file. Basic trap rule generation only requires -i and -o, please see notes below for further adjustments.
E.g.
<TRAVERSE_HOME>/utils/trap2xml.pl -i FILE.mib -o /tmp/50_rule_trap_file.xml
Please note the file 50_rule_trap_file.xml can be named however you wish, but it is a requirement to have the file named in the format "50_rule_trap_XYZ.xml". The '50' dictates the order in which it is read by the message handler. I.e. 49_rule_trap_file.xml will take precedent over 50_rule_trap_file.xml when processing rules.
Step 4
Notes:
- By default, all generated rules within the file are 'accepted', assigned a 'critical' severity, show on the event console, and have an auto-clear of '900' seconds. Please see the -s (--state) parameter under the usage (trap2xml -h)
APPLIES TO:
All versions of Traverse