updated to remove port and add service for firewall
This commit is contained in:
7
snmp.sh
7
snmp.sh
@@ -8,17 +8,12 @@ if [ "$EUID" -ne 0 ]; then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$EUID" -ne 0 ]; then
|
|
||||||
echo "Please run as root"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /etc/debian_version ]; then
|
if [ -f /etc/debian_version ]; then
|
||||||
apt update
|
apt update
|
||||||
apt install -y snmpd curl
|
apt install -y snmpd curl
|
||||||
elif [ -f /etc/redhat-release ]; then
|
elif [ -f /etc/redhat-release ]; then
|
||||||
yum install -y net-snmp net-snmp-utils
|
yum install -y net-snmp net-snmp-utils
|
||||||
firewall-cmd --zone=public --add-port=161/udp --permanent
|
firewall-cmd --zone=public --add-service=snmp --permanent
|
||||||
firewall-cmd --reload
|
firewall-cmd --reload
|
||||||
else
|
else
|
||||||
echo "Unable to determine linux distro"
|
echo "Unable to determine linux distro"
|
||||||
|
|||||||
Reference in New Issue
Block a user