Skip to content

Commit

Permalink
Provide snmp collection switch (#570)
Browse files Browse the repository at this point in the history
* Provide snmp collection switch
  • Loading branch information
mbonsack authored and GitHub committed Jul 21, 2020
1 parent 92f0669 commit 736d679
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion package/etc/conf.d/log_paths/lp-snmp_traps.conf.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Startup events
# SNMP trap collection
# Enable with "SC4S_SNMP_TRAP_COLLECT=yes" in env_var

{{- if eq (getenv "SC4S_SNMP_TRAP_COLLECT" "no") "yes"}}
log {
source {snmptrap(
filename("/opt/syslog-ng/var/log/snmptrapd.log")
Expand Down Expand Up @@ -29,3 +31,4 @@ log {

flags(flow-control,final);
};
{{- end }}
7 changes: 6 additions & 1 deletion package/sbin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,13 @@ if ! gomplate $(find . -name *.tmpl | sed -E 's/^(\/.*\/)*(.*)\..*$/--file=\2.tm
echo "Error in Gomplate template; unable to continue, exiting..."
exit 800
fi
# Setup SNMPD

# Launch snmptrapd

if [ "$SC4S_SNMP_TRAP_COLLECT" == "yes" ]
then
/opt/net-snmp/sbin/snmptrapd -Lf /opt/syslog-ng/var/log/snmptrapd.log
fi

echo syslog-ng checking config
echo sc4s version=$(cat /VERSION)
Expand Down

0 comments on commit 736d679

Please sign in to comment.