zabbix/zabbix-java-gateway.sh
Boris Manojlovic 872b90d083 - update version to latest release 6.0.36
- New Features and Improvements
  + ZBXNEXT-9249 Added new items and trigger for disk space usage in
    LXC containers for Proxmox VE by HTTP template Templates
  + ZBXNEXT-9382 Added Nutanix template Templates
  + ZBXNEXT-9058 Updated VMware Hypervisor template for ability to work as a standalone template Templates
  + ZBXNEXT-9532 Updated maximum supported TimescaleDB version to 2.17 Server
  + ZBXNEXT-9238 Updated maximum supported PostgreSQL version to 17 Proxy Server
  + ZBXNEXT-9457 Added Huawei OceanStor V6 by SNMP template Templates
  + ZBXNEXT-9246 Added monitoring of HA manager process utilization Server
  + ZBXNEXT-9418 Split {$PG.CONNSTRING} macro in PostgreSQL templates Templates
  + ZBXNEXT-9416 Updated max supported MariaDB version to 11.5 Proxy Server
  + ZBXNEXT-9318 Added Microsoft 365 reports by HTTP template Templates
  + ZBXNEXT-9248 Added GitHub repository by HTTP template Templates
  + ZBXNEXT-9408 Updated max supported TimescaleDB version to 2.16 Server
  + ZBXNEXT-8937 Added support of IMDSv2 in role-based authorization for AWS templates Templates
  + ZBXNEXT-9398 Added new mediatype webhook MS Teams Workflow Templates
  + ZBXNEXT-9341 Added assume role authorization in AWS templates Templates
- Bug Fixes
  + ZBX-25463 Fixed an endless loop in the report manager Server
  + ZBX-25477 Fixed the crash occurring when a calculated item contained large value Server
  + ZBX-21618 Fixed the layout of multiple list pages when displaying long entity names Frontend
  + ZBX-25444 Fixed missing maintenance data in maps for map-type elements Frontend
  + ZBX-25397 Fixed events not being suppressed during maintenance if a deadlock occurred Server
  + ZBX-25324 Fixed FreeTDS ODBC login with special characters in the password field Server
  + ZBX-24582 Truncated the error message for testing items with a value type mismatch Server
  + ZBX-25096 Fixed performance counter query in MSSQL by ODBC template; updated documentation 
    of MSSQL by Zabbix agent 2 template Templates
  + ZBX-25301 Removed redundant message size check on 32-bit platforms when sending TCP message Agent Proxy Server
  + ZBX-25208 Fixed merging of user macros in the `Inherited and host/template/host prototype macros` mode;

OBS-URL: https://build.opensuse.org/package/show/server:monitoring:zabbix/zabbix?expand=0&rev=68
2024-12-04 09:24:22 +00:00

122 lines
2.8 KiB
Bash

#!/bin/bash
CMD=$1
NOHUP=${NOHUP:=$(which nohup)}
# resolve links - $0 may be a softlink
ZBXJAVAGWCTL="$0"
while [ -h "$ZBXJAVAGWCTL" ]; do
ls=$(ls -ld "$ZBXJAVAGWCTL")
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' > /dev/null; then
ZBXJAVAGWCTL="$link"
else
ZBXJAVAGWCTL=$(dirname "$ZBXJAVAGWCTL")/"$link"
fi
done
SERVICE_NAME="zabbix-java-gateway"
JAVA=${JAVA:-java}
JAVA_OPTIONS="-server"
JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=/etc/zabbix/zabbix-java-gateway-log.xml"
ZABBIX_OPTIONS=${ZABBIX_OPTIONS:=}
ZABBIX_JAVA_DIR=${ZABBIX_JAVA_DIR:=$(dirname "$ZBXJAVAGWCTL")}
ZABBIX_JAVA_CONF=${ZABBIX_JAVA_CONF:=/etc/zabbix/zabbix-java-gateway.conf}
ZABBIX_JAVA_GW_PID=${ZABBIX_JAVA_GW_PID:=/run/zabbixs/zabbix-java-gateway.pid}
ZABBIX_JAVA_GW_LOGFILE=${ZABBIX_JAVA_GW_LOGFILE:=/var/log/zabbixs/zabbix-java-gateway.log}
# source configuration...
. ${ZABBIX_JAVA_CONF}
# Build classpath
CLASSPATH=$(echo $(find /usr/lib/zabbix-java-gateway/ -name "*jar" -type f -print)|sed -e 's/ /:/g')
if [ -n "$PID_FILE" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.pidFile=$PID_FILE"
fi
if [ -n "$LISTEN_IP" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.listenIP=$LISTEN_IP"
fi
if [ -n "$LISTEN_PORT" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.listenPort=$LISTEN_PORT"
fi
if [ -n "$START_POLLERS" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.startPollers=$START_POLLERS"
fi
COMMAND_LINE="$JAVA $JAVA_OPTIONS -classpath $CLASSPATH $ZABBIX_OPTIONS com.zabbix.gateway.JavaGateway"
start() {
status
if [ $? -ne 0 ]; then
echo "Starting ${SERVICE_NAME} ..."
cd "$ZBXJAVAGWCTL_DIR"
(/bin/bash -c "$COMMAND_LINE > /dev/null 2>&1 & echo \$!") > ${ZABBIX_JAVA_GW_PID}
fi
}
run() {
echo "Running ${SERVICE_NAME} ..."
cd "$ZBXJAVAGWCTL_DIR"
exec $COMMAND_LINE
}
stop() {
pid=$(cat ${ZABBIX_JAVA_GW_PID})
echo "Stopping ${SERVICE_NAME} ($pid) ..."
if kill $pid; then
rm ${ZABBIX_JAVA_GW_PID}
fi
}
restart() {
echo "Restarting ${SERVICE_NAME} ..."
stop
start
}
status() {
pid=$(get_pid)
if [ ! -z $pid ]; then
if pid_running $pid; then
echo "${SERVICE_NAME} running as pid $pid"
return 0
else
echo "Stale pid file with $pid - removing..."
rm ${ZABBIX_JAVA_GW_PID}
return 1
fi
fi
echo "${SERVICE_NAME} not running"
return 3
}
get_pid() {
cat ${ZABBIX_JAVA_GW_PID} 2> /dev/null
}
pid_running() {
kill -0 $1 2> /dev/null
}
case "$CMD" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status
;;
run)
run
;;
*)
echo "Usage $0 {start|stop|restart|status}"
RETVAL=1
esac