Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
@mrRobit

This comment has been minimized.

Copy link

@mrRobit mrRobit commented Oct 27, 2016

At line 7, you are missing "cd" in front of snmp_*?

@kerneldoug

This comment has been minimized.

Copy link

@kerneldoug kerneldoug commented Jul 7, 2017

And Centos 7.3, snmptrapd is at /etc/sysconfig/snmptrapd, not /etc/default/snmptrapd

sed -i "s/# OPTIONS=\"-Lsd/OPTIONS=\"-On -Lsd"/ /etc/sysconfig/snmptrapd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.