mirror of
https://github.com/newnius/Dockerfiles.git
synced 2025-12-15 10:26:44 +00:00
add zabbix-agent
This commit is contained in:
22
zabbix-agent/normal/bootstrap.sh
Executable file
22
zabbix-agent/normal/bootstrap.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
SERVER="localhost"
|
||||
HOSTNAME=$(hostname)
|
||||
|
||||
if ! [[ -z "${ZBX_SERVER_HOST}" ]]; then
|
||||
SERVER=${ZBX_SERVER_HOST}
|
||||
fi
|
||||
|
||||
if ! [[ -z "${ZBX_HOSTNAME}" ]]; then
|
||||
HOSTNAME=${ZBX_HOSTNAME}
|
||||
fi
|
||||
|
||||
while true; do
|
||||
|
||||
temp=$(sensors | awk '{print $3}' | grep '+' | sed -r 's/\+([0-9]*)\..*/\1/g' | sort | tail -n 1)
|
||||
|
||||
zabbix_sender -s $HOSTNAME -z $SERVER -k "temp" -o $temp
|
||||
|
||||
sleep 30
|
||||
|
||||
done
|
||||
Reference in New Issue
Block a user