Ask the Community
Groups
How to generate a rule file template from a MIB - Connect IT Community | Kaseya
<main> <article class="userContent"> <p><strong>QUESTION:</strong></p> <p>How to generate a rule file template from a MIB?</p> <p><strong>RESOLUTION:</strong></p> <p> </p> <p><strong><em>Requirements</em></strong></p> <ul><li> <div>net-snmp-utils (net-snmp for Windows) binary downloaded and installed in order to utilize snmptranslate.<br><em><strong><br>Linux</strong></em> </div> <div> <pre dir="ltr" class="code codeBlock" spellcheck="false" tabindex="0">yum install net-snmp-utils</pre> <br><em><strong>Windows </strong>(The default components of the install package should be sufficient)</em><br><a href="/home/leaving?allowTrusted=1&target=http%3A%2F%2Fwww.net-snmp.org%2Fdownload.html" rel="noopener nofollow" data-saferedirecturl="/home/leaving?allowTrusted=1&target=https%3A%2F%2Fwww.google.com%2Furl%3Fhl%3Den%26q%3Dhttp%3A%2F%2Fwww.net-snmp.org%2Fdownload.html%26source%3Dgmail%26ust%3D1491937335592000%26usg%3DAFQjCNGBh9csS8fF6sEzfGE_vS8E6kIwxw">http://www.net-snmp.org/<wbr></wbr>download.html<br><br><br></a> </div> </li> <li> <em><strong>Linux<br></strong></em>perl-CGI package installed in order to have access to the CGI::Carp module</li> </ul><p> </p> <p><strong>Step 1</strong></p> <p>Place the MIB that contains trap information and any dependency MIBs (e.g. CISCO-SMI.MIB) into the <TRAVERSE_HOME>/plugin/mibs directory</p> <p> </p> <p><strong>Step 2</strong></p> <p>Open a command prompt and navigate to <TRAVERSE_HOME>/plugin/mibs</p> <p><em>cd <TRAVERSE_HOME>/plugin/mibs</em></p> <p> </p> <p><strong>Step 3</strong></p> <p>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.</p> <p>E.g.<br><TRAVERSE_HOME>/utils/trap2xml.pl -i FILE.mib -o /tmp/50_rule_trap_file.xml</p> <p><em><strong>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.</strong></em></p> <p><strong>Step 4</strong></p> <p><a rel="nofollow" href="https://kaseya.vanillacommunities.com/kb/articles/aliases/kaseya/hc/en-gb/articles/229044148-Deploying-a-new-message-rule-file">Deploy the new rule file</a><br><br></p> <p>Notes:</p> <ul><li>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)</li> </ul><p><strong>APPLIES TO:</strong></p> <p>All versions of Traverse</p> </article> </main>