Setup zabbix30 agent » Historie » Version 2
Jeremias Keihsler, 12.02.2019 12:42
1 | 1 | Jeremias Keihsler | h1. Setup Zabbix 3.0 agent on Microsoft Windows |
---|---|---|---|
2 | |||
3 | this is basically copied from https://www.zabbix.com/documentation/3.0/manual/appendix/install/windows_agent |
||
4 | 2 | Jeremias Keihsler | further information may be found at: http://yallalabs.com/windows/how-to-install-zabbix-agent-3-4-and-add-windows-host-to-zabbix-monitoring/ |
5 | 1 | Jeremias Keihsler | |
6 | h2. Configuring agent |
||
7 | |||
8 | Zabbix agent runs as a Windows service. |
||
9 | |||
10 | You can run a single instance of Zabbix agent or multiple instances of the agent on a Microsoft Windows host. A single instance can use the default configuration file ''C:\zabbix_agentd.conf'' or a configuration file specified in the command line. In case of multiple instances each agent instance must have its own configuration file (one of the instances can use the default configuration file). |
||
11 | |||
12 | An example configuration file is available in Zabbix source archive as ''conf/zabbix_agentd.win.conf''. |
||
13 | |||
14 | See the https://www.zabbix.com/documentation/3.0/manual/appendix/config/zabbix_agentd_win options for details on configuring Zabbix Windows agent. |
||
15 | |||
16 | h3. Hostname parameter |
||
17 | |||
18 | To perform active checks on a host Zabbix agent needs to have the hostname defined. Moreover, the hostname value set on the agent side should exactly match the "Host name" configured for the host in the frontend. |
||
19 | |||
20 | The hostname value on the agent side can be defined by either the **Hostname** or **HostnameItem** parameter in the agent configuration file - or the default values are used if any of these parameters are not specified. |
||
21 | |||
22 | The default value for **HostnameItem** parameter is the value returned by the "system.hostname" agent key and for Windows platform it returns the NetBIOS host name. |
||
23 | |||
24 | The default value for **Hostname** is the value returned by the **HostnameItem** parameter. So, in effect, if both these parameters are unspecified the actual hostname will be the host NetBIOS name; Zabbix agent will use NetBIOS host name to retrieve the list of active checks from Zabbix server and send results to it. |
||
25 | |||
26 | **NOTE:** |
||
27 | The **system.hostname** key always returns the NetBIOS host name which is limited to 15 symbols and in UPPERCASE only - regardless of the length and lowercase/uppercase characters in the real host name. |
||
28 | |||
29 | Starting from Zabbix agent 1.8.6 version for Windows the "system.hostname" key supports an optional parameter - _type_ of the name. The default value of this parameter is "netbios" (for backward compatibility) and the other possible value is "host". |
||
30 | |||
31 | **NOTE:** |
||
32 | The **system.hostname[host]** key always returns the full, real (case sensitive) Windows host name. |
||
33 | |||
34 | So, to simplify the configuration of zabbix_agentd.conf file and make it unified, two different approaches could be used. |
||
35 | - leave **Hostname** or **HostnameItem** parameters undefined and Zabbix agent will use NetBIOS host name as the hostname; |
||
36 | - leave **Hostname** parameter undefined and define **HostnameItem** like this:\\ **HostnameItem=system.hostname[host]**\\ and Zabbix agent will use the full, real (case sensitive) Windows host name as the hostname. |
||
37 | |||
38 | Host name is also used as part of Windows service name which is used for installing, starting, stopping and uninstalling the Windows service. For example, if Zabbix agent configuration file specifies ''Hostname=Windows_db_server'', then the agent will be installed as a Windows service "''Zabbix Agent [Windows_db_server]''". Therefore, to have a different Windows service name for each Zabbix agent instance, each instance must use a different host name. |
||
39 | |||
40 | h2. Installing agent as Windows service |
||
41 | |||
42 | To install a single instance of Zabbix agent with the default configuration file ''c:\zabbix_agentd.conf'': |
||
43 | <pre> |
||
44 | zabbix_agentd.exe --install |
||
45 | </pre> |
||
46 | |||
47 | **NOTE:** |
||
48 | On a 64-bit system, a 64-bit Zabbix agent version is required for all checks related to running 64-bit processes to work correctly. |
||
49 | |||
50 | If you wish to use a configuration file other than ''c:\zabbix_agentd.conf'', you should use the following command for service installation: |
||
51 | <pre> |
||
52 | zabbix_agentd.exe --config <your_configuration_file> --install |
||
53 | </pre> |
||
54 | |||
55 | A full path to the configuration file should be specified. |
||
56 | |||
57 | Multiple instances of Zabbix agent can be installed as services like this: |
||
58 | <pre> |
||
59 | zabbix_agentd.exe --config <configuration_file_for_instance_1> --install --multiple-agents |
||
60 | zabbix_agentd.exe --config <configuration_file_for_instance_2> --install --multiple-agents |
||
61 | ... |
||
62 | zabbix_agentd.exe --config <configuration_file_for_instance_N> --install --multiple-agents |
||
63 | </pre> |
||
64 | |||
65 | The installed service should now be visible in Control Panel. |
||
66 | |||
67 | h2. Starting agent |
||
68 | |||
69 | To start the agent service, you can use Control Panel or do it from command line. |
||
70 | |||
71 | To start a single instance of Zabbix agent with the default configuration file: |
||
72 | <pre> |
||
73 | zabbix_agentd.exe --start |
||
74 | </pre> |
||
75 | |||
76 | To start a single instance of Zabbix agent with another configuration file: |
||
77 | <pre> |
||
78 | zabbix_agentd.exe --config <your_configuration_file> --start |
||
79 | </pre> |
||
80 | |||
81 | To start one of multiple instances of Zabbix agent: |
||
82 | <pre> |
||
83 | zabbix_agentd.exe --config <configuration_file_for_this_instance> --start --multiple-agents |
||
84 | </pre> |
||
85 | |||
86 | h2. Stopping agent |
||
87 | |||
88 | To stop the agent service, you can use Control Panel or do it from command line. |
||
89 | |||
90 | To stop a single instance of Zabbix agent started with the default configuration file: |
||
91 | <pre> |
||
92 | zabbix_agentd.exe --stop |
||
93 | </pre> |
||
94 | |||
95 | To stop a single instance of Zabbix agent started with another configuration file: |
||
96 | <pre> |
||
97 | zabbix_agentd.exe --config <your_configuration_file> --stop |
||
98 | </pre> |
||
99 | |||
100 | To stop one of multiple instances of Zabbix agent: |
||
101 | <pre> |
||
102 | zabbix_agentd.exe --config <configuration_file_for_this_instance> --stop --multiple-agents |
||
103 | </pre> |
||
104 | |||
105 | h2. Uninstalling agent Windows service |
||
106 | |||
107 | To uninstall a single instance of Zabbix agent using the default configuration file: |
||
108 | <pre> |
||
109 | zabbix_agentd.exe --uninstall |
||
110 | </pre> |
||
111 | |||
112 | To uninstall a single instance of Zabbix agent using a non-default configuration file: |
||
113 | <pre> |
||
114 | zabbix_agentd.exe --config your_configuration_file --uninstall |
||
115 | </pre> |
||
116 | |||
117 | To uninstall multiple instances of Zabbix agent from Windows services: |
||
118 | <pre> |
||
119 | zabbix_agentd.exe --config configuration_file_for_instance_1 --uninstall --multiple-agents |
||
120 | zabbix_agentd.exe --config configuration_file_for_instance_2 --uninstall --multiple-agents |
||
121 | ... |
||
122 | zabbix_agentd.exe --config configuration_file_for_instance_N --uninstall --multiple-agents |
||
123 | </pre> |