See www.zabbix.com for the official Zabbix site.

Docs/specs/ZBXNEXT-2203

From Zabbix.org
Jump to: navigation, search

Agent should return more details if item is not supported

ZBXNEXT-2203

Status: v1.1

Owner: Alexei, Sasha

Summary

Currently Zabbix agent does not report any details in case if item becomes not supported.

Details

Zabbix agent should provide clear yet detailed error message displayed in Zabbix frontend for not supported items. The error message will be available on mouseover of red error icon in column Info of Configuration -> Hosts -> Items.

Protocol changes

Zabbix agent passive checks

  • Existing response string 'ZBX_NOTSUPPORTED' will support optional suffix 'ZBX_NOTSUPPORTED\0<Error message>'.
  • If response from Zabbix agent starts with 'ZBX_NOTSUPPORTED\0' then Zabbix server/proxy will treat the item as not supported.
  • The '\0' is a single byte having value 0 used to terminate ZBX_NOTSUPPORTED string

Zabbix agent active checks

  • Existing JSON response will support optional tag 'state' similarly to existing proxy-server protocol.
  • If 'state' value is equal to 1 (ITEM_STATE_NOTSUPPORTED) then Zabbix server/proxy will treat the item as not supported. In this case 'value' will contain error message.

Example:

{
       "host":"<hostname>",
       "key":"abc",
       "value":"Unsupported item key.",
       "state":"1",
       "clock":1252926015
}

Zabbix server-proxy communication

No changes required.

Zabbix Get

There will be no changes for zabbix_get. The error message will be displayed as is:

 ZBX_NOTSUPPORTED: <error messages>

For example:

  ./zabbix_get -s 127.0.0.1 -k "vfs.file"
 ZBX_NOTSUPPORTED: Unsupported item key.

With older agents it will work as before:

./zabbix_get -s 127.0.0.1 -k "vfs.file"
 ZBX_NOTSUPPORTED

Core libs

Existing function zbx_tcp_recv_ext(&s, &buf, ZBX_TCP_READ_UNTIL_CLOSE, 0) will be simplified by removing second parameter. Received buffer can be retrieved from zbx_sock_t structure.

Database changes

Maximum size of existing field items.error will be increased to 2048 characters.

Compatibility

  • New agent will work perfectly fine with older versions of server/proxy

Standard error messages

The following messages will be used:

 Invalid number of parameters.       # We expect N parameters but got M parameters.
 Invalid first/second/... parameter. # Value of the parameter does not match our expectations.
 Too many parameters.                # We expect N parameters but got more than N parameters.

Documentation

  • What's new in 2.4
  • Zabbix Protocols

ChangeLog

  • v1.1
    • Added list of standard error messages

Also discussed

Support of sending of not supported items by zabbix_sender is out of scope of this development.