Update snmp.sh
This commit is contained in:
17
snmp.sh
17
snmp.sh
@@ -8,8 +8,21 @@ if [ "$EUID" -ne 0 ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
# isntall curl and snmpd
|
||||
apt install -y snmpd curl
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Please run as root"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -f /etc/debian_version ]; then
|
||||
apt update
|
||||
apt install -y snmpd curl
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
yum install -y net-snmp net-snmp-utils
|
||||
else
|
||||
echo "Unable to determine linux distro"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
# back the original config file
|
||||
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak
|
||||
|
||||
Reference in New Issue
Block a user