Skip to content

Instantly share code, notes, and snippets.

@romale
Forked from jpawlowski/zabbix_snmp_setup.md
Created October 12, 2016 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save romale/9e1f3019f862814b38b799df398a60b5 to your computer and use it in GitHub Desktop.
Save romale/9e1f3019f862814b38b799df398a60b5 to your computer and use it in GitHub Desktop.
SNMPTT installation on CentOS 7 for Zabbix integration

SNMPTT installation on CentOS 7 for Zabbix integration

yum install wget make gcc net-snmp net-snmp-utils

cd /usr/local/src
wget http://downloads.sourceforge.net/project/snmptt/snmptt/snmptt_1.4/snmptt_1.4.tgz

tar xfz snmptt_*.tgz
snmp_*
cp -rv snmptt snmpttconvert snmpttconvertmib snmptthandler-embedded /usr/sbin/
chmod 755 /usr/sbin/snmptt*
cp -nv snmptt.ini /etc/snmp/snmptt.ini
cp -nv snmptt.logrotate /etc/logrotate.d/snmptt

useradd -N -r snmptt
mkdir -pv /var/log/snmptt
mkdir -pv /var/spool/snmptt
chown snmptt /var/log/snmptt /var/spool/snmptt

cp -vn /etc/snmp/snmptrapd.conf /etc/snmp/snmptrapd.conf.default
cat <<EOF >> /etc/snmp/snmptrapd.conf
authCommunity log,execute,net public
perl do "/usr/lib/snmptt/snmptthandler-embedded";
EOF

sed -i "s/OPTIONS='-Lsd/OPTIONS='-On -Lsd/" /etc/default/snmptrapd

sed -i 's;#date_format = %a %b %e %Y;date_format = %H:%M:%S %Y/%m/%d;' /etc/snmp/snmptt.ini
sed -i 's/syslog_enable = 1/syslog_enable = 0/' /etc/snmp/snmptt.ini
sed -i 's/net_snmp_perl_enable = 0/net_snmp_perl_enable = 1/' /etc/snmp/snmptt.ini
sed -i 's/net_snmp_perl_cache_enable = 0/net_snmp_perl_cache_enable = 1/' /etc/snmp/snmptt.ini

sed -i 's/^SNMPTrapperFile.*/SNMPTrapperFile = \/var\/log\/snmptt\/snmptt.log/' /etc/zabbix/zabbix_server.conf
echo "StartSNMPTrapper=1" >> /etc/zabbix/zabbix_server.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment