mirror of
https://github.com/zabbix/zabbix-docker.git
synced 2024-11-22 15:53:35 +01:00
Added README.md files
This commit is contained in:
parent
0618ea2ca2
commit
ab60301da6
@ -68,8 +68,8 @@ WORKDIR /var/lib/zabbix
|
||||
VOLUME ["/etc/zabbix/zabbix_agentd.d", "/var/lib/zabbix/enc", "/var/lib/zabbix/modules"]
|
||||
|
||||
ADD conf/etc/supervisor/ /etc/supervisor/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "agentd", "none"]
|
||||
CMD ["/run_zabbix_component.sh", "agentd", "none"]
|
||||
|
206
agent/alpine/README.md
Normal file
206
agent/alpine/README.md
Normal file
@ -0,0 +1,206 @@
|
||||
![logo](http://www.zabbix.com/ru/img/logo/zabbix_logo_500x131.png)
|
||||
|
||||
# What is Zabbix?
|
||||
|
||||
Zabbix is an enterprise-class open source distributed monitoring solution.
|
||||
|
||||
Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.
|
||||
|
||||
For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com
|
||||
|
||||
# What is Zabbix agent?
|
||||
|
||||
Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications (hard drives, memory, processor statistics etc).
|
||||
|
||||
# Zabbix agent images
|
||||
|
||||
These are the only official Zabbix agent Docker images. They are based on latest Alpine and trusty Ubuntu images. The available versions of Zabbix agent are:
|
||||
|
||||
Zabbix agent 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, alpine-latest, ubuntu-latest, latest)
|
||||
Zabbix agent 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*)
|
||||
Zabbix agent 3.1 (tags: alpine-trunk, ubuntu-trunk)
|
||||
|
||||
Images are updated when new releases are published. The image with ``latest`` tag is based on Alpine Linux.
|
||||
|
||||
# How to use this image
|
||||
|
||||
## Start `zabbix-agent`
|
||||
|
||||
Start a Zabbix agent container as follows:
|
||||
|
||||
docker run --name some-zabbix-agent -e ZBX_HOSTNAME=some-hostname -e ZBX_SERVER_HOST=some-zabbix-server -d zabbix/zabbix-agent:tag
|
||||
|
||||
Where `some-zabbix-agent` is the name you want to assign to your container, `some-hostname` is the hostname, it is Hostname parameter in Zabbix agent configuration file, `some-zabbix-server` is IP or DNS name of Zabbix server or proxy and `tag` is the tag specifying the version you want. See the list above for relevant tags, or look at the [full list of tags](https://hub.docker.com/r/zabbix/zabbix-agent/tags/).
|
||||
|
||||
## Connects from Zabbix server or Zabbix proxy in other containers
|
||||
|
||||
This image exposes the standard Zabbix agent port (10050) to perform passive checks, so container linking makes Zabbix agent instance available to Zabbix server and Zabbix proxy containers. Start your application container like this in order to link it to the Zabbix agent container:
|
||||
|
||||
```console
|
||||
$ docker run --name some-zabbix-server --link some-zabbix-agent:zabbix-agent -d zabbix/zabbix-server:latest
|
||||
```
|
||||
|
||||
## Connect to Zabbix server or Zabbix proxy containers
|
||||
|
||||
This image supports perform active checks, so container linking makes Zabbix server and Zabbix proxy containers available to Zabbix agent instance. Start your application container like this in order to link Zabbix agent to Zabbix server or Zabbix proxy containterns:
|
||||
|
||||
```console
|
||||
$ docker run --name some-zabbix-agent --link some-zabbix-server:zabbix-server -d zabbix/zabbix-agent:latest
|
||||
```
|
||||
|
||||
## Container shell access and viewing Zabbix agent logs
|
||||
|
||||
The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `zabbix-agent` container:
|
||||
|
||||
```console
|
||||
$ docker exec -ti some-zabbix-agent /bin/bash/
|
||||
```
|
||||
|
||||
The Zabbix agent log is available through Docker's container log:
|
||||
|
||||
```console
|
||||
$ docker logs some-zabbix-agent
|
||||
```
|
||||
|
||||
## Privileged mode
|
||||
|
||||
By default, Docker containers are "unprivileged" and do not have access to the most of host resources. Zabbix agent is designed to monitor system resources, to do that Zabbix agent container must be privileged or you may mount some system-wide volumes. For example:
|
||||
|
||||
```console
|
||||
$ docker run --name some-zabbix-agent --link some-zabbix-server:zabbix-server --privileged -d zabbix/zabbix-agent:latest
|
||||
```
|
||||
```console
|
||||
$ docker run --name some-zabbix-agent --link some-zabbix-server:zabbix-server -v /dev/sdc:/dev/sdc -d zabbix/zabbix-agent:latest
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
When you start the `zabbix-agent` image, you can adjust the configuration of the Zabbix agent by passing one or more environment variables on the `docker run` command line.
|
||||
|
||||
### `ZBX_HOSTNAME`
|
||||
|
||||
This variable is unique, case sensitive hostname. By default, value is `hostname` of the container. It is ``Hostname`` parameter in zabbix_agentd.conf.
|
||||
|
||||
### `ZBX_SERVER_HOST`
|
||||
|
||||
This variable is IP or DNS name of Zabbix server or Zabbix proxy. By default, value is `zabbix-server`. It is ``Server`` parameter in ``zabbix_agentd.conf``. It is allowed to specify Zabbix server or Zabbix proxy port number using ``ZBX_SERVER_PORT`` variable. It make sense in case of non-default port for active checks.
|
||||
|
||||
### `ZBX_PASSIVE_ALLOW`
|
||||
|
||||
This variable is boolean (``true`` or ``false``) and enables or disables feature of passive checks. By default, value is `true`.
|
||||
|
||||
### `ZBX_PASSIVESERVERS`
|
||||
|
||||
The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent container.
|
||||
|
||||
### `ZBX_ACTIVE_ALLOW`
|
||||
|
||||
This variable is boolean (``true`` or ``false``) and enables or disables feature of active checks. By default, value is `true`.
|
||||
|
||||
### `ZBX_ACTIVESERVERS`
|
||||
|
||||
The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent container. You may specify port of Zabbix server or Zabbix proxy in such syntax: ``zabbix-server:10061,zabbix-proxy:10072``.
|
||||
|
||||
### `ZBX_LOADMODULE`
|
||||
|
||||
The variable is list of comma separated loadable Zabbix modules. It works with volume ``/var/lib/zabbix/modules``. The syntax of the variable is ``dummy1.so,dummy2.so``.
|
||||
|
||||
### ``ZBX_DEBUGLEVEL``
|
||||
|
||||
The variable is used to specify debug level. By default, value is ``3``. Allowed values are ``0`` - basic information about starting and stopping of Zabbix processes, ``1`` - critical information,``2`` - error information,``3`` - warnings,``4`` - for debugging (produces lots of information), ``5`` - extended debugging (produces even more information). It is ``DebugLevel`` parameter in zabbix_agentd.conf.
|
||||
|
||||
### ``ZBX_TIMEOUT``
|
||||
|
||||
The variable is used to specify timeout for processing checks. By default, value is ``3``.
|
||||
|
||||
### Other variables
|
||||
|
||||
Additionally the image allows to specify many other environment variables listed below:
|
||||
|
||||
```
|
||||
ZBX_ENABLEREMOTECOMMANDS=0
|
||||
ZBX_LOGREMOTECOMMANDS=0
|
||||
ZBX_STARTAGENTS=3
|
||||
ZBX_HOSTNAMEITEM=system.hostname
|
||||
ZBX_METADATA=
|
||||
ZBX_METADATAITEM=
|
||||
ZBX_REFRESHACTIVECHECKS=120
|
||||
ZBX_BUFFERSEND=5
|
||||
ZBX_BUFFERSIZE=100
|
||||
ZBX_MAXLINESPERSECOND=20
|
||||
ZBX_UNSAFEUSERPARAMETERS=0
|
||||
ZBX_TLSCONNECT=unencrypted
|
||||
ZBX_TLSACCEPT=unencrypted
|
||||
ZBX_TLSCAFILE=
|
||||
ZBX_TLSCRLFILE=
|
||||
ZBX_TLSSERVERCERTISSUER=
|
||||
ZBX_TLSSERVERCERTSUBJECT=
|
||||
ZBX_TLSCERTFILE=
|
||||
ZBX_TLSKEYFILE=
|
||||
ZBX_TLSPSKIDENTITY=
|
||||
ZBX_TLSPSKFILE=
|
||||
```
|
||||
|
||||
Default values of these variables are specified after equal sign.
|
||||
|
||||
The allowed variables are identical of parameters in official ``zabbix_agentd.conf``. For example, ``ZBX_REFRESHACTIVECHECKS`` = ``RefreshActiveChecks``.
|
||||
|
||||
Please use official documentation for [`zabbix_agentd.conf`](https://www.zabbix.com/documentation/3.0/manual/appendix/config/zabbix_agentd) to get more information about the variables.
|
||||
|
||||
## Allowed volumes for the Zabbix agent container
|
||||
|
||||
### ``/etc/zabbix/zabbix_agentd.d``
|
||||
|
||||
The volume allows include ``*.conf`` files and extend Zabbix agent using ``UserParameter`` feature.
|
||||
|
||||
### ``/var/lib/zabbix/modules``
|
||||
|
||||
The volume allows load additional modules and extend Zabbix agent using ``LoadModule`` feature.
|
||||
|
||||
### ``/var/lib/zabbix/enc``
|
||||
|
||||
The volume is used to store TLS related files. These file names are specified using ``ZBX_TLSCAFILE``, ``ZBX_TLSCRLFILE``, ``ZBX_TLSKEY_FILE`` and ``ZBX_TLSPSKFILE`` variables.
|
||||
|
||||
# The image variants
|
||||
|
||||
The `zabbix-agent` images come in many flavors, each designed for a specific use case.
|
||||
|
||||
## `zabbix-agent:ubuntu-<version>`
|
||||
|
||||
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
|
||||
|
||||
## `zabbix-agent:alpine-<version>`
|
||||
|
||||
This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
|
||||
|
||||
This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use [musl libc](http://www.musl-libc.org) instead of [glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
|
||||
|
||||
To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).
|
||||
|
||||
# Supported Docker versions
|
||||
|
||||
This image is officially supported on Docker version 1.12.0.
|
||||
|
||||
Support for older versions (down to 1.6) is provided on a best-effort basis.
|
||||
|
||||
Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon.
|
||||
|
||||
# User Feedback
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation for this image is stored in the [`agent/` directory](https://github.com/zabbix/zabbix-docker/tree/3.0/agent) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/master/README.md) before attempting a pull request.
|
||||
|
||||
## Issues
|
||||
|
||||
If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues).
|
||||
|
||||
### Known issues
|
||||
|
||||
Currently it is not allowed to specify ``ZBX_ALIAS`` environment variable.
|
||||
|
||||
## Contributing
|
||||
|
||||
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
|
||||
|
||||
Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -83,8 +83,8 @@ WORKDIR /var/lib/zabbix
|
||||
VOLUME ["/etc/zabbix/zabbix_agentd.d", "/var/lib/zabbix/enc", "/var/lib/zabbix/modules"]
|
||||
|
||||
ADD conf/etc/supervisor/ /etc/supervisor/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "agentd", "none"]
|
||||
CMD ["/run_zabbix_component.sh", "agentd", "none"]
|
||||
|
206
agent/ubuntu/README.md
Normal file
206
agent/ubuntu/README.md
Normal file
@ -0,0 +1,206 @@
|
||||
![logo](http://www.zabbix.com/ru/img/logo/zabbix_logo_500x131.png)
|
||||
|
||||
# What is Zabbix?
|
||||
|
||||
Zabbix is an enterprise-class open source distributed monitoring solution.
|
||||
|
||||
Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.
|
||||
|
||||
For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com
|
||||
|
||||
# What is Zabbix agent?
|
||||
|
||||
Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications (hard drives, memory, processor statistics etc).
|
||||
|
||||
# Zabbix agent images
|
||||
|
||||
These are the only official Zabbix agent Docker images. They are based on latest Alpine and trusty Ubuntu images. The available versions of Zabbix agent are:
|
||||
|
||||
Zabbix agent 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, alpine-latest, ubuntu-latest, latest)
|
||||
Zabbix agent 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*)
|
||||
Zabbix agent 3.1 (tags: alpine-trunk, ubuntu-trunk)
|
||||
|
||||
Images are updated when new releases are published. The image with ``latest`` tag is based on Alpine Linux.
|
||||
|
||||
# How to use this image
|
||||
|
||||
## Start `zabbix-agent`
|
||||
|
||||
Start a Zabbix agent container as follows:
|
||||
|
||||
docker run --name some-zabbix-agent -e ZBX_HOSTNAME=some-hostname -e ZBX_SERVER_HOST=some-zabbix-server -d zabbix/zabbix-agent:tag
|
||||
|
||||
Where `some-zabbix-agent` is the name you want to assign to your container, `some-hostname` is the hostname, it is Hostname parameter in Zabbix agent configuration file, `some-zabbix-server` is IP or DNS name of Zabbix server or proxy and `tag` is the tag specifying the version you want. See the list above for relevant tags, or look at the [full list of tags](https://hub.docker.com/r/zabbix/zabbix-agent/tags/).
|
||||
|
||||
## Connects from Zabbix server or Zabbix proxy in other containers
|
||||
|
||||
This image exposes the standard Zabbix agent port (10050) to perform passive checks, so container linking makes Zabbix agent instance available to Zabbix server and Zabbix proxy containers. Start your application container like this in order to link it to the Zabbix agent container:
|
||||
|
||||
```console
|
||||
$ docker run --name some-zabbix-server --link some-zabbix-agent:zabbix-agent -d zabbix/zabbix-server:latest
|
||||
```
|
||||
|
||||
## Connect to Zabbix server or Zabbix proxy containers
|
||||
|
||||
This image supports perform active checks, so container linking makes Zabbix server and Zabbix proxy containers available to Zabbix agent instance. Start your application container like this in order to link Zabbix agent to Zabbix server or Zabbix proxy containterns:
|
||||
|
||||
```console
|
||||
$ docker run --name some-zabbix-agent --link some-zabbix-server:zabbix-server -d zabbix/zabbix-agent:latest
|
||||
```
|
||||
|
||||
## Container shell access and viewing Zabbix agent logs
|
||||
|
||||
The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `zabbix-agent` container:
|
||||
|
||||
```console
|
||||
$ docker exec -ti some-zabbix-agent /bin/bash/
|
||||
```
|
||||
|
||||
The Zabbix agent log is available through Docker's container log:
|
||||
|
||||
```console
|
||||
$ docker logs some-zabbix-agent
|
||||
```
|
||||
|
||||
## Privileged mode
|
||||
|
||||
By default, Docker containers are "unprivileged" and do not have access to the most of host resources. Zabbix agent is designed to monitor system resources, to do that Zabbix agent container must be privileged or you may mount some system-wide volumes. For example:
|
||||
|
||||
```console
|
||||
$ docker run --name some-zabbix-agent --link some-zabbix-server:zabbix-server --privileged -d zabbix/zabbix-agent:latest
|
||||
```
|
||||
```console
|
||||
$ docker run --name some-zabbix-agent --link some-zabbix-server:zabbix-server -v /dev/sdc:/dev/sdc -d zabbix/zabbix-agent:latest
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
When you start the `zabbix-agent` image, you can adjust the configuration of the Zabbix agent by passing one or more environment variables on the `docker run` command line.
|
||||
|
||||
### `ZBX_HOSTNAME`
|
||||
|
||||
This variable is unique, case sensitive hostname. By default, value is `hostname` of the container. It is ``Hostname`` parameter in zabbix_agentd.conf.
|
||||
|
||||
### `ZBX_SERVER_HOST`
|
||||
|
||||
This variable is IP or DNS name of Zabbix server or Zabbix proxy. By default, value is `zabbix-server`. It is ``Server`` parameter in ``zabbix_agentd.conf``. It is allowed to specify Zabbix server or Zabbix proxy port number using ``ZBX_SERVER_PORT`` variable. It make sense in case of non-default port for active checks.
|
||||
|
||||
### `ZBX_PASSIVE_ALLOW`
|
||||
|
||||
This variable is boolean (``true`` or ``false``) and enables or disables feature of passive checks. By default, value is `true`.
|
||||
|
||||
### `ZBX_PASSIVESERVERS`
|
||||
|
||||
The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent container.
|
||||
|
||||
### `ZBX_ACTIVE_ALLOW`
|
||||
|
||||
This variable is boolean (``true`` or ``false``) and enables or disables feature of active checks. By default, value is `true`.
|
||||
|
||||
### `ZBX_ACTIVESERVERS`
|
||||
|
||||
The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent container. You may specify port of Zabbix server or Zabbix proxy in such syntax: ``zabbix-server:10061,zabbix-proxy:10072``.
|
||||
|
||||
### `ZBX_LOADMODULE`
|
||||
|
||||
The variable is list of comma separated loadable Zabbix modules. It works with volume ``/var/lib/zabbix/modules``. The syntax of the variable is ``dummy1.so,dummy2.so``.
|
||||
|
||||
### ``ZBX_DEBUGLEVEL``
|
||||
|
||||
The variable is used to specify debug level. By default, value is ``3``. Allowed values are ``0`` - basic information about starting and stopping of Zabbix processes, ``1`` - critical information,``2`` - error information,``3`` - warnings,``4`` - for debugging (produces lots of information), ``5`` - extended debugging (produces even more information). It is ``DebugLevel`` parameter in zabbix_agentd.conf.
|
||||
|
||||
### ``ZBX_TIMEOUT``
|
||||
|
||||
The variable is used to specify timeout for processing checks. By default, value is ``3``.
|
||||
|
||||
### Other variables
|
||||
|
||||
Additionally the image allows to specify many other environment variables listed below:
|
||||
|
||||
```
|
||||
ZBX_ENABLEREMOTECOMMANDS=0
|
||||
ZBX_LOGREMOTECOMMANDS=0
|
||||
ZBX_STARTAGENTS=3
|
||||
ZBX_HOSTNAMEITEM=system.hostname
|
||||
ZBX_METADATA=
|
||||
ZBX_METADATAITEM=
|
||||
ZBX_REFRESHACTIVECHECKS=120
|
||||
ZBX_BUFFERSEND=5
|
||||
ZBX_BUFFERSIZE=100
|
||||
ZBX_MAXLINESPERSECOND=20
|
||||
ZBX_UNSAFEUSERPARAMETERS=0
|
||||
ZBX_TLSCONNECT=unencrypted
|
||||
ZBX_TLSACCEPT=unencrypted
|
||||
ZBX_TLSCAFILE=
|
||||
ZBX_TLSCRLFILE=
|
||||
ZBX_TLSSERVERCERTISSUER=
|
||||
ZBX_TLSSERVERCERTSUBJECT=
|
||||
ZBX_TLSCERTFILE=
|
||||
ZBX_TLSKEYFILE=
|
||||
ZBX_TLSPSKIDENTITY=
|
||||
ZBX_TLSPSKFILE=
|
||||
```
|
||||
|
||||
Default values of these variables are specified after equal sign.
|
||||
|
||||
The allowed variables are identical of parameters in official ``zabbix_agentd.conf``. For example, ``ZBX_REFRESHACTIVECHECKS`` = ``RefreshActiveChecks``.
|
||||
|
||||
Please use official documentation for [`zabbix_agentd.conf`](https://www.zabbix.com/documentation/3.0/manual/appendix/config/zabbix_agentd) to get more information about the variables.
|
||||
|
||||
## Allowed volumes for the Zabbix agent container
|
||||
|
||||
### ``/etc/zabbix/zabbix_agentd.d``
|
||||
|
||||
The volume allows include ``*.conf`` files and extend Zabbix agent using ``UserParameter`` feature.
|
||||
|
||||
### ``/var/lib/zabbix/modules``
|
||||
|
||||
The volume allows load additional modules and extend Zabbix agent using ``LoadModule`` feature.
|
||||
|
||||
### ``/var/lib/zabbix/enc``
|
||||
|
||||
The volume is used to store TLS related files. These file names are specified using ``ZBX_TLSCAFILE``, ``ZBX_TLSCRLFILE``, ``ZBX_TLSKEY_FILE`` and ``ZBX_TLSPSKFILE`` variables.
|
||||
|
||||
# The image variants
|
||||
|
||||
The `zabbix-agent` images come in many flavors, each designed for a specific use case.
|
||||
|
||||
## `zabbix-agent:ubuntu-<version>`
|
||||
|
||||
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
|
||||
|
||||
## `zabbix-agent:alpine-<version>`
|
||||
|
||||
This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
|
||||
|
||||
This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use [musl libc](http://www.musl-libc.org) instead of [glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
|
||||
|
||||
To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).
|
||||
|
||||
# Supported Docker versions
|
||||
|
||||
This image is officially supported on Docker version 1.12.0.
|
||||
|
||||
Support for older versions (down to 1.6) is provided on a best-effort basis.
|
||||
|
||||
Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon.
|
||||
|
||||
# User Feedback
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation for this image is stored in the [`agent/` directory](https://github.com/zabbix/zabbix-docker/tree/3.0/agent) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/master/README.md) before attempting a pull request.
|
||||
|
||||
## Issues
|
||||
|
||||
If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues).
|
||||
|
||||
### Known issues
|
||||
|
||||
Currently it is not allowed to specify ``ZBX_ALIAS`` environment variable.
|
||||
|
||||
## Contributing
|
||||
|
||||
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
|
||||
|
||||
Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -64,8 +64,8 @@ WORKDIR /usr/sbin/zabbix_java/
|
||||
ADD conf/etc/supervisor/ /etc/supervisor/
|
||||
ADD conf/etc/zabbix/zabbix_java_gateway_logback.xml /etc/zabbix/
|
||||
ADD conf/usr/sbin/zabbix_java_gateway /usr/sbin/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "java-gateway", "none"]
|
||||
CMD ["/run_zabbix_component.sh", "java-gateway", "none"]
|
||||
|
109
java-gateway/alpine/README.md
Normal file
109
java-gateway/alpine/README.md
Normal file
@ -0,0 +1,109 @@
|
||||
![logo](http://www.zabbix.com/ru/img/logo/zabbix_logo_500x131.png)
|
||||
|
||||
# What is Zabbix?
|
||||
|
||||
Zabbix is an enterprise-class open source distributed monitoring solution.
|
||||
|
||||
Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.
|
||||
|
||||
For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com
|
||||
|
||||
# What is Zabbix Java Gateway?
|
||||
|
||||
Zabbix Java Gateway performs native support for monitoring JMX applications. Java gateway accepts incoming connection from Zabbix server or Zabbix proxy and can only be used as a "passive proxy".
|
||||
|
||||
# Zabbix Java Gateway images
|
||||
|
||||
These are the only official Zabbix Java Gateway Docker images. They are based on latest Alpine and trusty Ubuntu images. The available versions of Zabbix Java Gateway are:
|
||||
|
||||
Zabbix Java Gateway 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, alpine-latest, ubuntu-latest, latest)
|
||||
Zabbix Java Gateway 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*)
|
||||
Zabbix Java Gateway 3.1 (tags: alpine-trunk, ubuntu-trunk)
|
||||
|
||||
Images are updated when new releases are published. The image with ``latest`` tag is based on Alpine Linux.
|
||||
|
||||
# How to use this image
|
||||
|
||||
## Start `zabbix-java-gateway`
|
||||
|
||||
Start a Zabbix web-interface container as follows:
|
||||
|
||||
docker run --name some-zabbix-java-gateway -d zabbix/zabbix-java-gateway:tag
|
||||
|
||||
Where `some-zabbix-java-gateway` is the name you want to assign to your container and `tag` is the tag specifying the version you want. See the list above for relevant tags, or look at the [full list of tags](https://hub.docker.com/r/zabbix/zabbix-java-gateway/tags/).
|
||||
|
||||
## Linking the container to Zabbix server or Zabbix proxy
|
||||
|
||||
docker run --name some-zabbix-java-gateway --link some-zabbix-server:zabbix-server -d zabbix/zabbix-java-gateway:tag
|
||||
|
||||
## Container shell access and viewing Zabbix Java Gateway logs
|
||||
|
||||
The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `zabbix-java-gateway` container:
|
||||
|
||||
```console
|
||||
$ docker exec -ti some-zabbix-java-gateway /bin/bash/
|
||||
```
|
||||
|
||||
The Zabbix Java Gateway log is available through Docker's container log:
|
||||
|
||||
```console
|
||||
$ docker logs some-zabbix-java-gateway
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
When you start the `zabbix-java-gateway` image, you can adjust the configuration of the Zabbix Java Gateway by passing one or more environment variables on the `docker run` command line.
|
||||
|
||||
### `ZBX_START_POLLERS`
|
||||
|
||||
This variable is specified amount of pollers. By default, value is `5`.
|
||||
|
||||
### `ZBX_TIMEOUT`
|
||||
|
||||
This variable is used to specify timeout for outgoing connections. By default, value is `3`.
|
||||
|
||||
### ``ZBX_DEBUGLEVEL``
|
||||
|
||||
This variable is used to specify log level. By default, value is `info`. The variable allows next values: ``trace``, ``debug``, ``info``, ``want``, ``error``, ``all``, ``off``
|
||||
|
||||
# The image variants
|
||||
|
||||
The `zabbix-java-gateway` images come in many flavors, each designed for a specific use case.
|
||||
|
||||
## `zabbix-java-gateway:ubuntu-<version>`
|
||||
|
||||
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
|
||||
|
||||
## `zabbix-java-gateway:alpine-<version>`
|
||||
|
||||
This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
|
||||
|
||||
This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use [musl libc](http://www.musl-libc.org) instead of [glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
|
||||
|
||||
To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).
|
||||
|
||||
# Supported Docker versions
|
||||
|
||||
This image is officially supported on Docker version 1.12.0.
|
||||
|
||||
Support for older versions (down to 1.6) is provided on a best-effort basis.
|
||||
|
||||
Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon.
|
||||
|
||||
# User Feedback
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation for this image is stored in the [`java-gateway/` directory](https://github.com/zabbix/zabbix-docker/tree/3.0/java-gateway) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/master/README.md) before attempting a pull request.
|
||||
|
||||
## Issues
|
||||
|
||||
If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues).
|
||||
|
||||
### Known issues
|
||||
|
||||
## Contributing
|
||||
|
||||
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
|
||||
|
||||
Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -79,8 +79,8 @@ WORKDIR /usr/sbin/zabbix_java/
|
||||
ADD conf/etc/supervisor/ /etc/supervisor/
|
||||
ADD conf/etc/zabbix/zabbix_java_gateway_logback.xml /etc/zabbix/
|
||||
ADD conf/usr/sbin/zabbix_java_gateway /usr/sbin/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "java-gateway", "none"]
|
||||
CMD ["/run_zabbix_component.sh", "java-gateway", "none"]
|
||||
|
109
java-gateway/ubuntu/README.md
Normal file
109
java-gateway/ubuntu/README.md
Normal file
@ -0,0 +1,109 @@
|
||||
![logo](http://www.zabbix.com/ru/img/logo/zabbix_logo_500x131.png)
|
||||
|
||||
# What is Zabbix?
|
||||
|
||||
Zabbix is an enterprise-class open source distributed monitoring solution.
|
||||
|
||||
Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.
|
||||
|
||||
For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com
|
||||
|
||||
# What is Zabbix Java Gateway?
|
||||
|
||||
Zabbix Java Gateway performs native support for monitoring JMX applications. Java gateway accepts incoming connection from Zabbix server or Zabbix proxy and can only be used as a "passive proxy".
|
||||
|
||||
# Zabbix Java Gateway images
|
||||
|
||||
These are the only official Zabbix Java Gateway Docker images. They are based on latest Alpine and trusty Ubuntu images. The available versions of Zabbix Java Gateway are:
|
||||
|
||||
Zabbix Java Gateway 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, alpine-latest, ubuntu-latest, latest)
|
||||
Zabbix Java Gateway 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*)
|
||||
Zabbix Java Gateway 3.1 (tags: alpine-trunk, ubuntu-trunk)
|
||||
|
||||
Images are updated when new releases are published. The image with ``latest`` tag is based on Alpine Linux.
|
||||
|
||||
# How to use this image
|
||||
|
||||
## Start `zabbix-java-gateway`
|
||||
|
||||
Start a Zabbix web-interface container as follows:
|
||||
|
||||
docker run --name some-zabbix-java-gateway -d zabbix/zabbix-java-gateway:tag
|
||||
|
||||
Where `some-zabbix-java-gateway` is the name you want to assign to your container and `tag` is the tag specifying the version you want. See the list above for relevant tags, or look at the [full list of tags](https://hub.docker.com/r/zabbix/zabbix-java-gateway/tags/).
|
||||
|
||||
## Linking the container to Zabbix server or Zabbix proxy
|
||||
|
||||
docker run --name some-zabbix-java-gateway --link some-zabbix-server:zabbix-server -d zabbix/zabbix-java-gateway:tag
|
||||
|
||||
## Container shell access and viewing Zabbix Java Gateway logs
|
||||
|
||||
The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `zabbix-java-gateway` container:
|
||||
|
||||
```console
|
||||
$ docker exec -ti some-zabbix-java-gateway /bin/bash/
|
||||
```
|
||||
|
||||
The Zabbix Java Gateway log is available through Docker's container log:
|
||||
|
||||
```console
|
||||
$ docker logs some-zabbix-java-gateway
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
When you start the `zabbix-java-gateway` image, you can adjust the configuration of the Zabbix Java Gateway by passing one or more environment variables on the `docker run` command line.
|
||||
|
||||
### `ZBX_START_POLLERS`
|
||||
|
||||
This variable is specified amount of pollers. By default, value is `5`.
|
||||
|
||||
### `ZBX_TIMEOUT`
|
||||
|
||||
This variable is used to specify timeout for outgoing connections. By default, value is `3`.
|
||||
|
||||
### ``ZBX_DEBUGLEVEL``
|
||||
|
||||
This variable is used to specify log level. By default, value is `info`. The variable allows next values: ``trace``, ``debug``, ``info``, ``want``, ``error``, ``all``, ``off``
|
||||
|
||||
# The image variants
|
||||
|
||||
The `zabbix-java-gateway` images come in many flavors, each designed for a specific use case.
|
||||
|
||||
## `zabbix-java-gateway:ubuntu-<version>`
|
||||
|
||||
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
|
||||
|
||||
## `zabbix-java-gateway:alpine-<version>`
|
||||
|
||||
This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
|
||||
|
||||
This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use [musl libc](http://www.musl-libc.org) instead of [glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
|
||||
|
||||
To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).
|
||||
|
||||
# Supported Docker versions
|
||||
|
||||
This image is officially supported on Docker version 1.12.0.
|
||||
|
||||
Support for older versions (down to 1.6) is provided on a best-effort basis.
|
||||
|
||||
Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon.
|
||||
|
||||
# User Feedback
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation for this image is stored in the [`java-gateway/` directory](https://github.com/zabbix/zabbix-docker/tree/3.0/java-gateway) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/master/README.md) before attempting a pull request.
|
||||
|
||||
## Issues
|
||||
|
||||
If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues).
|
||||
|
||||
### Known issues
|
||||
|
||||
## Contributing
|
||||
|
||||
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
|
||||
|
||||
Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -106,8 +106,8 @@ VOLUME ["/usr/lib/zabbix/externalscripts", "/var/lib/zabbix/enc", "/var/lib/zabb
|
||||
VOLUME ["/var/lib/zabbix/ssl/certs", "/var/lib/zabbix/ssl/keys", "/var/lib/zabbix/ssl/ssl_ca", "/var/lib/zabbix/snmptraps", "/var/lib/zabbix/mibs"]
|
||||
|
||||
ADD conf/etc/supervisor/ /etc/supervisor/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "proxy", "mysql"]
|
||||
CMD ["/run_zabbix_component.sh", "proxy", "mysql"]
|
||||
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -128,8 +128,8 @@ VOLUME ["/usr/lib/zabbix/externalscripts", "/var/lib/zabbix/enc", "/var/lib/zabb
|
||||
VOLUME ["/var/lib/zabbix/ssl/certs", "/var/lib/zabbix/ssl/keys", "/var/lib/zabbix/ssl/ssl_ca", "/var/lib/zabbix/snmptraps", "/var/lib/zabbix/mibs"]
|
||||
|
||||
ADD conf/etc/supervisor/ /etc/supervisor/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "proxy", "mysql"]
|
||||
CMD ["/run_zabbix_component.sh", "proxy", "mysql"]
|
||||
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -101,8 +101,8 @@ VOLUME ["/usr/lib/zabbix/externalscripts", "/var/lib/zabbix/enc", "/var/lib/zabb
|
||||
VOLUME ["/var/lib/zabbix/ssl/certs", "/var/lib/zabbix/ssl/keys", "/var/lib/zabbix/ssl/ssl_ca", "/var/lib/zabbix/snmptraps", "/var/lib/zabbix/mibs"]
|
||||
|
||||
ADD conf/etc/supervisor/ /etc/supervisor/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "proxy", "sqlite3"]
|
||||
CMD ["/run_zabbix_component.sh", "proxy", "sqlite3"]
|
||||
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -125,8 +125,8 @@ VOLUME ["/usr/lib/zabbix/externalscripts", "/var/lib/zabbix/enc", "/var/lib/zabb
|
||||
VOLUME ["/var/lib/zabbix/ssl/certs", "/var/lib/zabbix/ssl/keys", "/var/lib/zabbix/ssl/ssl_ca", "/var/lib/zabbix/snmptraps", "/var/lib/zabbix/mibs"]
|
||||
|
||||
ADD conf/etc/supervisor/ /etc/supervisor/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "proxy", "sqlite3"]
|
||||
CMD ["/run_zabbix_component.sh", "proxy", "sqlite3"]
|
||||
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -109,8 +109,8 @@ VOLUME ["/usr/lib/zabbix/alertscripts", "/usr/lib/zabbix/externalscripts", "/var
|
||||
VOLUME ["/var/lib/zabbix/ssl/certs", "/var/lib/zabbix/ssl/keys", "/var/lib/zabbix/ssl/ssl_ca", "/var/lib/zabbix/snmptraps", "/var/lib/zabbix/mibs"]
|
||||
|
||||
ADD conf/etc/supervisor/ /etc/supervisor/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "server", "mysql"]
|
||||
CMD ["/run_zabbix_component.sh", "server", "mysql"]
|
||||
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -131,8 +131,8 @@ VOLUME ["/usr/lib/zabbix/alertscripts", "/usr/lib/zabbix/externalscripts", "/var
|
||||
VOLUME ["/var/lib/zabbix/ssl/certs", "/var/lib/zabbix/ssl/keys", "/var/lib/zabbix/ssl/ssl_ca", "/var/lib/zabbix/snmptraps", "/var/lib/zabbix/mibs"]
|
||||
|
||||
ADD conf/etc/supervisor/ /etc/supervisor/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "server", "mysql"]
|
||||
CMD ["/run_zabbix_component.sh", "server", "mysql"]
|
||||
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -109,8 +109,8 @@ VOLUME ["/usr/lib/zabbix/alertscripts", "/usr/lib/zabbix/externalscripts", "/var
|
||||
VOLUME ["/var/lib/zabbix/ssl/certs", "/var/lib/zabbix/ssl/keys", "/var/lib/zabbix/ssl/ssl_ca", "/var/lib/zabbix/snmptraps", "/var/lib/zabbix/mibs"]
|
||||
|
||||
ADD conf/etc/supervisor/ /etc/supervisor/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "server", "postgresql"]
|
||||
CMD ["/run_zabbix_component.sh", "server", "postgresql"]
|
||||
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -131,8 +131,8 @@ VOLUME ["/usr/lib/zabbix/alertscripts", "/usr/lib/zabbix/externalscripts", "/var
|
||||
VOLUME ["/var/lib/zabbix/ssl/certs", "/var/lib/zabbix/ssl/keys", "/var/lib/zabbix/ssl/ssl_ca", "/var/lib/zabbix/snmptraps", "/var/lib/zabbix/mibs"]
|
||||
|
||||
ADD conf/etc/supervisor/ /etc/supervisor/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "server", "postgresql"]
|
||||
CMD ["/run_zabbix_component.sh", "server", "postgresql"]
|
||||
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -73,8 +73,8 @@ ADD conf/etc/zabbix/apache.conf /etc/zabbix/
|
||||
ADD conf/etc/zabbix/apache_ssl.conf /etc/zabbix/
|
||||
ADD conf/etc/zabbix/web/zabbix.conf.php /etc/zabbix/web/
|
||||
ADD conf/etc/php5/conf.d/99-zabbix.ini /etc/php5/conf.d/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "frontend", "mysql", "apache"]
|
||||
CMD ["/run_zabbix_component.sh", "frontend", "mysql", "apache"]
|
||||
|
166
web-apache-mysql/alpine/README.md
Normal file
166
web-apache-mysql/alpine/README.md
Normal file
@ -0,0 +1,166 @@
|
||||
![logo](http://www.zabbix.com/ru/img/logo/zabbix_logo_500x131.png)
|
||||
|
||||
# What is Zabbix?
|
||||
|
||||
Zabbix is an enterprise-class open source distributed monitoring solution.
|
||||
|
||||
Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.
|
||||
|
||||
For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com
|
||||
|
||||
# What is Zabbix web interface?
|
||||
|
||||
Zabbix web interface is a part of Zabbix software. It is used to manage resources under monitoring and view monitoring statistics.
|
||||
|
||||
# Zabbix web interface images
|
||||
|
||||
These are the only official Zabbix web interface Docker images. They are based on latest Alpine and trusty Ubuntu images. The available versions of Zabbix web interface are:
|
||||
|
||||
Zabbix web interface 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, alpine-latest, ubuntu-latest, latest)
|
||||
Zabbix web interface 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*)
|
||||
Zabbix web interface 3.1 (tags: alpine-trunk, ubuntu-trunk)
|
||||
|
||||
Images are updated when new releases are published. The image with ``latest`` tag is based on Alpine Linux.
|
||||
|
||||
Zabbix web interface available in three editions:
|
||||
- Zabbix web-interface based on Apache web server with MySQL database support
|
||||
- Zabbix web-interface based on Nginx web server with MySQL database support
|
||||
- Zabbix web-interface based on Nginx web server with PostgreSQL database support
|
||||
|
||||
# How to use this image
|
||||
|
||||
## Start `zabbix-web-apache-mysql`
|
||||
|
||||
Start a Zabbix web-interface container as follows:
|
||||
|
||||
docker run --name some-zabbix-web-apache-mysql -e MYSQL_USER="some-user" -e MYSQL_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-apache-mysql:tag
|
||||
|
||||
Where `some-zabbix-web-apache-mysql` is the name you want to assign to your container, `some-user` is user to connect to Zabbix database on MySQL server, `some-password` is the password to connect to MySQL server, `some-zabbix-server` is IP or DNS name of Zabbix server or proxy, `some-timezone` is PHP like timezone name and `tag` is the tag specifying the version you want. See the list above for relevant tags, or look at the [full list of tags](https://hub.docker.com/r/zabbix/zabbix-web-apache-mysql/tags/).
|
||||
|
||||
## Linking the container to Zabbix server
|
||||
|
||||
docker run --name some-zabbix-web-apache-mysql --link some-zabbix-server:zabbix-server -e MYSQL_USER="some-user" -e MYSQL_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-apache-mysql:tag
|
||||
|
||||
## Linking the container to MySQL database
|
||||
|
||||
docker run --name some-zabbix-web-apache-mysql --link some-mysql-server:mysql -e MYSQL_USER="some-user" -e MYSQL_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-apache-mysql:tag
|
||||
|
||||
## Container shell access and viewing Zabbix web interface logs
|
||||
|
||||
The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `zabbix-web-apache-mysql` container:
|
||||
|
||||
```console
|
||||
$ docker exec -ti some-zabbix-web-apache-mysql /bin/bash/
|
||||
```
|
||||
|
||||
The Zabbix web interface log is available through Docker's container log:
|
||||
|
||||
```console
|
||||
$ docker logs some-zabbix-web-apache-mysql
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
When you start the `zabbix-web-apache-mysql` image, you can adjust the configuration of the Zabbix web interface by passing one or more environment variables on the `docker run` command line.
|
||||
|
||||
### `ZBX_SERVER_HOST`
|
||||
|
||||
This variable is IP or DNS name of Zabbix server. By default, value is `zabbix-server`.
|
||||
|
||||
### `ZBX_SERVER_PORT`
|
||||
|
||||
This variable is port Zabbix server listening on. By default, value is `10051`.
|
||||
|
||||
### ``DB_SERVER_HOST``
|
||||
|
||||
This variable is IP or DNS name of MySQL server. By default, value is 'mysql-server'
|
||||
|
||||
### ``DB_SERVER_PORT``
|
||||
|
||||
This variable is port of MySQL server. By default, value is '3306'.
|
||||
|
||||
### `MYSQL_USER`, `MYSQL_PASSWORD`
|
||||
|
||||
These variables are used by Zabbix web interface to connect to Zabbix database. By default, values are `zabbix`, `zabbix`.
|
||||
|
||||
### `MYSQL_DATABASE`
|
||||
|
||||
The variable is Zabbix database name. By default, value is `zabbix`.
|
||||
|
||||
### `TZ`
|
||||
|
||||
The variable is timezone in PHP format. Full list of supported timezones are available on [`php.net`](http://php.net/manual/en/timezones.php). By default, value is 'Europe/Riga'.
|
||||
|
||||
### `ZBX_SERVER_NAME`
|
||||
|
||||
The variable is visible Zabbix installation name in right top corner of the web interface.
|
||||
|
||||
### `ZBX_MAXEXECUTIONTIME`
|
||||
|
||||
The varable is PHP ``max_execution_time`` option. By default, value is `300`.
|
||||
|
||||
### `ZBX_MEMORYLIMIT`
|
||||
|
||||
The varable is PHP ``memory_limit`` option. By default, value is `128M`.
|
||||
|
||||
### `ZBX_POSTMAXSIZE`
|
||||
|
||||
The varable is PHP ``post_max_size`` option. By default, value is `16M`.
|
||||
|
||||
### `ZBX_UPLOADMAXFILESIZE`
|
||||
|
||||
The varable is PHP ``upload_max_filesize`` option. By default, value is `2M`.
|
||||
|
||||
### `ZBX_MAXINPUTTIME`
|
||||
|
||||
The varable is PHP ``max_input_time`` option. By default, value is `300`.
|
||||
|
||||
## Allowed volumes for the Zabbix web interface container
|
||||
|
||||
### ``/etc/ssl/apache2``
|
||||
|
||||
The volume allows to enable HTTPS for the Zabbix web interface. The volume must contains two files ``ssl.crt`` and ``ssl.key`` prepared for Apache2 SSL connections.
|
||||
|
||||
Please follow official Apache2 [documentation](https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html) to get more details about how to create certificate files.
|
||||
|
||||
# The image variants
|
||||
|
||||
The `zabbix-web-apache-mysql` images come in many flavors, each designed for a specific use case.
|
||||
|
||||
## `zabbix-web-apache-mysql:ubuntu-<version>`
|
||||
|
||||
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
|
||||
|
||||
## `zabbix-web-apache-mysql:alpine-<version>`
|
||||
|
||||
This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
|
||||
|
||||
This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use [musl libc](http://www.musl-libc.org) instead of [glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
|
||||
|
||||
To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).
|
||||
|
||||
# Supported Docker versions
|
||||
|
||||
This image is officially supported on Docker version 1.12.0.
|
||||
|
||||
Support for older versions (down to 1.6) is provided on a best-effort basis.
|
||||
|
||||
Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon.
|
||||
|
||||
# User Feedback
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation for this image is stored in the [`web-apache-mysql/` directory](https://github.com/zabbix/zabbix-docker/tree/3.0/web-apache-mysql) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/master/README.md) before attempting a pull request.
|
||||
|
||||
## Issues
|
||||
|
||||
If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues).
|
||||
|
||||
### Known issues
|
||||
|
||||
## Contributing
|
||||
|
||||
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
|
||||
|
||||
Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -92,8 +92,8 @@ ADD conf/etc/zabbix/apache.conf /etc/zabbix/
|
||||
ADD conf/etc/zabbix/apache_ssl.conf /etc/zabbix/
|
||||
ADD conf/etc/zabbix/web/zabbix.conf.php /etc/zabbix/web/
|
||||
ADD conf/etc/php5/apache2/conf.d/99-zabbix.ini /etc/php5/apache2/conf.d/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "frontend", "mysql", "apache"]
|
||||
CMD ["/run_zabbix_component.sh", "frontend", "mysql", "apache"]
|
||||
|
166
web-apache-mysql/ubuntu/README.md
Normal file
166
web-apache-mysql/ubuntu/README.md
Normal file
@ -0,0 +1,166 @@
|
||||
![logo](http://www.zabbix.com/ru/img/logo/zabbix_logo_500x131.png)
|
||||
|
||||
# What is Zabbix?
|
||||
|
||||
Zabbix is an enterprise-class open source distributed monitoring solution.
|
||||
|
||||
Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.
|
||||
|
||||
For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com
|
||||
|
||||
# What is Zabbix web interface?
|
||||
|
||||
Zabbix web interface is a part of Zabbix software. It is used to manage resources under monitoring and view monitoring statistics.
|
||||
|
||||
# Zabbix web interface images
|
||||
|
||||
These are the only official Zabbix web interface Docker images. They are based on latest Alpine and trusty Ubuntu images. The available versions of Zabbix web interface are:
|
||||
|
||||
Zabbix web interface 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, alpine-latest, ubuntu-latest, latest)
|
||||
Zabbix web interface 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*)
|
||||
Zabbix web interface 3.1 (tags: alpine-trunk, ubuntu-trunk)
|
||||
|
||||
Images are updated when new releases are published. The image with ``latest`` tag is based on Alpine Linux.
|
||||
|
||||
Zabbix web interface available in three editions:
|
||||
- Zabbix web-interface based on Apache web server with MySQL database support
|
||||
- Zabbix web-interface based on Nginx web server with MySQL database support
|
||||
- Zabbix web-interface based on Nginx web server with PostgreSQL database support
|
||||
|
||||
# How to use this image
|
||||
|
||||
## Start `zabbix-web-apache-mysql`
|
||||
|
||||
Start a Zabbix web-interface container as follows:
|
||||
|
||||
docker run --name some-zabbix-web-apache-mysql -e MYSQL_USER="some-user" -e MYSQL_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-apache-mysql:tag
|
||||
|
||||
Where `some-zabbix-web-apache-mysql` is the name you want to assign to your container, `some-user` is user to connect to Zabbix database on MySQL server, `some-password` is the password to connect to MySQL server, `some-zabbix-server` is IP or DNS name of Zabbix server or proxy, `some-timezone` is PHP like timezone name and `tag` is the tag specifying the version you want. See the list above for relevant tags, or look at the [full list of tags](https://hub.docker.com/r/zabbix/zabbix-web-apache-mysql/tags/).
|
||||
|
||||
## Linking the container to Zabbix server
|
||||
|
||||
docker run --name some-zabbix-web-apache-mysql --link some-zabbix-server:zabbix-server -e MYSQL_USER="some-user" -e MYSQL_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-apache-mysql:tag
|
||||
|
||||
## Linking the container to MySQL database
|
||||
|
||||
docker run --name some-zabbix-web-apache-mysql --link some-mysql-server:mysql -e MYSQL_USER="some-user" -e MYSQL_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-apache-mysql:tag
|
||||
|
||||
## Container shell access and viewing Zabbix web interface logs
|
||||
|
||||
The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `zabbix-web-apache-mysql` container:
|
||||
|
||||
```console
|
||||
$ docker exec -ti some-zabbix-web-apache-mysql /bin/bash/
|
||||
```
|
||||
|
||||
The Zabbix web interface log is available through Docker's container log:
|
||||
|
||||
```console
|
||||
$ docker logs some-zabbix-web-apache-mysql
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
When you start the `zabbix-web-apache-mysql` image, you can adjust the configuration of the Zabbix web interface by passing one or more environment variables on the `docker run` command line.
|
||||
|
||||
### `ZBX_SERVER_HOST`
|
||||
|
||||
This variable is IP or DNS name of Zabbix server. By default, value is `zabbix-server`.
|
||||
|
||||
### `ZBX_SERVER_PORT`
|
||||
|
||||
This variable is port Zabbix server listening on. By default, value is `10051`.
|
||||
|
||||
### ``DB_SERVER_HOST``
|
||||
|
||||
This variable is IP or DNS name of MySQL server. By default, value is 'mysql-server'
|
||||
|
||||
### ``DB_SERVER_PORT``
|
||||
|
||||
This variable is port of MySQL server. By default, value is '3306'.
|
||||
|
||||
### `MYSQL_USER`, `MYSQL_PASSWORD`
|
||||
|
||||
These variables are used by Zabbix web interface to connect to Zabbix database. By default, values are `zabbix`, `zabbix`.
|
||||
|
||||
### `MYSQL_DATABASE`
|
||||
|
||||
The variable is Zabbix database name. By default, value is `zabbix`.
|
||||
|
||||
### `TZ`
|
||||
|
||||
The variable is timezone in PHP format. Full list of supported timezones are available on [`php.net`](http://php.net/manual/en/timezones.php). By default, value is 'Europe/Riga'.
|
||||
|
||||
### `ZBX_SERVER_NAME`
|
||||
|
||||
The variable is visible Zabbix installation name in right top corner of the web interface.
|
||||
|
||||
### `ZBX_MAXEXECUTIONTIME`
|
||||
|
||||
The varable is PHP ``max_execution_time`` option. By default, value is `300`.
|
||||
|
||||
### `ZBX_MEMORYLIMIT`
|
||||
|
||||
The varable is PHP ``memory_limit`` option. By default, value is `128M`.
|
||||
|
||||
### `ZBX_POSTMAXSIZE`
|
||||
|
||||
The varable is PHP ``post_max_size`` option. By default, value is `16M`.
|
||||
|
||||
### `ZBX_UPLOADMAXFILESIZE`
|
||||
|
||||
The varable is PHP ``upload_max_filesize`` option. By default, value is `2M`.
|
||||
|
||||
### `ZBX_MAXINPUTTIME`
|
||||
|
||||
The varable is PHP ``max_input_time`` option. By default, value is `300`.
|
||||
|
||||
## Allowed volumes for the Zabbix web interface container
|
||||
|
||||
### ``/etc/ssl/apache2``
|
||||
|
||||
The volume allows to enable HTTPS for the Zabbix web interface. The volume must contains two files ``ssl.crt`` and ``ssl.key`` prepared for Apache2 SSL connections.
|
||||
|
||||
Please follow official Apache2 [documentation](https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html) to get more details about how to create certificate files.
|
||||
|
||||
# The image variants
|
||||
|
||||
The `zabbix-web-apache-mysql` images come in many flavors, each designed for a specific use case.
|
||||
|
||||
## `zabbix-web-apache-mysql:ubuntu-<version>`
|
||||
|
||||
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
|
||||
|
||||
## `zabbix-web-apache-mysql:alpine-<version>`
|
||||
|
||||
This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
|
||||
|
||||
This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use [musl libc](http://www.musl-libc.org) instead of [glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
|
||||
|
||||
To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).
|
||||
|
||||
# Supported Docker versions
|
||||
|
||||
This image is officially supported on Docker version 1.12.0.
|
||||
|
||||
Support for older versions (down to 1.6) is provided on a best-effort basis.
|
||||
|
||||
Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon.
|
||||
|
||||
# User Feedback
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation for this image is stored in the [`web-apache-mysql/` directory](https://github.com/zabbix/zabbix-docker/tree/3.0/web-apache-mysql) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/master/README.md) before attempting a pull request.
|
||||
|
||||
## Issues
|
||||
|
||||
If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues).
|
||||
|
||||
### Known issues
|
||||
|
||||
## Contributing
|
||||
|
||||
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
|
||||
|
||||
Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -74,8 +74,8 @@ ADD conf/etc/zabbix/web/zabbix.conf.php /etc/zabbix/web/
|
||||
ADD conf/etc/nginx/nginx.conf /etc/nginx/
|
||||
ADD conf/etc/php5/php-fpm.conf /etc/php5/
|
||||
ADD conf/etc/php5/conf.d/99-zabbix.ini /etc/php5/conf.d/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "frontend", "mysql", "nginx"]
|
||||
CMD ["/run_zabbix_component.sh", "frontend", "mysql", "nginx"]
|
||||
|
166
web-nginx-mysql/alpine/README.md
Normal file
166
web-nginx-mysql/alpine/README.md
Normal file
@ -0,0 +1,166 @@
|
||||
![logo](http://www.zabbix.com/ru/img/logo/zabbix_logo_500x131.png)
|
||||
|
||||
# What is Zabbix?
|
||||
|
||||
Zabbix is an enterprise-class open source distributed monitoring solution.
|
||||
|
||||
Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.
|
||||
|
||||
For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com
|
||||
|
||||
# What is Zabbix web interface?
|
||||
|
||||
Zabbix web interface is a part of Zabbix software. It is used to manage resources under monitoring and view monitoring statistics.
|
||||
|
||||
# Zabbix web interface images
|
||||
|
||||
These are the only official Zabbix web interface Docker images. They are based on latest Alpine and trusty Ubuntu images. The available versions of Zabbix web interface are:
|
||||
|
||||
Zabbix web interface 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, alpine-latest, ubuntu-latest, latest)
|
||||
Zabbix web interface 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*)
|
||||
Zabbix web interface 3.1 (tags: alpine-trunk, ubuntu-trunk)
|
||||
|
||||
Images are updated when new releases are published. The image with ``latest`` tag is based on Alpine Linux.
|
||||
|
||||
Zabbix web interface available in three editions:
|
||||
- Zabbix web-interface based on Apache web server with MySQL database support
|
||||
- Zabbix web-interface based on Nginx web server with MySQL database support
|
||||
- Zabbix web-interface based on Nginx web server with PostgreSQL database support
|
||||
|
||||
# How to use this image
|
||||
|
||||
## Start `zabbix-web-nginx-mysql`
|
||||
|
||||
Start a Zabbix web-interface container as follows:
|
||||
|
||||
docker run --name some-zabbix-web-nginx-mysql -e MYSQL_USER="some-user" -e MYSQL_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-nginx-mysql:tag
|
||||
|
||||
Where `some-zabbix-web-nginx-mysql` is the name you want to assign to your container, `some-user` is user to connect to Zabbix database on MySQL server, `some-password` is the password to connect to MySQL server, `some-zabbix-server` is IP or DNS name of Zabbix server or proxy, `some-timezone` is PHP like timezone name and `tag` is the tag specifying the version you want. See the list above for relevant tags, or look at the [full list of tags](https://hub.docker.com/r/zabbix/zabbix-web-nginx-mysql/tags/).
|
||||
|
||||
## Linking the container to Zabbix server
|
||||
|
||||
docker run --name some-zabbix-web-nginx-mysql --link some-zabbix-server:zabbix-server -e MYSQL_USER="some-user" -e MYSQL_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-nginx-mysql:tag
|
||||
|
||||
## Linking the container to MySQL database
|
||||
|
||||
docker run --name some-zabbix-web-nginx-mysql --link some-mysql-server:mysql -e MYSQL_USER="some-user" -e MYSQL_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-nginx-mysql:tag
|
||||
|
||||
## Container shell access and viewing Zabbix web interface logs
|
||||
|
||||
The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `zabbix-web-nginx-mysql` container:
|
||||
|
||||
```console
|
||||
$ docker exec -ti some-zabbix-web-nginx-mysql /bin/bash/
|
||||
```
|
||||
|
||||
The Zabbix web interface log is available through Docker's container log:
|
||||
|
||||
```console
|
||||
$ docker logs some-zabbix-web-nginx-mysql
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
When you start the `zabbix-web-nginx-mysql` image, you can adjust the configuration of the Zabbix web interface by passing one or more environment variables on the `docker run` command line.
|
||||
|
||||
### `ZBX_SERVER_HOST`
|
||||
|
||||
This variable is IP or DNS name of Zabbix server. By default, value is `zabbix-server`.
|
||||
|
||||
### `ZBX_SERVER_PORT`
|
||||
|
||||
This variable is port Zabbix server listening on. By default, value is `10051`.
|
||||
|
||||
### ``DB_SERVER_HOST``
|
||||
|
||||
This variable is IP or DNS name of MySQL server. By default, value is 'mysql-server'
|
||||
|
||||
### ``DB_SERVER_PORT``
|
||||
|
||||
This variable is port of MySQL server. By default, value is '3306'.
|
||||
|
||||
### `MYSQL_USER`, `MYSQL_PASSWORD`
|
||||
|
||||
These variables are used by Zabbix web interface to connect to Zabbix database. By default, values are `zabbix`, `zabbix`.
|
||||
|
||||
### `MYSQL_DATABASE`
|
||||
|
||||
The variable is Zabbix database name. By default, value is `zabbix`.
|
||||
|
||||
### `TZ`
|
||||
|
||||
The variable is timezone in PHP format. Full list of supported timezones are available on [`php.net`](http://php.net/manual/en/timezones.php). By default, value is 'Europe/Riga'.
|
||||
|
||||
### `ZBX_SERVER_NAME`
|
||||
|
||||
The variable is visible Zabbix installation name in right top corner of the web interface.
|
||||
|
||||
### `ZBX_MAXEXECUTIONTIME`
|
||||
|
||||
The varable is PHP ``max_execution_time`` option. By default, value is `300`.
|
||||
|
||||
### `ZBX_MEMORYLIMIT`
|
||||
|
||||
The varable is PHP ``memory_limit`` option. By default, value is `128M`.
|
||||
|
||||
### `ZBX_POSTMAXSIZE`
|
||||
|
||||
The varable is PHP ``post_max_size`` option. By default, value is `16M`.
|
||||
|
||||
### `ZBX_UPLOADMAXFILESIZE`
|
||||
|
||||
The varable is PHP ``upload_max_filesize`` option. By default, value is `2M`.
|
||||
|
||||
### `ZBX_MAXINPUTTIME`
|
||||
|
||||
The varable is PHP ``max_input_time`` option. By default, value is `300`.
|
||||
|
||||
## Allowed volumes for the Zabbix web interface container
|
||||
|
||||
### ``/etc/ssl/nginx``
|
||||
|
||||
The volume allows to enable HTTPS for the Zabbix web interface. The volume must contains two files ``ssl.crt``, ``ssl.key`` and ``dhparam.pem`` prepared for Nginx SSL connections.
|
||||
|
||||
Please follow official Nginx [documentation](http://nginx.org/en/docs/http/configuring_https_servers.html) to get more details about how to create certificate files.
|
||||
|
||||
# The image variants
|
||||
|
||||
The `zabbix-web-nginx-mysql` images come in many flavors, each designed for a specific use case.
|
||||
|
||||
## `zabbix-web-nginx-mysql:ubuntu-<version>`
|
||||
|
||||
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
|
||||
|
||||
## `zabbix-web-nginx-mysql:alpine-<version>`
|
||||
|
||||
This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
|
||||
|
||||
This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use [musl libc](http://www.musl-libc.org) instead of [glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
|
||||
|
||||
To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).
|
||||
|
||||
# Supported Docker versions
|
||||
|
||||
This image is officially supported on Docker version 1.12.0.
|
||||
|
||||
Support for older versions (down to 1.6) is provided on a best-effort basis.
|
||||
|
||||
Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon.
|
||||
|
||||
# User Feedback
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation for this image is stored in the [`web-nginx-mysql/` directory](https://github.com/zabbix/zabbix-docker/tree/3.0/web-nginx-mysql) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/master/README.md) before attempting a pull request.
|
||||
|
||||
## Issues
|
||||
|
||||
If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues).
|
||||
|
||||
### Known issues
|
||||
|
||||
## Contributing
|
||||
|
||||
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
|
||||
|
||||
Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -98,8 +98,8 @@ ADD conf/etc/zabbix/nginx_ssl.conf /etc/zabbix/
|
||||
ADD conf/etc/zabbix/web/zabbix.conf.php /etc/zabbix/web/
|
||||
ADD conf/etc/nginx/nginx.conf /etc/nginx/
|
||||
ADD conf/etc/php5/fpm/conf.d/99-zabbix.ini /etc/php5/fpm/conf.d/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "frontend", "mysql", "nginx"]
|
||||
CMD ["/run_zabbix_component.sh", "frontend", "mysql", "nginx"]
|
||||
|
166
web-nginx-mysql/ubuntu/README.md
Normal file
166
web-nginx-mysql/ubuntu/README.md
Normal file
@ -0,0 +1,166 @@
|
||||
![logo](http://www.zabbix.com/ru/img/logo/zabbix_logo_500x131.png)
|
||||
|
||||
# What is Zabbix?
|
||||
|
||||
Zabbix is an enterprise-class open source distributed monitoring solution.
|
||||
|
||||
Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.
|
||||
|
||||
For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com
|
||||
|
||||
# What is Zabbix web interface?
|
||||
|
||||
Zabbix web interface is a part of Zabbix software. It is used to manage resources under monitoring and view monitoring statistics.
|
||||
|
||||
# Zabbix web interface images
|
||||
|
||||
These are the only official Zabbix web interface Docker images. They are based on latest Alpine and trusty Ubuntu images. The available versions of Zabbix web interface are:
|
||||
|
||||
Zabbix web interface 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, alpine-latest, ubuntu-latest, latest)
|
||||
Zabbix web interface 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*)
|
||||
Zabbix web interface 3.1 (tags: alpine-trunk, ubuntu-trunk)
|
||||
|
||||
Images are updated when new releases are published. The image with ``latest`` tag is based on Alpine Linux.
|
||||
|
||||
Zabbix web interface available in three editions:
|
||||
- Zabbix web-interface based on Apache web server with MySQL database support
|
||||
- Zabbix web-interface based on Nginx web server with MySQL database support
|
||||
- Zabbix web-interface based on Nginx web server with PostgreSQL database support
|
||||
|
||||
# How to use this image
|
||||
|
||||
## Start `zabbix-web-nginx-mysql`
|
||||
|
||||
Start a Zabbix web-interface container as follows:
|
||||
|
||||
docker run --name some-zabbix-web-nginx-mysql -e MYSQL_USER="some-user" -e MYSQL_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-nginx-mysql:tag
|
||||
|
||||
Where `some-zabbix-web-nginx-mysql` is the name you want to assign to your container, `some-user` is user to connect to Zabbix database on MySQL server, `some-password` is the password to connect to MySQL server, `some-zabbix-server` is IP or DNS name of Zabbix server or proxy, `some-timezone` is PHP like timezone name and `tag` is the tag specifying the version you want. See the list above for relevant tags, or look at the [full list of tags](https://hub.docker.com/r/zabbix/zabbix-web-nginx-mysql/tags/).
|
||||
|
||||
## Linking the container to Zabbix server
|
||||
|
||||
docker run --name some-zabbix-web-nginx-mysql --link some-zabbix-server:zabbix-server -e MYSQL_USER="some-user" -e MYSQL_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-nginx-mysql:tag
|
||||
|
||||
## Linking the container to MySQL database
|
||||
|
||||
docker run --name some-zabbix-web-nginx-mysql --link some-mysql-server:mysql -e MYSQL_USER="some-user" -e MYSQL_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-nginx-mysql:tag
|
||||
|
||||
## Container shell access and viewing Zabbix web interface logs
|
||||
|
||||
The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `zabbix-web-nginx-mysql` container:
|
||||
|
||||
```console
|
||||
$ docker exec -ti some-zabbix-web-nginx-mysql /bin/bash/
|
||||
```
|
||||
|
||||
The Zabbix web interface log is available through Docker's container log:
|
||||
|
||||
```console
|
||||
$ docker logs some-zabbix-web-nginx-mysql
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
When you start the `zabbix-web-nginx-mysql` image, you can adjust the configuration of the Zabbix web interface by passing one or more environment variables on the `docker run` command line.
|
||||
|
||||
### `ZBX_SERVER_HOST`
|
||||
|
||||
This variable is IP or DNS name of Zabbix server. By default, value is `zabbix-server`.
|
||||
|
||||
### `ZBX_SERVER_PORT`
|
||||
|
||||
This variable is port Zabbix server listening on. By default, value is `10051`.
|
||||
|
||||
### ``DB_SERVER_HOST``
|
||||
|
||||
This variable is IP or DNS name of MySQL server. By default, value is 'mysql-server'
|
||||
|
||||
### ``DB_SERVER_PORT``
|
||||
|
||||
This variable is port of MySQL server. By default, value is '3306'.
|
||||
|
||||
### `MYSQL_USER`, `MYSQL_PASSWORD`
|
||||
|
||||
These variables are used by Zabbix web interface to connect to Zabbix database. By default, values are `zabbix`, `zabbix`.
|
||||
|
||||
### `MYSQL_DATABASE`
|
||||
|
||||
The variable is Zabbix database name. By default, value is `zabbix`.
|
||||
|
||||
### `TZ`
|
||||
|
||||
The variable is timezone in PHP format. Full list of supported timezones are available on [`php.net`](http://php.net/manual/en/timezones.php). By default, value is 'Europe/Riga'.
|
||||
|
||||
### `ZBX_SERVER_NAME`
|
||||
|
||||
The variable is visible Zabbix installation name in right top corner of the web interface.
|
||||
|
||||
### `ZBX_MAXEXECUTIONTIME`
|
||||
|
||||
The varable is PHP ``max_execution_time`` option. By default, value is `300`.
|
||||
|
||||
### `ZBX_MEMORYLIMIT`
|
||||
|
||||
The varable is PHP ``memory_limit`` option. By default, value is `128M`.
|
||||
|
||||
### `ZBX_POSTMAXSIZE`
|
||||
|
||||
The varable is PHP ``post_max_size`` option. By default, value is `16M`.
|
||||
|
||||
### `ZBX_UPLOADMAXFILESIZE`
|
||||
|
||||
The varable is PHP ``upload_max_filesize`` option. By default, value is `2M`.
|
||||
|
||||
### `ZBX_MAXINPUTTIME`
|
||||
|
||||
The varable is PHP ``max_input_time`` option. By default, value is `300`.
|
||||
|
||||
## Allowed volumes for the Zabbix web interface container
|
||||
|
||||
### ``/etc/ssl/nginx``
|
||||
|
||||
The volume allows to enable HTTPS for the Zabbix web interface. The volume must contains two files ``ssl.crt``, ``ssl.key`` and ``dhparam.pem`` prepared for Nginx SSL connections.
|
||||
|
||||
Please follow official Nginx [documentation](http://nginx.org/en/docs/http/configuring_https_servers.html) to get more details about how to create certificate files.
|
||||
|
||||
# The image variants
|
||||
|
||||
The `zabbix-web-nginx-mysql` images come in many flavors, each designed for a specific use case.
|
||||
|
||||
## `zabbix-web-nginx-mysql:ubuntu-<version>`
|
||||
|
||||
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
|
||||
|
||||
## `zabbix-web-nginx-mysql:alpine-<version>`
|
||||
|
||||
This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
|
||||
|
||||
This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use [musl libc](http://www.musl-libc.org) instead of [glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
|
||||
|
||||
To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).
|
||||
|
||||
# Supported Docker versions
|
||||
|
||||
This image is officially supported on Docker version 1.12.0.
|
||||
|
||||
Support for older versions (down to 1.6) is provided on a best-effort basis.
|
||||
|
||||
Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon.
|
||||
|
||||
# User Feedback
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation for this image is stored in the [`web-nginx-mysql/` directory](https://github.com/zabbix/zabbix-docker/tree/3.0/web-nginx-mysql) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/master/README.md) before attempting a pull request.
|
||||
|
||||
## Issues
|
||||
|
||||
If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues).
|
||||
|
||||
### Known issues
|
||||
|
||||
## Contributing
|
||||
|
||||
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
|
||||
|
||||
Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -73,8 +73,8 @@ ADD conf/etc/zabbix/web/zabbix.conf.php /etc/zabbix/web/
|
||||
ADD conf/etc/nginx/nginx.conf /etc/nginx/
|
||||
ADD conf/etc/php5/php-fpm.conf /etc/php5/
|
||||
ADD conf/etc/php5/conf.d/99-zabbix.ini /etc/php5/conf.d/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "frontend", "postgresql", "nginx"]
|
||||
CMD ["/run_zabbix_component.sh", "frontend", "postgresql", "nginx"]
|
||||
|
166
web-nginx-pgsql/alpine/README.md
Normal file
166
web-nginx-pgsql/alpine/README.md
Normal file
@ -0,0 +1,166 @@
|
||||
![logo](http://www.zabbix.com/ru/img/logo/zabbix_logo_500x131.png)
|
||||
|
||||
# What is Zabbix?
|
||||
|
||||
Zabbix is an enterprise-class open source distributed monitoring solution.
|
||||
|
||||
Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.
|
||||
|
||||
For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com
|
||||
|
||||
# What is Zabbix web interface?
|
||||
|
||||
Zabbix web interface is a part of Zabbix software. It is used to manage resources under monitoring and view monitoring statistics.
|
||||
|
||||
# Zabbix web interface images
|
||||
|
||||
These are the only official Zabbix web interface Docker images. They are based on latest Alpine and trusty Ubuntu images. The available versions of Zabbix web interface are:
|
||||
|
||||
Zabbix web interface 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, alpine-latest, ubuntu-latest, latest)
|
||||
Zabbix web interface 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*)
|
||||
Zabbix web interface 3.1 (tags: alpine-trunk, ubuntu-trunk)
|
||||
|
||||
Images are updated when new releases are published. The image with ``latest`` tag is based on Alpine Linux.
|
||||
|
||||
Zabbix web interface available in three editions:
|
||||
- Zabbix web-interface based on Apache web server with MySQL database support
|
||||
- Zabbix web-interface based on Nginx web server with MySQL database support
|
||||
- Zabbix web-interface based on Nginx web server with PostgreSQL database support
|
||||
|
||||
# How to use this image
|
||||
|
||||
## Start `zabbix-web-nginx-pgsql`
|
||||
|
||||
Start a Zabbix web-interface container as follows:
|
||||
|
||||
docker run --name some-zabbix-web-nginx-pgsql -e POSTGRES_USER="some-user" -e POSTGRES_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-nginx-pgsql:tag
|
||||
|
||||
Where `some-zabbix-web-nginx-pgsql` is the name you want to assign to your container, `some-user` is user to connect to Zabbix database on PostgreSQL server, `some-password` is the password to connect to PostgreSQL server, `some-zabbix-server` is IP or DNS name of Zabbix server or proxy, `some-timezone` is PHP like timezone name and `tag` is the tag specifying the version you want. See the list above for relevant tags, or look at the [full list of tags](https://hub.docker.com/r/zabbix/zabbix-web-nginx-pgsql/tags/).
|
||||
|
||||
## Linking the container to Zabbix server
|
||||
|
||||
docker run --name some-zabbix-web-nginx-pgsql --link some-zabbix-server:zabbix-server -e POSTGRES_USER="some-user" -e POSTGRES_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-nginx-pgsql:tag
|
||||
|
||||
## Linking the container to PostgreSQL database
|
||||
|
||||
docker run --name some-zabbix-web-nginx-pgsql --link some-postgres-server:postgres -e POSTGRES_USER="some-user" -e POSTGRES_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-nginx-pgsql:tag
|
||||
|
||||
## Container shell access and viewing Zabbix web interface logs
|
||||
|
||||
The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `zabbix-web-nginx-pgsql` container:
|
||||
|
||||
```console
|
||||
$ docker exec -ti some-zabbix-web-nginx-pgsql /bin/bash/
|
||||
```
|
||||
|
||||
The Zabbix web interface log is available through Docker's container log:
|
||||
|
||||
```console
|
||||
$ docker logs some-zabbix-web-nginx-pgsql
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
When you start the `zabbix-web-nginx-pgsql` image, you can adjust the configuration of the Zabbix web interface by passing one or more environment variables on the `docker run` command line.
|
||||
|
||||
### `ZBX_SERVER_HOST`
|
||||
|
||||
This variable is IP or DNS name of Zabbix server. By default, value is `zabbix-server`.
|
||||
|
||||
### `ZBX_SERVER_PORT`
|
||||
|
||||
This variable is port Zabbix server listening on. By default, value is `10051`.
|
||||
|
||||
### ``DB_SERVER_HOST``
|
||||
|
||||
This variable is IP or DNS name of PostgreSQL server. By default, value is 'postgres-server'
|
||||
|
||||
### ``DB_SERVER_PORT``
|
||||
|
||||
This variable is port of PostgreSQL server. By default, value is '5432'.
|
||||
|
||||
### `POSTGRES_USER`, `POSTGRES_PASSWORD`
|
||||
|
||||
These variables are used by Zabbix web interface to connect to Zabbix database. By default, values are `zabbix`, `zabbix`.
|
||||
|
||||
### `POSTGRES_DB`
|
||||
|
||||
The variable is Zabbix database name. By default, value is `zabbix`.
|
||||
|
||||
### `TZ`
|
||||
|
||||
The variable is timezone in PHP format. Full list of supported timezones are available on [`php.net`](http://php.net/manual/en/timezones.php). By default, value is 'Europe/Riga'.
|
||||
|
||||
### `ZBX_SERVER_NAME`
|
||||
|
||||
The variable is visible Zabbix installation name in right top corner of the web interface.
|
||||
|
||||
### `ZBX_MAXEXECUTIONTIME`
|
||||
|
||||
The varable is PHP ``max_execution_time`` option. By default, value is `300`.
|
||||
|
||||
### `ZBX_MEMORYLIMIT`
|
||||
|
||||
The varable is PHP ``memory_limit`` option. By default, value is `128M`.
|
||||
|
||||
### `ZBX_POSTMAXSIZE`
|
||||
|
||||
The varable is PHP ``post_max_size`` option. By default, value is `16M`.
|
||||
|
||||
### `ZBX_UPLOADMAXFILESIZE`
|
||||
|
||||
The varable is PHP ``upload_max_filesize`` option. By default, value is `2M`.
|
||||
|
||||
### `ZBX_MAXINPUTTIME`
|
||||
|
||||
The varable is PHP ``max_input_time`` option. By default, value is `300`.
|
||||
|
||||
## Allowed volumes for the Zabbix web interface container
|
||||
|
||||
### ``/etc/ssl/nginx``
|
||||
|
||||
The volume allows to enable HTTPS for the Zabbix web interface. The volume must contains two files ``ssl.crt``, ``ssl.key`` and ``dhparam.pem`` prepared for Nginx SSL connections.
|
||||
|
||||
Please follow official Nginx [documentation](http://nginx.org/en/docs/http/configuring_https_servers.html) to get more details about how to create certificate files.
|
||||
|
||||
# The image variants
|
||||
|
||||
The `zabbix-web-nginx-pgsql` images come in many flavors, each designed for a specific use case.
|
||||
|
||||
## `zabbix-web-nginx-pgsql:ubuntu-<version>`
|
||||
|
||||
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
|
||||
|
||||
## `zabbix-web-nginx-pgsql:alpine-<version>`
|
||||
|
||||
This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
|
||||
|
||||
This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use [musl libc](http://www.musl-libc.org) instead of [glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
|
||||
|
||||
To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).
|
||||
|
||||
# Supported Docker versions
|
||||
|
||||
This image is officially supported on Docker version 1.12.0.
|
||||
|
||||
Support for older versions (down to 1.6) is provided on a best-effort basis.
|
||||
|
||||
Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon.
|
||||
|
||||
# User Feedback
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation for this image is stored in the [`web-nginx-pgsql/` directory](https://github.com/zabbix/zabbix-docker/tree/3.0/web-nginx-pgsql) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/master/README.md) before attempting a pull request.
|
||||
|
||||
## Issues
|
||||
|
||||
If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues).
|
||||
|
||||
### Known issues
|
||||
|
||||
## Contributing
|
||||
|
||||
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
|
||||
|
||||
Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
@ -98,8 +98,8 @@ ADD conf/etc/zabbix/nginx_ssl.conf /etc/zabbix/
|
||||
ADD conf/etc/zabbix/web/zabbix.conf.php /etc/zabbix/web/
|
||||
ADD conf/etc/nginx/nginx.conf /etc/nginx/
|
||||
ADD conf/etc/php5/fpm/conf.d/99-zabbix.ini /etc/php5/fpm/conf.d/
|
||||
ADD run_zabbix_component.sh /data/
|
||||
ADD run_zabbix_component.sh /
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
CMD ["/data/run_zabbix_component.sh", "frontend", "postgresql", "nginx"]
|
||||
CMD ["/run_zabbix_component.sh", "frontend", "postgresql", "nginx"]
|
||||
|
166
web-nginx-pgsql/ubuntu/README.md
Normal file
166
web-nginx-pgsql/ubuntu/README.md
Normal file
@ -0,0 +1,166 @@
|
||||
![logo](http://www.zabbix.com/ru/img/logo/zabbix_logo_500x131.png)
|
||||
|
||||
# What is Zabbix?
|
||||
|
||||
Zabbix is an enterprise-class open source distributed monitoring solution.
|
||||
|
||||
Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.
|
||||
|
||||
For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com
|
||||
|
||||
# What is Zabbix web interface?
|
||||
|
||||
Zabbix web interface is a part of Zabbix software. It is used to manage resources under monitoring and view monitoring statistics.
|
||||
|
||||
# Zabbix web interface images
|
||||
|
||||
These are the only official Zabbix web interface Docker images. They are based on latest Alpine and trusty Ubuntu images. The available versions of Zabbix web interface are:
|
||||
|
||||
Zabbix web interface 3.0 (tags: alpine-3.0-latest, ubuntu-3.0-latest, alpine-latest, ubuntu-latest, latest)
|
||||
Zabbix web interface 3.0.* (tags: alpine-3.0.*, ubuntu-3.0.*)
|
||||
Zabbix web interface 3.1 (tags: alpine-trunk, ubuntu-trunk)
|
||||
|
||||
Images are updated when new releases are published. The image with ``latest`` tag is based on Alpine Linux.
|
||||
|
||||
Zabbix web interface available in three editions:
|
||||
- Zabbix web-interface based on Apache web server with MySQL database support
|
||||
- Zabbix web-interface based on Nginx web server with MySQL database support
|
||||
- Zabbix web-interface based on Nginx web server with PostgreSQL database support
|
||||
|
||||
# How to use this image
|
||||
|
||||
## Start `zabbix-web-nginx-pgsql`
|
||||
|
||||
Start a Zabbix web-interface container as follows:
|
||||
|
||||
docker run --name some-zabbix-web-nginx-pgsql -e POSTGRES_USER="some-user" -e POSTGRES_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-nginx-pgsql:tag
|
||||
|
||||
Where `some-zabbix-web-nginx-pgsql` is the name you want to assign to your container, `some-user` is user to connect to Zabbix database on PostgreSQL server, `some-password` is the password to connect to PostgreSQL server, `some-zabbix-server` is IP or DNS name of Zabbix server or proxy, `some-timezone` is PHP like timezone name and `tag` is the tag specifying the version you want. See the list above for relevant tags, or look at the [full list of tags](https://hub.docker.com/r/zabbix/zabbix-web-nginx-pgsql/tags/).
|
||||
|
||||
## Linking the container to Zabbix server
|
||||
|
||||
docker run --name some-zabbix-web-nginx-pgsql --link some-zabbix-server:zabbix-server -e POSTGRES_USER="some-user" -e POSTGRES_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-nginx-pgsql:tag
|
||||
|
||||
## Linking the container to PostgreSQL database
|
||||
|
||||
docker run --name some-zabbix-web-nginx-pgsql --link some-postgres-server:postgres -e POSTGRES_USER="some-user" -e POSTGRES_PASSWORD="some-password" -e ZBX_SERVER_HOST="some-zabbix-server" -e TZ="some-timezone" -d zabbix/zabbix-web-nginx-pgsql:tag
|
||||
|
||||
## Container shell access and viewing Zabbix web interface logs
|
||||
|
||||
The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `zabbix-web-nginx-pgsql` container:
|
||||
|
||||
```console
|
||||
$ docker exec -ti some-zabbix-web-nginx-pgsql /bin/bash/
|
||||
```
|
||||
|
||||
The Zabbix web interface log is available through Docker's container log:
|
||||
|
||||
```console
|
||||
$ docker logs some-zabbix-web-nginx-pgsql
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
When you start the `zabbix-web-nginx-pgsql` image, you can adjust the configuration of the Zabbix web interface by passing one or more environment variables on the `docker run` command line.
|
||||
|
||||
### `ZBX_SERVER_HOST`
|
||||
|
||||
This variable is IP or DNS name of Zabbix server. By default, value is `zabbix-server`.
|
||||
|
||||
### `ZBX_SERVER_PORT`
|
||||
|
||||
This variable is port Zabbix server listening on. By default, value is `10051`.
|
||||
|
||||
### ``DB_SERVER_HOST``
|
||||
|
||||
This variable is IP or DNS name of PostgreSQL server. By default, value is 'postgres-server'
|
||||
|
||||
### ``DB_SERVER_PORT``
|
||||
|
||||
This variable is port of PostgreSQL server. By default, value is '5432'.
|
||||
|
||||
### `POSTGRES_USER`, `POSTGRES_PASSWORD`
|
||||
|
||||
These variables are used by Zabbix web interface to connect to Zabbix database. By default, values are `zabbix`, `zabbix`.
|
||||
|
||||
### `POSTGRES_DB`
|
||||
|
||||
The variable is Zabbix database name. By default, value is `zabbix`.
|
||||
|
||||
### `TZ`
|
||||
|
||||
The variable is timezone in PHP format. Full list of supported timezones are available on [`php.net`](http://php.net/manual/en/timezones.php). By default, value is 'Europe/Riga'.
|
||||
|
||||
### `ZBX_SERVER_NAME`
|
||||
|
||||
The variable is visible Zabbix installation name in right top corner of the web interface.
|
||||
|
||||
### `ZBX_MAXEXECUTIONTIME`
|
||||
|
||||
The varable is PHP ``max_execution_time`` option. By default, value is `300`.
|
||||
|
||||
### `ZBX_MEMORYLIMIT`
|
||||
|
||||
The varable is PHP ``memory_limit`` option. By default, value is `128M`.
|
||||
|
||||
### `ZBX_POSTMAXSIZE`
|
||||
|
||||
The varable is PHP ``post_max_size`` option. By default, value is `16M`.
|
||||
|
||||
### `ZBX_UPLOADMAXFILESIZE`
|
||||
|
||||
The varable is PHP ``upload_max_filesize`` option. By default, value is `2M`.
|
||||
|
||||
### `ZBX_MAXINPUTTIME`
|
||||
|
||||
The varable is PHP ``max_input_time`` option. By default, value is `300`.
|
||||
|
||||
## Allowed volumes for the Zabbix web interface container
|
||||
|
||||
### ``/etc/ssl/nginx``
|
||||
|
||||
The volume allows to enable HTTPS for the Zabbix web interface. The volume must contains two files ``ssl.crt``, ``ssl.key`` and ``dhparam.pem`` prepared for Nginx SSL connections.
|
||||
|
||||
Please follow official Nginx [documentation](http://nginx.org/en/docs/http/configuring_https_servers.html) to get more details about how to create certificate files.
|
||||
|
||||
# The image variants
|
||||
|
||||
The `zabbix-web-nginx-pgsql` images come in many flavors, each designed for a specific use case.
|
||||
|
||||
## `zabbix-web-nginx-pgsql:ubuntu-<version>`
|
||||
|
||||
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
|
||||
|
||||
## `zabbix-web-nginx-pgsql:alpine-<version>`
|
||||
|
||||
This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
|
||||
|
||||
This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use [musl libc](http://www.musl-libc.org) instead of [glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
|
||||
|
||||
To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).
|
||||
|
||||
# Supported Docker versions
|
||||
|
||||
This image is officially supported on Docker version 1.12.0.
|
||||
|
||||
Support for older versions (down to 1.6) is provided on a best-effort basis.
|
||||
|
||||
Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon.
|
||||
|
||||
# User Feedback
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation for this image is stored in the [`web-nginx-pgsql/` directory](https://github.com/zabbix/zabbix-docker/tree/3.0/web-nginx-pgsql) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/master/README.md) before attempting a pull request.
|
||||
|
||||
## Issues
|
||||
|
||||
If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues).
|
||||
|
||||
### Known issues
|
||||
|
||||
## Contributing
|
||||
|
||||
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
|
||||
|
||||
Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
|
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
#set -o xtrace
|
||||
|
||||
if [ "${DEBUG_MODE}" == "true" ]; then
|
||||
set -o xtrace
|
||||
fi
|
||||
|
||||
# Type of Zabbix component
|
||||
# Possible values: [server, proxy, agent, web, dev]
|
||||
@ -648,6 +651,10 @@ prepare_zbx_web_config() {
|
||||
|
||||
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
|
||||
|
||||
if [ -f "/usr/share/zabbix/conf/zabbix.conf.php" ]; then
|
||||
rm -f "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
fi
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
@ -695,16 +702,16 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
|
||||
|
||||
ZBX_PASSIVE_SERVERS=${ZBX_PASSIVE_SERVERS:-""}
|
||||
ZBX_ACTIVE_SERVERS=${ZBX_ACTIVE_SERVERS:-""}
|
||||
ZBX_PASSIVESERVERS=${ZBX_PASSIVESERVERS:-""}
|
||||
ZBX_ACTIVESERVERS=${ZBX_ACTIVESERVERS:-""}
|
||||
|
||||
[ -n "$ZBX_PASSIVE_SERVERS" ] && ZBX_PASSIVE_SERVERS=","$ZBX_PASSIVE_SERVERS
|
||||
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
|
||||
|
||||
ZBX_PASSIVE_SERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVE_SERVERS
|
||||
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
|
||||
|
||||
[ -n "$ZBX_ACTIVE_SERVERS" ] && ZBX_ACTIVE_SERVERS=","$ZBX_ACTIVE_SERVERS
|
||||
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
|
||||
|
||||
ZBX_ACTIVE_SERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVE_SERVERS
|
||||
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
|
||||
|
||||
update_config_var $ZBX_AGENT_CONFIG "PidFile"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
|
||||
@ -712,13 +719,13 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
|
||||
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLE_REMOTE_COMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "EnableRemoteCommands" "${ZBX_ENABLEREMOTECOMMANDS}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
|
||||
|
||||
ZBX_PASSIVE_ALLOW=${ZBX_PASSIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_PASSIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_PASSIVE_SERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "Server"
|
||||
fi
|
||||
@ -729,8 +736,8 @@ prepare_zbx_agent_config() {
|
||||
|
||||
ZBX_ACTIVE_ALLOW=${ZBX_ACTIVE_ALLOW:-"true"}
|
||||
if [ "$ZBX_ACTIVE_ALLOW" == "true" ]; then
|
||||
echo "** Using '$ZBX_ACTIVE_SERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVE_SERVERS}"
|
||||
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
|
||||
else
|
||||
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
|
||||
fi
|
||||
@ -756,7 +763,7 @@ prepare_zbx_agent_config() {
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEY_FILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
|
||||
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user