Monitoring with the Zabbix agent

  1. Q: I am trying to monitor a host using passive Zabbix agent checks, but it doesn't work.

A: Common reasons why Zabbix agent items won't work include the following:

    • The Zabbix agent daemon is not running. Simple, right? Still, start by checking that it is actually running.
    • The Zabbix daemon is not listening on the correct port or interface. You can check which port and interface the Zabbix agent daemon is listening on by running netstat -ntpl on the monitored host. The default agent daemon port is 10050.
    • The server IP address in the agent daemon configuration file is incorrect. Check the configuration file and make sure the server directive specifies the IP that the Zabbix server will be connecting from.
    • Network problems prevent the server from connecting to the agent daemon properly. This includes things such as local and network firewalls blocking connections, but also some network devices and setups actually changing the source IP address of the Zabbix server's outgoing connections. Test the connectivity by executing telnet <monitored host IP> 10050 from the Zabbix server. If you have customized the agent listen port, use that port in this command. If the connection is not opened, debug it as a network problem. If the connection is immediately closed, the Zabbix agent daemon does not see the connection as coming from the IP address set in the configuration file. Note that, in some cases, you might actually have to use the IPv6 address, as the Zabbix agent is receiving that as one of the incoming connections.
  1. Q: I am trying to monitor a host using active Zabbix agent checks, but it does not work.

A: Active items are a bit trickier. Here are some things to verify:

    • Check network connectivity as with normal items—from the monitored machine, execute telnet <Zabbix server IP> 10051
    • If you have customized the agent listen port, use that port in this command
The Zabbix proxy IP address and port should be used in almost all commands if the host is monitored by a proxy.
    • Make sure to wait for the Zabbix server to refresh its configuration cache, and that the time specified in the RefreshActiveChecks option in the agent daemon configuration file has passed, before expecting results from the active items. If you want to force the agent to reload the list of items from the server, restart the agent.
    • Check whether the host name specified in the agent daemon configuration file in the Hostname option matches the one configured for the host in the frontend. Note that this is not the IP address or DNS name; only the host name will work—it is also not the visible name, but the so-called technical host name. Like nearly everything else in Zabbix, it is case-sensitive.
    • Make sure that the Zabbix server you want to send active checks to (or retrieve them from) is listed in the ServerActive option in the agent daemon configuration file.
  1. Q: I am verifying that I can get the value on the monitored host, but the Zabbix agent says it is not supported or gives me the wrong data.

A: There are several possible cases:

    • You are checking things such as the process count or using the zabbix_agentd -t syntax as root, but various permission limitations, including grsecurity and SELinux, can prevent access for the Zabbix agent. This includes the Zabbix agent showing the number of unique running processes as 0 even when with root access you can see the actual number.
    • Another case when the local process count differs from what the Zabbix agent returns: various interpreted processes, such as Python or Perl ones, can appear to the agent as interpreter processes, only with user processes as a parameter. Processes known to display this problem include amavisd and xend. In those situations, you can use a different approach; for example, with the proc.num[python,,,xend] item key. This will look for Python processes with the xend string in their parameters.
    • The monitored instance is missing. For example, if you are asking for a metric with the net.if.in[eth0,bytes] key and the Zabbix agent claims it is not supported, verify that the eth0 interface actually exists.
    • Another server has an active Zabbix agent configured with the same host name and is also sending in data for this host.
  1. Q: I modified a parameter in the agent daemon configuration file, but it ignores my changes.

A: Check several things:

    • Verify that the modified line is not commented out.
    • Make sure you are editing the file on the correct system.
    • Check that the Zabbix agent daemon uses the modified configuration file. All Zabbix daemons log the configuration file they are using when starting up.
    • Check for Include directives. Pay extra attention to ones that include all files in a directory, and nested includes.
    • Make sure you properly restarted the daemon. Note that simply running zabbix_daemon or the zabbix_daemon restart will not restart the daemon.
Some distribution packages may provide a configuration file and a convenient symlink to that file. If you use sed -i on a symlink, it does not edit the target file—it replaces the symlink with a regular file instead. Some versions of sed may provide an option called --follow-symlinks to edit the target file.
  1. Q: I see the configuration file specifying one value for a parameter, but the Zabbix agent uses a different value.

A: Refer to the answer to the previous question, especially the part about making sure it's the correct file on the correct system, and that Include directives do not override the first instance of the parameter.

  1. Q: I'm trying to use active items or autoregistration on a Windows system, but the automatically acquired hostname is all uppercase and cut at 15 characters.

A: Set HostnameItem=system.hostname[host] in the agent daemon configuration file. We discussed this in Chapter 22, Monitoring Windows.

  1. Q: I verified that an item works as expected when running zabbix_agentd -t or -p, but it does not work when I check the values in the frontend.

A: When manually running zabbix_agentd, the user and environment are likely different from a running daemon, so permissions and environment values will differ. Check the detailed operations that the item is expected to perform and what could prevent it from succeeding with the Zabbix agent daemon permissions. Do not test zabbix_agentd directly as root. The best approach is testing against a running agent daemon with zabbix_get.

  1. Q: I can get item values in the Zabbix server or with zabbix_get, but when I test with zabbix_agentd -t or -p, I get an error: [m|ZBX_NOTSUPPORTED] [Collector is not started.].

A: Some items, including system.cpu.util and proc.cpu.util, have their values calculated by a running agent, as they need multiple samples before providing a useful value. Such items only work when an agent daemon is queried by the Zabbix server or zabbix_get.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.33.178