forked from splunk/splunk-connect-for-snmp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·39 lines (36 loc) · 963 Bytes
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
set -e
. /app/.venv/bin/activate
LOG_LEVEL=${LOG_LEVEL:=INFO}
WORKER_CONCURRENCY=${WORKER_CONCURRENCY:=4}
wait-for-dep "${CELERY_BROKER_URL}" "${REDIS_URL}" "${MONGO_URI}" "${MIB_INDEX}"
case $1 in
inventory)
inventory-loader
;;
celery)
case $2 in
beat)
celery -A splunk_connect_for_snmp.poller beat -l "$LOG_LEVEL" --max-interval=10
;;
worker-trap)
celery -A splunk_connect_for_snmp.poller worker -l "$LOG_LEVEL" -Q traps --autoscale=8,"$WORKER_CONCURRENCY"
;;
worker-poller)
celery -A splunk_connect_for_snmp.poller worker -l "$LOG_LEVEL" -O fair -Q poll --autoscale=8,"$WORKER_CONCURRENCY"
;;
worker-sender)
celery -A splunk_connect_for_snmp.poller worker -l "$LOG_LEVEL" -Q send --autoscale=6,"$WORKER_CONCURRENCY"
;;
*)
celery "$2"
;;
esac
;;
trap)
traps "$LOG_LEVEL"
;;
*)
echo -n unknown cmd "$@"
;;
esac