CentOS 6.4安裝net-snmp服務

 

#!/bin/bash

#install net-snmp rpm
yum -y install net-snmp net-snmp-utils

#backup snmpd.conf
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig

#create snmpd.conf
echo "rocommunity public" > /etc/snmp/snmpd.conf

#disable snmpd access log
echo -en "# snmpd command line options\nOPTIONS=\"-Lf /dev/null -p /var/run/snmpd.pid\"" > /etc/sysconfig/snmpd

#set snmpd start on boot
chkconfig snmpd on

#restart to apply new snmpd.conf 
service snmpd restart

 

Facebook Comments Box

Leave a Reply