Using zorka with Zabbix

Zabbix was the first and remains primary monitoring system Zorka integrates with. Zorka uses native zabbix protocol and can work in both standard and active mode.

Zabbix can treat it as regular zabbix agent or as zabbix trap generator. Zabbix protocol is enabled by default but administrator has to set zabbix server IP address and port (if there are more than one monitored java application on a server):

zabbix.server.addr = 127.0.0.1,<server-address>
zabbix.listen.port = 10056

At this point after starting application administrator can use zabbix_get command to query zorka agent manually, for example:

$ zabbix_get -s 127.0.0.1 -p 10056 -k 'zorka.ls["java", "java.lang:*"]'

Zabbix active agent

Note that this is fresh functionality and it needs to be tested. Zabbix Active Agent protocol allows for tracking more data with less overhead. In active mode agent periodically queries zabbix server for item list and sends data in batches. As active mode is fairly fresh feature, it is disabled by default. In order to enable active mode, set the following properties:

zabbix.active = yes

Then configuring zabbix active agent, ensure that agent hostname (zorka.hostname property) exactly matches host name configured in zabbix.

How zabbix queries are processed

Agent translates zabbix queries to BSH function calls and executes them. Reqults are converted to string and returned. If function returns null or error occurs ZBX_NOTSUPPORTED is returned and zabbix will mark item as not supported. For example:

zorka.jmx["java","java.lang:type=OperatingSystem","Arch"]

is equivalent to beanshell call:

zorka.jmx("java","java.lang:type=OperatingSystem","Arch");

If there is some item that might be no available at all times, administrator might have to return some known value (eg. 0) instead of nulls using helper function.

Zabbix related config options

  • zabbix = yes - this setting controls whether Zorka should work as zabbix agent (serving zabbix agent protocol on some address:port); zabbix protocol is the only one supported at the moment;

  • zabbix.listen.addr = 127.0.0.1 - listen address for zabbix integration;

  • zabbix.listen.port = 10055 - port zabbix agent will listen on;

  • zabbix.server.addr = 127.0.0.1 - zabbix server address; agent will accept connections only from this server; multiple addresses separated by comma can be added here;

Active checks related options

  • zabbix.active = no - enables zabbix active agent;

  • zabbix.active.batch.size = 10 - maximum number of metrics sent every sender cycle;

  • zabbix.active.cache.size = 150 - maximum number of collected metrics awaiting to be sent to zabbix server;

  • zabbix.active.check.interval = 120 - defines how often agent will query zabbix server for metrics to check;

  • zabbix.active.message.size = 16384 - maximum size of data messages sent to zabbix server;

  • zabbix.active.sender.interval = 60 - defines how often collected metrics will be sent sent to zabbix server;

  • zabbix.active.server.addr = ${zabbix.server.addr} - zabbix server address for handling active requests; typically this is the same as zabbix.server.addr, so no need for changing this setting in most cases;