1 Reply Latest reply on Sep 10, 2018 5:23 PM by Brendan Murray

    SNMP Adapter MAP file usage-syntax to create new class if certain condition matches ?

    Kaushik KM

      Hi Everyone!!

       

      We need to modify the map file to match the below condition and create a new class for certain events -

       

      Event Baroc FORMAT 1)

      snmp_enterprise='1.3.6.1.4.1.2.6.201';

      snmp_specific=3;

      snmp_oids=['1.3.6.1.6'];

      snmp_oidst=[internet];

      snmp_vals=['string one''string two' ' string three yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy' ];

       

      Event Baroc FORMAT 2)

      snmp_enterprise='1.3.6.1.4.1.2.6.201';

      snmp_specific=3;

      snmp_oids=['1.3.6.1.4.1.2.6.201.3'];

      snmp_oidst=[enterprises];

      snmp_vals=['string one'

      'string two'

      string three yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'];

       

      snmp_oids, snmp_oidst are different for above two events but snmp_enterprise and snmp_specific is same

       

      map file goes like this after parsing the MIB:

      ========================================================

      CLASS SNMP_cps

               $Enterprise equals /^1\.3\.6\.1\.4\.1\.2\.6\.201($|\.)/

       

                          CLASS SNMP_problemTrap

                          $Specific equals 3

                          snmpv_cpsSystemSendTrap = GetListElem ($var, 0)

                          END

      END

      =========================================================

       

       

      PROBLEM ) two diffrent format of the events are coming under the same class as their snmp_enterprise and snmp_specific are same.

      but i want to have a diffrent class for each of the above events so that i can do further string manipulation on two diffrent class event.

      as of now the rule which i write for 1st format of the event will fail for 2nd.

      (we can get the format 2 to format 1 by replacing new line character with null using mrl and perform string manipulation but i would like to know how to modify map file)

       

       

      do we have any documentation to modify variables in map file ? any help is appreciated!!

       

      IMP NOTE: snmp_vals is coming with NO comma inbetween string one string two ..... so the complete thing is one element.

       

       

      Regards,

      Kaushik KM