Zabbix Code Guidelines

3.04.04.45.0 (current)| In development:5.2 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


Sidebar

doc:error

Error messages

Error messages in Zabbix should follow these guidelines.

Frontend and API
  • The error message should mention the invalid value that triggered the error. Exceptions are values that can be too long or aren't human-readable such as integer values or boolean flags.

Wording

  • Messages that state that some action cannot be performed should start with “Cannot”. For example:
Cannot delete item.
  • Messages that state that some value is invalid should use the word “Incorrect”. For example:
Incorrect status for item "%itemName%".

Referencing objects

  • An error was triggered by a specific object it must be mentioned in the message. For example:
Incorrect expression "%expression%" for trigger "%triggerName%".
  • If an object cannot be uniquely referenced by one name (for example, there can be items with the same name on different hosts) the message must provide a more detailed reference:
Incorrect key "%key%" for item "%itemName%" on host "%hostName%".

When referencing a host or template its visible name must be used.

Server
  • Zabbix error messages about items (from the agent and other sources) start with “Cannot obtain”, for example:
Cannot obtain number of CPUs.
  • Invalid parameters are denoted just by their placement, without specifying valid suggested/valid values, for example:
Invalid first parameter. 

Such an approach reduces maintenance effort.

Syntax and glossary

The error messages must respect the common syntax and naming guidelines.