Configuring SNMP on a Linux server
- Install Carbonite Availability and Carbonite Migrate, if it is not already installed.
-
Move the DTSubAgent_init script to /etc/init.d/DTSubAgent
# mv DTSubAgent_init /etc/init.d/DTSubAgent
# chmod 755 /etc/init.d/DTSubAgent
-
Install the NET-SNMP service, libs, and utils rpm, if they are not already installed.
# yum install net-snmp net-snmp-utils
-
Make a backup copy of the SNMP configuration file snmpd.conf.
# cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig
-
Edit the snmpd.conf file and insert the following line with the view definitions.
view systemview included .1.3.6.1.4.1.2592
-
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>
-
Create or edit /usr/share/snmp/snmp.conf and add the following lines.
mibdirs +/usr/share/snmp/mibs
mibs +NSI-MIB
-
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"
-
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
- 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.
-
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.
- 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.
-
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 Carbonite Availability and Carbonite Migrate events gathered from the latest log such as dttrapKernelStarted (OID 1).