Solaris System Management Agent Developer's Guide

ProcedureHow to Dynamically Load a Module and Restart the Agent

  1. Copy the module shared library object to a lib directory.

    You should keep your .so files in a directory that is writable by non-root users.

  2. As root, edit the agent's configuration file to enable the agent to dynamically load the module.

    In the /etc/sma/snmp/snmpd.conf file, add a line that is similar to the following, where testmodule is the name of the module.

    dlmod testmodule /home/username/snmp/lib/testmodule.so
  3. As root, restart the snmpd agent by typing the following command.


    # svcadm restart svc:/application/management/sma:default
    

    The module should now be loaded. You can use snmpget and snmpset commands to access the module's data to confirm that the module is loaded. You should make sure your MIB can be located by the snmpget and snmpset commands by setting your MIBDIRS and MIBS environment variables, as described in Setting MIB Environment Variables.


    Tip –

    To unload a module, you would remove the dlmod line from the snmpd.conf file and restart the agent.