Projekt

Allgemein

Profil

Setup zabbix30 agent » Historie » Version 1

Jeremias Keihsler, 12.02.2019 11:50

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
5
h2. Configuring agent
6
7
Zabbix agent runs as a Windows service.
8
9
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).
10
11
An example configuration file is available in Zabbix source archive as ''conf/zabbix_agentd.win.conf''.
12
13
See the https://www.zabbix.com/documentation/3.0/manual/appendix/config/zabbix_agentd_win options for details on configuring Zabbix Windows agent.
14
15
h3. Hostname parameter
16
17
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.
18
19
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.
20
21
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.
22
23
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.
24
25
**NOTE:**
26
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.
27
28
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". 
29
30
**NOTE:**
31
The **system.hostname[host]** key always returns the full, real (case sensitive) Windows host name.
32
33
So, to simplify the configuration of zabbix_agentd.conf file and make it unified, two different approaches could be used.
34
  - leave **Hostname** or **HostnameItem** parameters undefined and Zabbix agent will use NetBIOS host name as the hostname;
35
  - 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.
36
37
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.
38
39
h2. Installing agent as Windows service
40
41
To install a single instance of Zabbix agent with the default configuration file ''c:\zabbix_agentd.conf'':
42
<pre>
43
zabbix_agentd.exe --install
44
</pre>
45
46
**NOTE:**
47
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.
48
49
If you wish to use a configuration file other than ''c:\zabbix_agentd.conf'', you should use the following command for service installation:
50
<pre>
51
zabbix_agentd.exe --config <your_configuration_file> --install
52
</pre>
53
54
A full path to the configuration file should be specified.
55
56
Multiple instances of Zabbix agent can be installed as services like this:
57
<pre>
58
zabbix_agentd.exe --config <configuration_file_for_instance_1> --install --multiple-agents
59
zabbix_agentd.exe --config <configuration_file_for_instance_2> --install --multiple-agents
60
...
61
zabbix_agentd.exe --config <configuration_file_for_instance_N> --install --multiple-agents
62
</pre>
63
64
The installed service should now be visible in Control Panel.
65
66
h2. Starting agent
67
68
To start the agent service, you can use Control Panel or do it from command line.
69
70
To start a single instance of Zabbix agent with the default configuration file:
71
<pre>
72
zabbix_agentd.exe --start
73
</pre>
74
75
To start a single instance of Zabbix agent with another configuration file:
76
<pre>
77
zabbix_agentd.exe --config <your_configuration_file> --start
78
</pre>
79
80
To start one of multiple instances of Zabbix agent:
81
<pre>
82
zabbix_agentd.exe --config <configuration_file_for_this_instance> --start --multiple-agents
83
</pre>
84
85
h2. Stopping agent
86
87
To stop the agent service, you can use Control Panel or do it from command line.
88
89
To stop a single instance of Zabbix agent started with the default configuration file:
90
<pre>
91
zabbix_agentd.exe --stop
92
</pre>
93
94
To stop a single instance of Zabbix agent started with another configuration file:
95
<pre>
96
zabbix_agentd.exe --config <your_configuration_file> --stop
97
</pre>
98
99
To stop one of multiple instances of Zabbix agent:
100
<pre>
101
zabbix_agentd.exe --config <configuration_file_for_this_instance> --stop --multiple-agents
102
</pre>
103
104
h2. Uninstalling agent Windows service
105
106
To uninstall a single instance of Zabbix agent using the default configuration file:
107
<pre>
108
zabbix_agentd.exe --uninstall
109
</pre>
110
111
To uninstall a single instance of Zabbix agent using a non-default configuration file:
112
<pre>
113
zabbix_agentd.exe --config your_configuration_file --uninstall
114
</pre>
115
116
To uninstall multiple instances of Zabbix agent from Windows services:
117
<pre>
118
zabbix_agentd.exe --config configuration_file_for_instance_1 --uninstall --multiple-agents
119
zabbix_agentd.exe --config configuration_file_for_instance_2 --uninstall --multiple-agents
120
...
121
zabbix_agentd.exe --config configuration_file_for_instance_N --uninstall --multiple-agents
122
</pre>