What is a Zabbix Trapper, and how can you send data to Zabbix from a bash script?
Asked at
AI answer
A Zabbix trapper is an item type that accepts values sent by an external system or script. Unlike regular polling, the server does not request this item itself: the sender transmits the value to the Zabbix server or proxy, usually on port 10051.
Create an item on the host with the Zabbix trapper type, set its key, and make sure the host name in the command matches the host’s technical name in Zabbix. Then send a value using zabbix_sender:
#!/usr/bin/env bash
set -euo pipefail
zabbix_sender -z zabbix.example.org -p 10051 \
-s "host-name-in-Zabbix" -k app.queue.size -o 42
To send values from a file, you can use zabbix_sender -i file. If a value is not accepted, check the host name, key, item type, server/proxy availability, and access settings for trapper data.
Also asked at RWB
- Why did you decide to change jobs / leave your current company?
- What is the key difference between TCP and UDP?
- What is the difference between git merge and git rebase? When should each approach be used?
- What is an inode in Linux?
- Which command is used to determine the route of a packet from your device to the target host?
Similar questions
- What is a Zabbix agent, and how does it work?
- How does Prometheus’s model differ from Zabbix’s model (push and pull models)?
- How does an exporter work in Prometheus monitoring? What role does it play, and where does it get its metrics?
- In your opinion, what is the best setup for production alerting and monitoring?
- What is an exit code, and how can you find out what it is?