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

Docs/specs/ZBXNEXT-1368

From Zabbix.org
Jump to: navigation, search

Windows service discovery

ZBXNEXT-1368

Status: Initial draft

Owner: Igors Homjakovs

Summary

Currently, there are two items available for monitoring of Windows services. First item, service_state[service], checks the status of a service and returns one of the following values:

0 - running
1 - paused
2 - start pending
3 - pause pending
4 - continue pending
5 - stop pending
6 - stopped
7 - unknown
255 - no such service 	

A real service name, or a name of EXE file, has to be specified as the item key.

Second available item, services[<type>,<state>,<exclude>], returns a list of services. Using item keys a user can specify which list to output:

type - all, automatic, manual or disabled;
state - all, stopped, started, start_pending, stop_pending, running, continue_pending, pause_pending or paused;
exclude - list of services to exclude from the result.

At the moment there is no straightforward way to check if a certain service is running properly or not. Sometimes it is troublesome to acquire the names of services running on a host. To do that user has to log in on a server to figure out their exact names.

Windows service discovery would allow to get the list of services, e.g. automatically started, and use prototypes to define items and triggers for each service's state. Services of interests can be filtered using regexp discovery filters.

Specification

Low-level discovery item service.discovery will be added to discover Windows services.

The format of discovered entities is as follows:

  {
    "{#SERVICE.NAME}":"Name",
    "{#SERVICE.DISPLAYNAME}":"Display name",
    "{#SERVICE.DESCRIPTION}":"Description"
    "{#SERVICE.STATE}":"0|1|2|3|4|5|6|7",
    "{#SERVICE.STATENAME}":"running|paused|start pending|pause pending|continue pending|stop pending|stopped|unknown",
    "{#SERVICE.PATH}":"C:\\path\\to\\executable.exe -args",
    "{#SERVICE.USER}":"localSystem",
    "{#SERVICE.STARTUP}":"0|1|2|3|4"
    "{#SERVICE.STARTUPNAME}":"automatic|automatic delayed|manual|disabled|unknown"
  }

In order to access service information a new item service.info[service, param] will be added, where param field can accept the following: displayname, state, path, user, startup or description. The default parameter is state if parameter value is not specified (service.info[service]).

The item service_state[service] will return the same information as service.info[service, state] item. In future releases service_state[service] item can be removed.

A new value map "Windows service startup type" will be added to map to numerical values of startup parameter in the frontend to appropriate text representation:

0 - Automatic
1 - Automatic delayed
2 - Manual
3 - Disabled
4 - Unknown

Documentation

Update "Low-level discovery" section:

https://www.zabbix.com/documentation/3.0/manual/discovery/low_level_discovery

Add new supported macros:

https://www.zabbix.com/documentation/3.0/manual/appendix/macros/supported_by_location

Add new service.info[service, param] item and mention that the service_state item is deprecated:

https://www.zabbix.com/documentation/3.0/manual/config/items/itemtypes/zabbix_agent/win_keys

Update "What's new" section:

https://www.zabbix.com/documentation/3.0/manual/introduction/whatsnew300

Update "Upgrade notes" section (mention that the service_state item is deprecated):

https://www.zabbix.com/documentation/3.0/manual/installation/upgrade_notes_300

Update SQL script page with new value maps:

https://www.zabbix.org/wiki/Zabbix_Templates/SQLs_for_Official_Templates

Update developer documentation on service items:

https://www.zabbix.org/wiki/Docs/Developer_documentation

Add the templates that have been changed:

http://zabbix.org/wiki/Zabbix_Templates/Official_Templates

ChangeLog

  • Added discovery rule service.discovery for windows service discovery
  • Added new item service.info[name, param]