How-To: SNMP for Mac and Linux

How-To: SNMP for Mac and Linux

Note-taking time.. Again, some stuff i don’t usually use or encounter, so i better log them.. for future use.

Linux

  • yum -y install snmp
  • vi /etc/snmp/snmpd.conf
  • replace community string
  • service snmpd start
  • chkconfig snmpd on
  • ps ax| grep snmp: /usr/sbin/snmpd -Lsd -Lf /dev/null -p /var/run/snmpd.pid -a

Mac OS X 10.4 Xserve

  • From command land: snmpconf
  • Copy snmpd.conf (generated from snmpconf) to /usr/share/snmp/ folder
  • vi /etc/hostconfig
  • Edit and set to yes: SNMPSERVER=-YES-
  • Reboot.. or start snmpd (/usr/sbin/snmpd)
  • Test: snmpwalk -v1 -c <your-community-string> 127.0.0.1

To allow snmp in iptables:

# SNMP
$IPTABLES -A INPUT -p udp -s 0/0 –sport 1024:65535 -d $INTIP –dport 161:162 -m state –state NEW,ESTABLISHED -j ACCEPT
$IPTABLES -A OUTPUT -p udp -s $INTIP –sport 161:162 -d 0/0 –dport 1024:65535 -m state –state ESTABLISHED -j ACCEPT

Comments are closed.