Ubuntu_install_snmp_snmpd.sh

#!/bin/bash
#Ubuntu_install_snmp_snmpd.sh
apt-get update
apt-get install snmp snmpd

#access MyROSystem ""     any       noauth    exact  all none   none
sed -i 's/access MyROSystem ""     any       noauth    exact  system none   none/access MyROSystem ""     any       noauth    exact  all none   none/g' /etc/snmp/snmpd.conf

#snmpDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid'" 
sed -i 's/-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1/-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid/g' /etc/snmp/snmpd.conf

service snmpd start
update-rc.d defaults snmpd
snmpwalk -v 2c -c public localhost

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章