SNMP > Configuring SNMP on a Linux server

Configuring SNMP on a Linux server

  1. Install Double-Take, if it is not already installed.
  2. Move the DTSubAgent_init script to /etc/init.d/DTSubAgent

    # mv DTSubAgent_init /etc/init.d/DTSubAgent

    # chmod 755 /etc/init.d/DTSubAgent

  3. Install the NET-SNMP service, libs, and utils rpm, if they are not already installed.

    # yum install net-snmp net-snmp-utils

  4. Make a backup copy of the SNMP configuration file snmpd.conf.

    # cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig

  5. Edit the snmpd.conf file and insert the following line with the view definitions.

    view systemview included .1.3.6.1.4.1.2592

  6. Append the following lines to the end of the file, where <SNMP Manager IP> is the IP address where the SNMP manager is being run.

    master agentx

    trapcommunity public

    trapsink <SNMP Manager IP>

    If your snmpd.conf file is empty, add the following content to the file, where <SNMP Manager IP> is the IP address where the SNMP manager is being run.

    com2sec   nsiUser     default   public

    group         nsiGroup   v1          nsiUser

    group         nsiGroup   v2c        nsiUser

    view           all                   included     .1

    access      nsiGroup     ""        any         noauth    exact    all  all  all

    rocommunity public 127.0.0.1

    master agentx

    trapcommunity public

    trapsink <SNMP Manager IP>

     

  7. Create or edit /usr/share/snmp/snmp.conf and add the following lines.

    mibdirs +/usr/share/snmp/mibs

    mibs +NSI-MIB

  8. Edit the shell script /etc/init.d/snmpd and insert the following in the OPTIONS line.

    -x /var/agentx/master"

    It should now be similar to this.

    OPTIONS="-x /var/agentx/master -LS0-6d -Lf /dev/null -p /var/run/snmpd.pid"

  9. Install and start the snmpd and DTSubAgent services by running the following commands.

    # chkconfig --add snmpd

    # chkconfig snmpd on

    # service snmpd start

    # chkconfig --add DTSubAgent

    # chkconfig DTSubAgent on

    # service DTSubAgent start

  10. Reboot the system to ensure that the latest versions of the Net-SNMP libraries are loaded and that the snmpd and DTSubAgent services start as expected.
  11. Confirm that the agents are configured correctly. The output should be similar to the text below the command.

    # snmpget -v2c -c public localhost dtGeneral.dtUpTime.0

    NSI-MIB::dtUpTime.0 = Timeticks: (586000) 1:37:40.00

    If the output says that the object could not be found, confirm that the snmpd.conf has "public" as the community specified in the line beginning "com2sec". If it uses a different value, try that value in the snmpget command above.

  12. Once you have this working, you should change the community string to a custom value for security reasons. DTSubAgent only supports v2c so SNMP user credentials cannot be used.
  13. Confirm that the SNMP monitor is configured to receive traps remotely by stopping/starting the DTSubAgent service after the monitor is set up.

    # service DTSubAgent restart

    This will generate traps for Double-Take events gathered from the latest log such as dttrapKernelStarted (OID 1).