Zabbix Agent Windows Server 2003

0 views
Skip to first unread message
Message has been deleted

Luar Ehria

unread,
Jul 17, 2024, 5:04:38 PM7/17/24
to kinglonggeschcont

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.

zabbix agent windows server 2003


Descargar https://urllie.com/2yPq3a



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.

The default value for HostnameItem parameter is the value returned by the "system.hostname" agent key. For Windows, it returns result of the gethostname() function, which queries namespace providers to determine the local host name. If no namespace provider responds, the NetBIOS name is returned.

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.

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.

Zabbix agent for Windows does not support non-standard Windows configurations where CPUs are distributed non-uniformly across NUMA nodes. If logical CPUs are distributed non-uniformly, then CPU performance metrics may not be available for some CPUs. For example, if there are 72 logical CPUs with 2 NUMA nodes, both nodes must have 36 CPUs each.

Although Zabbix installation from MSI installer packages is fully supported, it is recommended to install at least Microsoft .NET Framework 2 for proper error handling. See Microsoft Download .NET Framework.

Zabbix components along with the configuration file will be installed in a Zabbix Agent folder in Program Files. zabbix_agentd.exe will be set up as Windows service with delayed automatic startup (or automatic startup on Windows versions before Windows Server 2008/Vista).

If you use the Zabbix agent in the passive mode, it means that the poller (internal server process) connects to the agent on port 10050/TCP and polls for a certain value (e.g., host CPU load). The poller waits until the agent on the host responds with the value. Then the server gets the value back, and the connection closes.

In the active mode, all data processing is performed on the agent, without the interference of pollers. However, the agent must know what metrics should be monitored, and that is why the agent connects to the trapper port 10051/TCP of the server once every two minutes (by default). The agent requests the information about the items, and then performs the monitoring on the host and pushes the data to the server via the same TCP port.

Now, imagine that you intend to set up automatic issue resolution on your hosts in addition to monitoring. The simplest example with Windows services would be configuring the items and triggers to check the health of specific services. But before notifying users about a Windows service that has stopped, you want to try to restart it automatically.

This is possible with remote commands. You can learn more about setting up remote commands by watching the video Zabbix Email Notifications And Actions. In the front end, open Configuration > Actions > Steps > Remote Command. Then enter the following CMD command:

Each time the trigger fires, the Zabbix agent will try to start the service. If it fails to do so, then a notification will be sent. But this remote command will only work with the Zabbix agent in the passive mode.

The timeout value is stored in the Timeout variable in zabbix_server.conf. The maximum value is 30 seconds, which is too high to ever be used in production without proper reasons.

The timeout value can also be set in the Zabbix agent configuration file, zabbix_agentd.conf. If the timeout is set to three seconds, the poller will wait for three seconds or until the requested value is received.

The same applies to the agent. If you have an agent with a lot of scripts and user parameters, and those are relatively slow, then it will take time for the agent to process them. The number of the default internal agent processes is stored in the StartAgents variable.

There are three internal processes that can perform the required checks, which means that, by default, the agent can process three items simultaneously. This parameter can be increased if you have a lot of slow-running checks, and the agent acts as the bottleneck. By increasing the StartAgents value to 100 you will increase the number of pollers on the Zabbix server. It should be noted that having slow-running checks degrades the performance of your Zabbix server, but sometimes there are no other options.

The downside is that there can only be one such process per each agent in the active mode, and it is impossible to increase the number of the checks. If you have multiple items running for 15 seconds each, with a short update interval on the host, and you configure all of those items as active checks, there will be a queue of pending checks.

The only way to avoid this is to configure those items as passive checks, and then you can increase the number of internal processes handling these checks by changing the StartAgents variable in zabbix_agentd.conf. Note that you have to restart the binary process after changing the config file.

Conversely, if you have a lot of slow items taking 30 seconds each, and you cannot process them outside of the agent, then passive checks are your only option. Using those, you can increase the number of processes on the agent side.

Now, onto the most important part, namely configuring the agent in the active or the passive modes. The default setting is passive, meaning that even the default Zabbix server host has all of the Zabbix agent item types configured as passive.

It should be noted that each agent can run in two modes simultaneously. You could have one machine with ten items running in the passive mode, and ten items running in the active mode. This is done using the same agent installation, the difference being in the configuration file.

When configuring passive checks in zabbix_agentd.conf, you only need to change one parameter Server. It is a comma-separated list of IP addresses and DNS names from which the agent will accept incoming connections. The Zabbix server connects to this agent and polls the data.

Active checks require a more in-depth configuration. First of all, you need the ServerActive variable. This is the list of IP addresses and DNS names of your Zabbix servers or proxies to which the agent will connect once every two minutes to request the configuration. After it receives the configuration, it starts the requested monitoring and pushes the collected data.

This means that you will start seeing discrepancies in reported values. For instance, free disk space can be changing repeatedly between two different values, each one valid for its respective server, resulting in erroneous reporting. This underpins the importance of assigning unique hostnames to each agent.

Performance benefits
Consider the active agent mode. As I already mentioned, the poller connects to the host, requests the data, and then waits until it receives the data or until the timeout is reached.

Following previous tutorials concerning the Zabbix series, this article describes how to install and set up an instance of a Zabbix agent to run as a service on Microsoft Windows systems in order to monitor your infrastructure windows environments, especially server machines.

1. The pre-compiled zip agents for Windows environments can be obtained from the official Zabbix download page and manually installed and started on the system using windows Command Prompt as in the following example:

4. A second and more convenient method to install and automatically configure the Zabbix agent on Windows environments is by downloading the Zabbix Agent installer MSI package specific to your system architecture.

5. Once the Zabbix agent MSI file has been downloaded on your system, run it and supply the required information in order to configure and install the agent on the target monitored host as it follows:

7. Almost all Windows-based systems have Windows Firewall active and running, therefore Zabbix agent port must be opened in the firewall in order to communicate with the Zabbix server.

9. Next, make sure you check and open the firewall rule on the network segment where the Zabbix server is located in your network and hit the OK button to finish and apply the configuration.

10. In order to test if the Zabbix agent running on windows is reachable from the Zabbix server-side, use telnet or netcat command on Zabbix server against windows agent IP-Port and a Connected message should appear. Hit Enter key to generate an error message and automatically disconnect from the agent:

Finally, after the Template OS Windows is visible in Linked Templates filed hit on the below Add button to complete the process and add the entire Windows host configuration.

15. After your monitored windows machine has been added return to Configuration -> Hosts and the windows Host should now be present in this window as illustrated below screenshot.

d3342ee215
Reply all
Reply to author
Forward
0 new messages