There are a few ways one can gather custom metrics with Zabbix, for example, via user parameters or Zabbix sender protocol. While either method can work for simple metrics, creating a more wholesome approach (with data collectors, persistent connections etc) and interfacing it with Zabbix may not be as trivial.
With the HTTP agent item Zabbix can natively connect to RESTful web services, but the new pre-processing options, “Check for error” and the “Custom on fail”, take it a big step further. This allows us to create web services that can be directly used by Zabbix. To demonstrate we will create a very simple MySQL monitoring web service, returning the number of active and maximum connections.