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

Docs/Developer documentation

From Zabbix.org
Jump to: navigation, search

Developer notes

This page is intended to collect notes on what a new developer might be interested in.

Windows specific

proc_info implementation

Requesting information on a process is done on a process handle. A process handle is requested from operating system with desired access rights. Starting with Windows Vista (major version 6) Microsoft introduced new access right called PROCESS_QUERY_LIMITED_INFORMATION and since then that must be used in order to retrieve information supported by proc_info item.

  • before: OpenProcess() was always called with PROCESS_QUERY_INFORMATION desired access, which caused "access denied" on newer versions of Windows
  • since Zabbix 2.2.9, 2.4.4: OpenProcess() is called with PROCESS_QUERY_INFORMATION on older versions of Windows (up to, including Windows XP and Server 2003) and PROCESS_QUERY_LIMITED_INFORMATION on newer versions

More information:

proc.num implementation

Before Zabbix 2.2.9, 2.4.4 Zabbix agent used method EnumProcesses() to get a list of running process IDs. If there was a process name filter, OpenProcess() call was issued on each process ID to get process handle. After that process name (executable) would be requested from that handle. A handle maybe requested with different access level. We were requesting a handle with PROCESS_QUERY_INFORMATION and PROCESS_VM_READ access rights. This was actually not needed and resulted in "access denied" in many cases and incorrect number of running processes reported by Zabbix agent.

In Zabbix 2.2.9, 2.4.4 we decided to use another method of getting a list of running processes, CreateToolhelp32Snapshot(). This method allows getting the list of all running processes along with process names (executables). This in turn allows skipping unnecessary calls to OpenProcess(), which gave errors before.

OpenProcess() is still called if a user name is specified in proc.num, e. g. proc.num[zabbix_agentd.exe,administrator].

More information:

Executing scripts

Zabbix can execute scripts/commands in the following locations:

  • External checks
  • Alert scripts
  • User parameters
  • Remote commands (system.run)
  • Global scripts

Zabbix frontend

MVC-related

Setting a new filter to be used in the system.view widget since Zabbix 3.0.

Acknowledgements

Acknowledgements can be disabled in the Administration -> General -> GUI section. This affects the following places:

  • Monitoring -> Dashboard, Last 20 issues widget -> Ack column
  • Monitoring -> Dashboard -> Last 20 issues widget -> Issue column (on hover in popup another Ack column)
  • Monitoring -> Dashboard -> System status widget -> on problem hover popup column Ack
  • Monitoring -> Dashboard configuration -> Problem display
  • Monitoring -> Overview -> Data -> cell
  • Monitoring -> Overview -> Triggers -> cell
  • Monitoring -> Triggers -> Filter -> Acknowledge status
  • Monitoring -> Triggers -> Filter -> Events -> Show unacknowledged (7 days)
  • Monitoring -> Triggers -> Ack column
  • Monitoring -> Events -> Ack column
  • Monitoring -> Event details -> Ack widget
  • Monitoring -> Event details -> Event list [previous 20] -> Ack column
  • Monitoring/Configuration -> Screens -> Screen element -> Data overview -> cell
  • Monitoring/Configuration -> Screens -> Screen element -> Triggers overview -> cell
  • Monitoring/Configuration -> Screens -> Screen element -> Host group issues -> Ack column
  • Monitoring/Configuration -> Screens -> Screen element -> Host group issues -> Issue column (on hover in popup another Ack column)
  • Monitoring/Configuration -> Screens -> Screen element -> Host issues -> Ack column
  • Monitoring/Configuration -> Screens -> Screen element -> Host issues -> Issue column (on hover in popup another Ack column)
  • Configuration -> Maps -> Problem display

Disabling acknowledgements does not affect the following places:

  • Configuration -> Actions -> Operations -> Action operations -> Conditions -> Operation condition
  • Monitoring -> Triggers -> Alarm acknowledgements page

Timestamp handling

Zabbix handles and assigns timestamps between agent/server/proxy/sender in a specific manner. The full description should be probably moved here, until then see this issue comment.