QNAP Zabbix Proxy Container

  • by Johan
  • 19/08/2019
  • 0 Comments

De Qnap TS-453Be is uitgerust met de QNAP OS versie 4.3. Eén van de aanwezige softwares is het ‘ContainerStation’.

Via een ‘handige’ wizard kan je o.a. een Docker Container opzetten. De basisinstellingen zijn uiteraard de netwerk instellingen en de image.
Er is ook de mogelijkheid om de shared folders in te voeren. Maar als je dat vier, vijf keer opnieuw moet invoeren ben je het wel snel beu.

Vandaar dat ik een ‘docker-compose’ scriptje heb gemaakt.

#!/bin/bash

docker run \
        --cpus 1 \
        -m 134217728 \
        -p 10051:10051 \
        --restart always \
        -v /share/Container/data/zabbix-proxy/usr/lib/zabbix/externalscripts:/usr/lib/zabbix/externalscripts \
        -v /share/Container/data/zabbix-proxy/var/lib/zabbix/enc:/var/lib/zabbix/enc \
        -v /share/Container/data/zabbix-proxy/var/lib/zabbix/modules:/var/lib/zabbix/modules \
        -v /share/Container/data/zabbix-proxy/var/lib/zabbix/ssh_keys:/var/lib/zabbix/ssh_keys \
        -v /share/Container/data/zabbix-proxy/var/lib/zabbix/ssl/certs:/var/lib/zabbix/ssl/certs \
        -v /share/Container/data/zabbix-proxy/var/lib/zabbix/ssl/keys:/var/lib/zabbix/ssl/keys \
        -v /share/Container/data/zabbix-proxy/var/lib/zabbix/ssl/ssl_ca:/var/lib/zabbix/ssl/ssl_ca \
        -v /share/Container/data/zabbix-proxy/var/lib/zabbix/snmptraps:/var/lib/zabbix/snmptraps \
        -v /share/Container/data/zabbix-proxy/etc/zabbix:/etc/zabbix \
		-v /share/Container/data/zabbix-proxy/usr/local/etc/zabbix_proxy.conf.d:/usr/local/etc/zabbix_proxy.conf.d \
        -e PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
        -e TERM=xterm \
        -e ZBX_HOSTNAME=ZProxy \
        -e ZBX_SERVER_HOST=zabbix.server.com \
		-e DB_SERVER_HOST=mysql.reynaert.be \
		-e MYSQL_DATABASE=zabbix \
        -e MYSQL_USER=zabbix \
        -e MYSQL_PASSWORD=RmtRmtRmt1997 \
        --entrypoint docker-entrypoint.sh \
        --name ZabbixProxy \
        zabbix/zabbix-proxy-mysql:centos-4.0-latest

En zoals je ziet hou ik er van om de zabbix config volledig zelf onder controle te hebben. Hierdoor zijn zelfs enkele environment variabelen overbodig geworden. Deze config heb ik op een plaatsje staan die je wel herkent. De inhoud van /etc/zabbix/zabbix_proxy.conf ziet er ongeveer zo uit:

# This is a configuration file for Zabbix proxy daemon
# To get more information about Zabbix, visit http://www.zabbix.com

############ GENERAL PARAMETERS #################

# ProxyMode=0
Server=zabbix.server.com
ServerPort=10051
Hostname=ZProxy
# HostnameItem=system.hostname
# ListenPort=10051
# SourceIP=
LogType=console
# LogFile=
# LogFileSize=1
# DebugLevel=3
# EnableRemoteCommands=0
# LogRemoteCommands=0
# PidFile=/tmp/zabbix_proxy.pid
# SocketDir=/tmp
DBHost=mysql.reynaert.be
DBName=zabbix
# DBSchema=
DBUser=zabbix
DBPassword=RmtRmtRmt1997
# DBSocket=
DBPort=3306

######### PROXY SPECIFIC PARAMETERS #############
# ProxyLocalBuffer=0
# ProxyOfflineBuffer=1
# HeartbeatFrequency=60
# ConfigFrequency=3600
# DataSenderFrequency=1
# StartPollers=5
# StartIPMIPollers=0
# StartTrappers=5
# StartPingers=1
# StartDiscoverers=1
# StartHTTPPollers=1
# JavaGateway=
# JavaGatewayPort=10052
# StartJavaPollers=0
# StartVMwareCollectors=0
# VMwareFrequency=60
# VMwarePerfFrequency=60
# VMwareCacheSize=8M
# VMwareTimeout=10
# SNMPTrapperFile=/tmp/zabbix_traps.tmp
# StartSNMPTrapper=0
# ListenIP=0.0.0.0
# HousekeepingFrequency=1
# CacheSize=8M
# StartDBSyncers=4
# HistoryCacheSize=16M
# HistoryIndexCacheSize=4M
# TrapperTimeout=300
# UnreachablePeriod=45
# UnavailableDelay=60
# UnreachableDelay=15
ExternalScripts=/usr/lib/zabbix/externalscripts
FpingLocation=/usr/sbin/fping
Fping6Location=/usr/sbin/fping6
SSHKeyLocation=/var/lib/zabbix/ssh_keys
# LogSlowQueries=0
# TmpDir=/tmp
# AllowRoot=0
# User=zabbix
Include=/usr/local/etc/zabbix_proxy.conf.d/

SSLCertLocation=/var/lib/zabbix/ssl/certs/
SSLKeyLocation=/var/lib/zabbix/ssl/keys/
SSLCALocation=/var/lib/zabbix/ssl/ssl_ca/

LoadModulePath=/var/lib/zabbix/modules/

# TLSConnect=unencrypted
# TLSAccept=unencrypted
# TLSCAFile=
# TLSCRLFile=
# TLSServerCertIssuer=
# TLSServerCertSubject=
# TLSCertFile=
# TLSKeyFile=
# TLSPSKIdentity=
# TLSPSKFile=
Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *