This is a go server that implements the zabbix sender protocol [1] [2].
It listens on two ports:
- TCP port 10051 to listen to zabbix_sender requests.
- HTTP
/metrics
port 2112 to expose the Prometheus metrics.
The server is configured by a metrics.json
file that contains the allowed zabbix metrics. All zabbix_sender
requests received by the server that have a matching entry in metrics.json
will be exposed via the /metrics
interface on port 2112. All other metrics will be ignored.
The metrics.json
file is an array of metrics that will be accepted by the server. Each metric supports the following arguments:
zabbix_key
: (mandatory) key name sent by the zabbix client. It corresponds to thekey name
defined in this document. Theparameters
section (including the square brackets) must not appear in this field.metric
: (optional) the name of the metric as exposed by the Prometheus client. If not defined, it will default tozabbix_<sanitized_key_name>
(where thesanitized_key_name
is thekey_name
after replacing all.
occurrences with_
).help
: (optional) help string for the metric exposed by the Prometheus client.args
: (optional) array of parameters as defined in this document. If defined the zabbix client must send the metric with theparameters
(including the square bracket) otherwise it will be skipped. This arguments will be defined as labels in the Prometheus metrics.
- The only metric kind currently supported is a GaugeVec.
- All values are parsed as float64.
- The Clock value for a trapper item is ignored.
- By design it only supports trapper items.
processed_requests
: (counter) total number of processed zabbix_sender requestsinvalid_requests
: (counter) total number of invalid zabbix_sender requestsprocessed_trapper_items
: (counter) total number of processed trapper itemsskipped_trapper_items
: (counter) total number of skipped trapper items
- Add configuration file / cli parameters: zabbix host, port, zabbix server port, metrics json file path, etc.
- Add a cache for unknown metrics in order to expose them via internal prometheus metrics.
- Better logging.