Docker containers for Zabbix Server and Zabbix Web

dockerZabbix Logo

Since a few weeks I started using Docker and building containers and this is really fun to do. So one of my first public docker containers had to be something with Zabbix. 🙂

So I have created 2 docker containers;

  • zabbix-server
  • zabbix-web

So, here follows an description about the 2 containers.

Zabbix-Server

This container will run an zabbix-server. Jeah!

Its an Debian based container (As Debian is one of the smaller ones) and will only run the Zabbix Server. No database is running in this container, it is configured to use an MySQL database as backend. Before you can make use of this container, you’ll have to have an MySQL Server running somewhere in your environment. It will install Zabbix 3.0.1

How do we use this container? First we have to download it:

docker pull wdijkerman/zabbix-server

And this is how we start it:

docker run  -p 10051:10051 --name zabbix-server \
            -v /data/zabbix:/zabbix \
            -e ROOTPASSWORD=secretpassword \
            -e DBHOST=192.168.1.153 -e DBUSER=zabbix \
            -e DBPASSWORD="zabbix-pass" \
            -e DBPORT=3306 -e DBNAME=zabbix wdijkerman/zabbix-server

This docker container make use of an volume, mentioned with the -v parameter. This will mount the ‘/data/zabbix’ directory in the docker container as ‘/zabbix’. This directory contains the directories which are used for storing SSL (configuration) files, modules and scripts. With the -p option, we open the port on the host (10051) and forward it to the port to the docker container (10051).

The -e values which you see are environment settings that are passed into the docker container. These environment settings are the actual Zabbix Server configuration options but in uppercase. As you might see, the settings in the example are used for connecting to the database ‘zabbix’ on host ‘192.168.1.153’ with username ‘zabbix’ and password ‘zabbix-pass’. I also specified the ‘ROOTPASSWORD’ setting, this is the password for the MySQL root user. When this is supplied, it will create the database (DBNAME) and create the user (DBUSER). If you don’t specify it (Which can of course) an database and user should already be created.

With this in mind, if we want to set the StartPollers parameter to 10, we have to update the run command by adding the following:

-e STARTPOLLERS=10

Now you can configure the Zabbix Server exactly like you want, just by adding some environment parameters in the command line before starting it.

But this is only the Zabbix Server, not the frontend.

Zabbix Web

This container contains only the Zabbix Web part, or the ‘frontend’. (docker hub)

Like the Zabbix Server, this is also an Debian based docker container and will only work with MySQL as database. It is running Apache 2.4.

How do we use this container? First we have to download it:

docker pull wdijkerman/zabbix-web

And this is how we start it:

docker run  -p 80:80 --name zabbix-web \
            -e ZABBIXURL=zabbix.example.com \
            -e ZBXSERVERNAME=vserver-151 \
            -e ZBXSERVER=192.168.1.151 \
            -e DBHOST=192.168.1.153 -e DBUSER=zabbix \
            -e DBPASSWORD="zabbix-pass" \
            -e DBPORT=3306 -e DBNAME=zabbix wdijkerman/zabbix-web

The DB* settings are the same as for the Zabbix Server container, so I won’t describe them again. With the Zabbix Web container we open port 80 on the host and forward it to port 80 on the docker container.

With the ZABBIXURL setting, we specify the url on which the web interface is available. In this case, when we open ‘zabbix.example.com’ we get the login page of Zabbix. (Well, if you have access to the zabbix.example.com domain 😉 ) With the ZBXSERVERNAME setting we specify the name of the Zabbix Server and with ZBXSERVER we let the Zabbix Web know where it can find the Zabbix Server.

Please let me know if you find any issues with configuring it or encounter an bug. Also if you have improvements, please create an PR on github! 🙂

Links:

Advertisements

Transferred puppet module wdijkerman-zabbix to voxpupuli

Zabbix LogoPuppet Logo

After 2 years of developing, 25 releases, 78 forks and +35000 downloads of the Puppet module for installing and maintaining Zabbix, I’ve decided to move the module to the guys at Vox Pupuli. As my focus lately is towards other tools as Ansible and Docker, I don’t have any time anymore to keep my Puppet knowledge up2date. The last half year (or maybe little bit longer) I only could accept Pull Requests and do some minor changes, anything else would cost me a lot of time to figure it out how things would work in Puppet.

With transferring the module to the guys at Vox Pupuli, I would say the module will be in very good hands. (Well, some of those guys provided a lot of Pull Requests to improve the CI part of the Module.. 🙂 )

@Vox Pupuli: Good luck and hopefully you could improve it a lot more! 🙂

wdijkerman-zabbix 2.1.0 puppet module just released

Puppet Logo Zabbix Logo

I just released an new version of the wdijkerman-zabbix puppet module: 2.0.0.

This release was possible with the huge efforts that @rnelson0 made for this module. Did fixed some bugs, tests and made it possible to use travis-ci.org to validate the builds. When an Pull Request is created by someone, the PR will be build on travis-ci too! 🙂

The change log for this release:

  • Removed a debug entry #156 (By pull request: hkumarmk (Thanks!))
  • Add Puppet Forge Version and Downloads badges #163 (By pull request: rnelson0 (Thanks!))
  • Travis CI setup: ensure all rspec tests pass #162 (By pull request: rnelson0 (Thanks!))
  • Update proxy.pp, fix Error: …install zabbix-proxy- .. #159 (By pull request: subkowlex (Thanks!))
  • Puppetgem #158 (By pull request: rnelson0 (Thanks!))

The “#<NUM>” is a reference to an Github issue. The release can now also be found on and downloaded from the forge.

If you find an bug or have an improvement for this Zabbix puppet module, please create pull requests!

wdijkerman-zabbix 2.0.0 puppet module just released

Puppet LogoZabbix Logo

I just released an new version of the wdijkerman-zabbix puppet module: 2.0.0.

This release will contain a lot of Pull Requests, bug fixes and some new features. This release also works with Puppet 4. (Probably also with earlier versions, but first time I tested it work Puppet 4).

The change log for this release:

  • wdijkerman-zabbix works with puppet 4
  • Fix for: Server and Proxy templates are inconsistent #144
  • fixed SSL server template options for 2.2 #141 (By pull request: IceBear2k (Thanks!))
  • fix syntax error #139 (By pull request: mkrakowitzer (Thanks!))
  • Allow agent to listen on * #138 (By pull request: ekohl (Thanks!))
  • enable apache_php_max_input_vars #137 (By pull request: bastelfreak (Thanks!))
  • Fix typo in zabbix-userparameters reference #136 (By pull request: sgnl05 (Thanks!))
  • Listen on all IPs #133 (By pull request: z3rogate (Thanks!))
  • tap0 or tun0 (OpenVPN interfaces) interface as listenip #132 (By pull request: z3rogate (Thanks!))
  • fixed typo for comment mysql #145 (By pull request: eander210 (Thanks!))
  • Updated the listen_ip for proxy so it same as for agent.
  • allow serveractive to be optional #146 (By pull request: ericsysmin (Thanks!))
  • Allow agent_serveractive value to be blank #147 (By pull request: ericsysmin (Thanks!))
  • Added support for adding LDAP certificate location to Zabbix Web. Upd… #150 (By pull request: elricsfate (Thanks!))
  • Added zabbix_template_host type #154 (By pull request: hkumarmk (Thanks!))
  • Type to manage zabbix application #155 (By pull request: hkumarmk (Thanks!))

The “#<NUM>” is a reference to an Github issue. The release can now also be found on and downloaded from the forge.

If you find an bug or have an improvement for this Zabbix puppet module, please create pull requests!

wdijkerman-zabbix version 1.7.0 puppet module released

Puppet LogoZabbix Logo

I just released an new version of the wdijkerman-zabbix puppet module: 1.7.0.

This is an “Pull requests” release, as this release only contains pull requests created by users of this module. 🙂

The change log for this release:

  • misspelled parameter path #116 (By pull request: karolisc (Thanks!))
  • Update template.pp #121 (By pull request: claflico (Thanks!))
  • add support for CloudLinux #122 (By pull request: bastelfreak (Thanks!))
  • Fping wrong path in debian #124 (By pull request: Oyabi (Thanks!))
  • refactoring of repo.pp #126 (By pull request: bastelfreak (Thanks!))
  • Added supporting new Zabbix params #128 (By pull request: akostetskiy (Thanks!))
  • Generalise the zabbix_url #129 (By pull request: DjxDeaf (Thanks!))

The “#<NUM>” is a reference to an Github issue. The release can now also be found on and downloaded from the forge.

If you find an bug or have an improvement for this Zabbix puppet module, please create pull requests!

wdijkerman-zabbix version 1.6.0 puppet module released

Puppet LogoZabbix Logo

I just released an new version of the wdijkerman-zabbix puppet module: 1.6.0.

Not yet puppet 4 compliant. I have some local issues with my puppet environment, but I hadn’t released in a while and there where some pull requests which I accepted a while back. So this release is mostly pull requests and support for Debian 8 to!

The change log for this release:

  • Pass manage_repo and zabbix_repo to repo.pp and prevent double include #110 (By pull request: mmerfort (Thanks!))
  • Add “eno” to interface name matching #104 (By pull request: sgnl05 (Thanks!))
  • use the new puppetlabs-apt version 2.x module #103 (By pull request: hmn (Thanks!))
  • Fix name startvmwarecollector -> startvmwarecollectors #102 (By pull request: BcTpe4HbIu (Thanks!))
  • Custom apache IP and port #99 (By pull request: mschuett (Thanks!))
  • Feature Request: add charset/collate option during a mysql db resource creation #107
  • Added support Debian 8
  • Fixed some rpsec tests
  • Fixed some puppet-lint identation warnings
  • Updated the zabbixapi gem install with recent versions

The “#<NUM>” is a reference to an Github issue. The release can now also be found on and downloaded from the forge.

If you find an bug or have an improvement for this Zabbix puppet module, please create pull requests!

wdijkerman-zabbix version 1.5.0 puppet module released; not puppet 4 compliant yet, but it can automatically install Zabbix Templates!

Puppet LogoZabbix Logo

I just released an new version of the wdijkerman-zabbix puppet module: 1.5.0.

I had hoped to make this release puppet 4 compliant, but when I was investigating this I found that most of the modules that the wdijkerman-zabbix module is depending on isn’t puppet 4 compliant yet. With puppet 4, the only issue I encountered so far is related to the puppetlabs-apache module (It restarts the apache service before all files are present in the conf.d directory).

With this release you can automatically install Zabbix Templates! You need to use the define ‘zabbix::template’ and specify where the XML can be found and the template will be installed.

The changelog for this release:

  • Fix for: Inherting params #93
  • Fix for: new postgresql instance #91; Also update metadata for postgresl module version
  • Fix for: Need to overide php_values #89
  • 2nd fix for: Zabbix-proxy install database population #62. Also for postgresql now.
  • Added support to Amazon Linux with epel 6. #96 (By pull request: Wprosdocimo (Thanks!))
  • import templates and create hostgroup if missing #95 (By pull request: 1n (Thanks!))
  • Added Support For Zapache monitoring script #94 (By pull request: elricsfate (Thanks!))
  • merge of hiera hashes from entire hierarchy #98 (By pull request: szemlyanoy (Thanks!))
  • Added property script_ext for: File extensions of Userparameters scripts #97
  • Updated documentation in README.md

The “#<NUM>” is a reference to an Github issue. The release can now also be found on and downloaded from the forge.

If you find an bug or have an improvement for this Zabbix puppet module, please create pull requests!