A Short Tutorial With ZABBIX Running in Docker and Python
- Docker https://www.docker.com/
- ZABBIX https://www.zabbix.com/
- ZABBIX already provides docker images https://hub.docker.com/u/zabbix/
- You should start the Docker container running the following command:
docker-compose -f docker-compose-local.yml up
You can then access the ZABBIX Web Frontend (user: Admin pwd: zabbix) http://localhost:8081 - Make sure that the ZABBIX server entails the right configuration
- You need to have the host configured (see ZABBIX docs)
- Host name: my.local.sender
- Groups: Templates/Applications
- Agent interfaces: keep original configuration
- You need to have at least the Trapper item configured (see ZABBIX docs)
- Name: Trapper item
- Type: Zabbix trapper
- Type of information: Numeric unsigned
- You need to have the host configured (see ZABBIX docs)
- (Optional) Create a python virtualenv
virtualenv -p python3 ./venv
- Install the python requirements
pip install -r requirements.txt
- Start the zabbix_client
python zabbix_client/__init__.py
- You should then receive a message like this:
{"processed": 1, "failed": 0, "total": 1, "time": "0.000140", "chunk": 1}
- In the ZABBIX Web Interface you can then see the latest events
- You can then play a bit with the sender and send different integer values and visualize them in a graph
- If you get
{"processed": 0, "failed": 1, "total": 1, "time": "0.000140", "chunk": 1}
check your server configuration!
Maybe it's possible to provision the ZABBIX server in order to avoid manual configuration which is error prone. Therefore, the api could be used.