Trapper items accept incoming data instead of querying for it.
It is useful for any data you might want to "push" into Zabbix.
To use a trapper item you must:
To configure a trapper item:
The fields that require specific information for trapper items are:
Type | Select Zabbix trapper here. |
Key | Enter a key that will be used to recognize the item when sending in data. |
Type of information | Select the type of information that will correspond the format of data that will be sent in. |
Allowed hosts | If specified, the trapper will accept incoming data only from this comma-delimited list of hosts. Hosts are identified by IP address/DNS name. For example: Single IP: 192.168.1.33 List of IP addresses: 192.168.56.5, 192.168.56.6, 192.168.56.7 Single DNS name: testzabbix.zabbix.com List of DNS names: testzabbix, testzabbix.zabbix.com, testzabbix1.zabbix.com Spaces and user macros are allowed in this field since Zabbix 2.2.0. |
You may have to wait up to 60 seconds after saving the item until the server picks up the changes from a configuration cache update, before you can send in values.
In the simplest of cases, we may use zabbix_sender utility to send in some 'test value':
To send in the value we use these keys:
-z - to specify Zabbix server IP address
-p - to specify Zabbix server port number (10051 by default)
-s - to specify the host (make sure to use the 'technical' host name here, instead of the 'visible' name)
-k - to specify the key of the item we just defined
-o - to specify the actual value to send
Zabbix trapper process does not expand macros used in the item key in attempt to check corresponding item key existence for targeted host.
This is the result in Monitoring → Latest data:
Note that if a single numeric value is sent in, the data graph will show a horizontal line to the left and to the right of the time point of the value.
If values are sent using zabbix_sender
from a file with timestamps, then these timestamps will be adjusted to match server time. For instance, if an item's timestamp is "10:30:50", the current time on zabbix_sender
's machine is "10:40:03", and the current time on Zabbix server's machine is "10:40:05", then the item's value will be stored in the database with a timestamp of "10:30:52".
Similarly, if a value is first sent to Zabbix proxy, which later sends it to Zabbix server, the timestamp will be first adjusted to match Zabbix proxy time, and then it will be adjusted to match Zabbix server time.