Created
March 25, 2014 20:25
-
-
Save jm66/9770607 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SNMPDCONF=/etc/snmp/snmpd.conf | |
AGENTADDR=" udp:161,udp6:[::1]:161" | |
ROCOMM="dcbread 128.100.102.151" | |
SYSLOC="DCB-UCS" | |
SYSADM="[email protected]" | |
# installing snmpd and snmp | |
sudo apt-get install snmpd snmp -y | |
# replacing a few snmpd.conf values | |
sudo sed -i "s/^\(agentAddress\s*\s*\).*\$/\1$AGENTADDR/" $SNMPDCONF; | |
sudo sed -i "s/^\(sysLocation\s*\s*\).*\$/\1$SYSLOC/" $SNMPDCONF; | |
sudo sed -i "s/^\(sysContact\s*\s*\).*\$/\1$SYSADM/" $SNMPDCONF; | |
sudo sed -i "s/^\(rocommunity\s*\s*\).*\$/\1$ROCOMM/" $SNMPDCONF; | |
#restarting snmpd services | |
sudo service snmpd restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment