Remotely connect to your Linux server to begin the setup procedure.


1-grid offers a custom script to install, configure and setup your Linux server community without having to perform these tasks manually. Should you wish to make use of the script: Please retrieve it from here this KB article: 


Download it from this KB article and FTP it to your dedicated server.


Convert the downloaded file to a bash script file (.sh) and make it executable:


mv snmp_1grid.txt snmp_1grid.sh 

chmod +x snmp_1grid.sh

./snmp_1grid.sh




Alternatively, follow the setups below on how to install and configure SNMP for 1-grid:



CENTOS

Install the SNMP service role


1. sudo yum -y install net-snmp-net-snmp-utils

 


2. If YOU HAVE your own communities set up - open the following file up in a text editor - and add these communities:


File: 


/etc/snmp/snmpd.conf


Add these communities:


rocommunity ghspublic default

rocommunity6 ghspublic default



3. If YOU DO NOT HAVE your own communities set up - perform these commands in sequence:


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

touch /etc/snmp/snmpd.conf


Edit File: 


/etc/snmp/snmpd.conf


Add these communities:


rocommunity ghspublic default

rocommunity6 ghspublic default



4. Allow the services through Iptables:


iptables -A INPUT -p udp -s 41.185.120.20 -m state --state NEW -m udp --dport 161 -j ACCEPT


If you're using firewalld - you can use the following command:


firewall-cmd --zone=public --permanent --add-rich-rule='rule family="ipv4" source address="41.185.120.20" port protocol="udp" port="161" accept'



5. Finishing up. Start the service on boot and restart the snmpd service:


chkconfig snmpd on

service snmpd restart




UBUNTU



Install the SNMP service role


1. apt-get install snmpd snmp snmp-mibs-downloader -y





2. If YOU HAVE your own communities set up - open the following file up in a text editor - and add these communities:


File: 


/etc/snmp/snmpd.conf


Add these communities:


rocommunity ghspublic default

rocommunity6 ghspublic default




3. If YOU DO NOT HAVE your own communities set up - perform these commands in sequence:


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

touch /etc/snmp/snmpd.conf


Edit File: 


/etc/snmp/snmpd.conf


Add these communities:


rocommunity ghspublic default

rocommunity6 ghspublic default


4. Allow the services through Iptables:


iptables -A INPUT -p udp -s 41.185.120.20 -m state --state NEW -m udp --dport 161 -j ACCEPT


If you're using ufw - you can use the following command:


ufw allow from 41.185.120.20 to any port 161



5. Finishing up. Start the service on boot and restart the snmpd service:


systemctl enable snmpd.service &>/dev/null
systemctl restart snmpd &>/dev/null



You've installed and configured the SNMP service role.