Setting the trap port for multiple IP domains.

A challenge that is frequently met in Smarts IP domain deployments is one of giving each domain manager running on the same server a different port for SNMP trap reception - in particular, when the domain name and the port numbers are the only configuration values that differ between them.

The default mechanism for setting the port is to edit the file local/conf/trapd/trapd.conf. This works fine it you only have one domain manager running on your server, but things get more complex when you have more than one, because the different servers all (by default) accesss the same configuration file.

There are three approaches I am aware of to solve this challenge. Of these three, the last one is the one I generally use.

Option 1: SITEMOD

One is to use the "SITEMOD" mechanism to give all your domains different "local" directories. This is rather over-kill if the trap port number is the only parameter that is different per domain. I dont recommend this solution although it is the one that EMC support generally suggest.

Option 2: --config

Another option is to use the "-c" configuration parameter (or: "--config") to refer to a bootstrap folder other than the normal "icf". This also requires some file duplication which can be simplified using symbolic links (on linux systems, anyway). The process is as follows..

  • Make a copy of the trapd.conf for each domain in local/conf/trapd (eg: trapd-ABC.conf and trapd-DEF.conf).
  • Make a copy of the local/conf/icf folder for each domain (eg: icf-ABC and icf-DEF).
  • Make sure the icf folders all have a copy of the TRAP.import file - and edit the trapd.conf file name listed in there.
  • Change the sm_service configuration for each domain to use the appropriate "-c" or "--config" argument (eg: '-c icf-ABC').

You may need to address issues of dynamic model file locations etc as well to make this work. Note that you can use linux symbolic links to help by having just one copy of the files that dont change per domain in the conf/icf* and model/icf* directories.

Option 3: Using environment variable

There is a simpler way - and this is the one I generally use. There is no need to struggle with maintaining multiple copies of identical files (etc). All you do is to tell the domain to take the trap port from the environment using a simple ASL edit, and then update the sm_serviced configuration to select a different port per domain. Here's the process..

  • Make a copy of the SNMP_TrapConf.asl script in the folder local/rules/trapd
  • Edit the script to add a line to the PORT_ENTRY rule, like this.
    PORT_ENTRY {
        "PORT:" portNumber:integer eol
    } do {
        if (portNumber == 0) { portNumber = numeric(object("SM-System")->getenv("SM_TRAPPORT")); }
        if (portNumber > 65535)
            {
                SmSystem->logError("TRAP_IRECVPORT", string(portNumber));
                quit();
            }
        TrapManager->port = portNumber;
    }
  • Edit the trapd.conf file and set the PORT value to 0 (zero).
  • Modify the sm_serviced configuration for the domain to add the SM_TRAPPORT environment variable, like this
    sm_service install --force  --unmanaged  --startmode=manual \
     '--name=IP' \
     '--description=EMC Smarts Availability and Performance Server' \
     '--env=SM_TRAPPORT=9041' \
     '/opt/InCharge9/IP/smarts/bin/sm_server' \
     '--name=IP' \
     '--config=icf' \
     '--port=9051' \
     '--bootstrap=bootstrap-am-pm.conf' \
     '--subscribe=default' \
     '--output=IP'
  • Now stop and restart the domain.
Scroll to Top