This is an old repository that is no longer used or maintained. We advice to no longer use this repository.
This formula automatically installs required client-side scripts and configurations for Zabbix-Agent based on defined states and services in your statefiles.
Pull requests for added monitoring scripts and bug fixes are more than welcome.
Include monitoring
in your project. It will auto-detect states and services and include the appropriate zabbix-agent scripts.
It's highly recommended to use this in conjunction with the Zabbix-Formula.
There is no configuration required for the agent-side, it will automatically take care of this.
Some modules may require additional configuration, please refer to the README.md
in the subfolders.
In case the auto-detection does not pick up particular services you can specify them in a pillar:
monitoring:
roles:
- redis
- docker
Each monitoring component has its own template you need to import into your Zabbix environment for these checks to work.
In the monitoring
folder a new folder with the service name should be created.
It's structure should be:
files/autodiscovery.sh # Autodiscovery script (optional). Can have any name, but must be explicitly configured as such.
files/check.sh # Checks script. Can have any name, but must be explicitly configured as such.
files/params.conf # Params file to install into Zabbix Agent configuration
init.sls # Monitoring Module configuration
template.xml # Zabbix Template
The init.sls
file contains configuration of the monitoring-module:
{%- set service_name = 'SERVICENAME' %}
{%- set has_autodiscovery = True %}
{%- set has_check = True %}
{% include "monitoring/install_check.jinja" %}
The following variables are available for the init.sls
and are used by install_check.jinja
:
service_name
: Service to check (e.g. phpfpm)has_autodiscovery
: Boolean whether there is autodiscovery for this module. Defaults toFalse
autodiscovery_file
: Filename to use as autodiscovery template. Defaults toautodiscovery.sh
but can also be changed to Python, go etc.has_check
: Boolean whether there is autodiscovery for this module. Defaults toFalse
check_file
: Filename to use as check template. Defaults tocheck.sh
but can also be changed to Python, go etc.params_file
: Filename to use as parameters-file template. Defaults toparams.conf
This file can also be used to install specific dependencies for the monitoring submodule (e.g. python-docker for monitoring Docker) using the default Saltstack syntax.
- Remove the
data
keys for all discoveries - De-duplicate repeated code (e.g. in generating JSON structures)