Skip to content

Instantly share code, notes, and snippets.

@binsky08
Last active June 19, 2020 13:54
Show Gist options
  • Save binsky08/e2449ad9a5435f2758f2a65aff3d4211 to your computer and use it in GitHub Desktop.
Save binsky08/e2449ad9a5435f2758f2a65aff3d4211 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
cp /opt/openitc/frontend-modules/SnmpTrapModule/src/nagios_plugin/check_snmptraps.pl /opt/openitc/nagios/libexec/
chmod 755 /opt/openitc/nagios/libexec/check_snmptraps.pl
if [ -f "/usr/share/snmp/mibs/ietf/SNMPv2-PDU" ] ; then
cp /opt/openitc/frontend-modules/SnmpTrapModule/src/SNMPv2-PDU_fixed /usr/share/snmp/mibs/ietf/SNMPv2-PDU
fi
mkdir -p /opt/openitc/etc/SnmpTrapModule
if id -u snmptt > /dev/null 2>&1; then
if id -u snmp > /dev/null 2>&1; then
usermod -a -G snmptt snmp
usermod -a -G snmp snmptt
fi
if id -u "Debian-snmp" > /dev/null 2>&1; then
usermod -a -G snmptt Debian-snmp
usermod -a -G Debian-snmp snmptt
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment