zabbix-docker/java-gateway/alpine/conf/usr/sbin/zabbix_java_gateway

36 lines
1.1 KiB
Plaintext
Raw Normal View History

2021-02-18 14:26:58 +01:00
2016-08-03 10:09:49 +02:00
JAVA=${JAVA:-"/usr/bin/java"}
JAVA_OPTIONS="-server $JAVA_OPTIONS"
JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=/etc/zabbix/zabbix_java_gateway_logback.xml"
2021-02-18 14:26:58 +01:00
cd /usr/sbin/zabbix_java
2016-08-03 10:09:49 +02:00
2021-02-18 14:26:58 +01:00
CLASSPATH="lib"
for jar in `find lib bin ext_lib -name "*.jar"`; do
2021-02-18 14:26:58 +01:00
CLASSPATH="$CLASSPATH:$jar"
2016-08-03 10:09:49 +02:00
done
2021-02-18 14:26:58 +01:00
if [ -n "$ZBX_LISTEN_IP" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.listenIP=$ZBX_LISTEN_IP"
fi
if [ -n "$ZBX_LISTEN_PORT" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.listenPort=$ZBX_LISTEN_PORT"
fi
2016-08-03 10:09:49 +02:00
if [ -n "$ZBX_START_POLLERS" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.startPollers=$ZBX_START_POLLERS"
fi
if [ -n "$ZBX_TIMEOUT" ]; then
2021-02-18 14:26:58 +01:00
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.timeout=$ZBX_TIMEOUT"
2016-08-03 10:09:49 +02:00
fi
2021-02-18 19:14:27 +01:00
if [ -n "$ZBX_PROPERTIES_FILE" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.propertiesFile=$ZBX_PROPERTIES_FILE"
2016-08-03 10:09:49 +02:00
fi
2021-02-18 14:26:58 +01:00
tcp_timeout=${ZBX_TIMEOUT:=3}000
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dsun.rmi.transport.tcp.responseTimeout=$tcp_timeout"
2016-08-03 10:09:49 +02:00
COMMAND_LINE="$JAVA $JAVA_OPTIONS -classpath $CLASSPATH $ZABBIX_OPTIONS com.zabbix.gateway.JavaGateway"
exec $COMMAND_LINE