Book Image

Zabbix 1.8 Network Monitoring

By : Rihards Olups
Book Image

Zabbix 1.8 Network Monitoring

By: Rihards Olups

Overview of this book

Imagine you're celebrating the start of the weekend with Friday-night drinks with a few friends. And then suddenly your phone rings -- one of the servers you administer has gone down, and it needs to be back up before tomorrow morning. So you drag yourself back to the office, only to discover that some log files have been growing more than usual over the past few weeks and have filled up the hard drive. While the scenario above is very simplistic, something similar has happened to most IT workers at one or another point in their careers. To avoid such situations this book will teach you to monitor your network hardware, servers, and web performance using Zabbix- an open source system monitoring and reporting solution.The versatility of Zabbix allows monitoring virtually anything, but getting started with the new concepts can take some time. This book will take you through the most common tasks in a hands-on, step by step manner.Zabbix is a very flexible IT monitoring suite, but not every part of it is immediately clear to new users. Following the instructions in this book should allow you to set up monitoring of various metrics on various devices, including Linux and Windows machines, SNMP devices, IPMI enabled server,s and other network attached equipment. You will learn to define conditions – such a temperature being too high or service being down – and act upon them by notifying user by email, SMS, or even restarting service. You will learn to visualize the gathered data with graphs and the various tips and tricks that are provided will help to use Zabbix more efficiently and avoid common pitfalls.This book covers setting up Zabbix from the scratch and gradually introduces basic components of Zabbix, moving to more advanced topics later. Book's scope is based on the author's experience of working with Zabbix for many years, as well as on the questions users have asked on the Zabbix IRC channel and forums.
Table of Contents (22 chapters)
Zabbix 1.8 Network Monitoring
Credits
About the Author
About the Reviewers
Preface
6
Acting Upon Monitored Conditions

Problems with monitoring


Sometimes monitoring something proceeds without a hitch, sometimes it just won't work.

General monitoring

  1. Q: I added a host or item, but I don't see it in Monitoring | Latest data.

  2. A: It most likely has not received any data. Hosts without any data do not appear in the monitoring section.

  3. Q: I can see my host in Latest data, and new values are coming in but it is missing in Monitoring | Overview.

  4. A: Overview is probably set to display triggers verify that the host has triggers configured. Hosts without triggers are not displayed in the trigger mode.

Monitoring with Zabbix agent

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

  2. A: Common reasons why Zabbix agent items won't work include:

    • The Zabbix agent daemon is not running. Trivial 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 what port and interface 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 like local and network firewalls blocking connections, but also some network devices and setups actually masking the source IP address of the Zabbix server's outgoing connections. Test connectivity by executing telnet <monitored host IP> 10050 from the Zabbix server. Use another port, if you have customized that. 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 have to actually use the IPv6 address, as the Zabbix agent is receiving that as the one of the incoming connection.

  3. Q: I am trying to monitor a host using Zabbix agent active checks, but it does not work.

  4. A: Active items are a bit more tricky. Things to verify:

    • Check network connectivity as with normal items - from the monitored machine, execute telnet <Zabbix server IP> 10051. Use another port if you have customized that.

    • Make sure that the time specified in RefreshActiveChecks option in the agent daemon configuration file has passed before expecting results from the active items. If you want to force agent to reload list of items from the server, restart the agent. Make sure to wait for Zabbix server to refresh its item cache, otherwise agent won't be getting configuration changes.

    • Check whether the host name specified in 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.

    • Make sure that Zabbix server you want to retrieve/send active checks is listed as the first entry for Server option in agent daemon configuration file.

  5. Q: I am verifying that I can get the value on the monitored host, but Zabbix agent says it is not supported or gives me wrong data.

  6. A: There are several possible cases:

    • You are checking things like the process count or using zabbix_agentd -t syntax as root, but various permission limitations, including grsecurity and SELinux, can prevent access for Zabbix agent. This includes the Zabbix agent showing the amount of running particular processes as 0 even when with root access you can see actual amount.

    • Another case when local process count differs from what the Zabbix agent returns - various interpreted processes like Python or Perl ones can appear to the agent as interpreter processes, only with user processes as a parameter. Processes known to suffer from this problem include amavisd and xend. In those situations you can use a different approach, example item key - proc.num[python,,,xend]. This will look for python processes, having the xend string in their parameters.

    • The monitored instance is missing. For example, if you are asking for metric with key net.if.in[eth0,bytes] and Zabbix agent claims it is not supported, verify that interface eth0 actually exists. In some cases, Linux can move an existing interface representation to eth1 or another device.

User parameters

  1. Q: My user parameter does not work.

  2. A: Common causes that break user parameters:

  • A missing environment is one of the biggest stumbling blocks when setting up user parameters. Zabbix agent does not preserve environment details like the HOME variable or other information. This can break various configurations that are set for the Zabbix user on the monitored host. Make sure to set the environment as required either by setting variables in the user parameter directly, or in a wrapper script.

  • Again, restricted permissions for Zabbix user will be confusing to debug if you will run commands for testing as root, so always test user parameters as Zabbix user. If you need root access for some check, configure access via sudo.

  • Returning unclean data also can easily break the process. When retrieving data with user parameters, make sure it does not contain characters, making it unsuited for storage (like returning 26.6 C for a float data type item), or having other weird characters (like having CR/LF linefeed at the end of the data string).

Problems with SNMP devices

  1. Q: My SNMP items do not work.

  2. A: Double-check that the SNMP version and community string are set correctly. Specifying incorrect SNMP version will often cause timeouts, making it harder to debug. Of course, check general connectivity and permissions by using the snmpwalk and snmpget commands from the Zabbix server. Additionally, make sure you are not overloading the monitored device by querying lots of values too frequently.

  3. Q: My SNMP items work, but some OIDs on a specific device do not, even though data appears in snmpwalk output.

  4. A: Try snmpget with those OIDs. Some UPSes are known to have buggy firmware that prevents these metrics from working with SNMPGET requests, but do work with the SNMPGETNEXT requests that snmpwalk uses. If that is the case, upgrade the firmware on the device.

  5. Q: I listed all SNMP MIBs I want to use in /etc/snmp/snmp.conf, but Net-SNMP utilities do not use them all properly.

  6. A: Some Net-SNMP versions silently trim lines in this file to 1024 symbols, including the newline character. Try splitting options on multiple lines so that a single line does not exceed 1023 printable characters.

  7. Q: I can retrieve data with snmpget, but Zabbix times out.

  8. A: If you are trying to use a fully qualified SNMP OID with Net-SNMP 5.3.0 or 5.3.0.1, a bug in Net-SNMP will prevent it from working. Either patch Net-SNMP, or use numeric or short OIDs.

Problems with IPMI monitoring

  1. Q: I can't get the IPMI item to work.

  2. A: There are several things to verify when IPMI items do not work:

  • Make sure that the Zabbix server is configured with IPMI support. Trivial, but easy to miss.

  • Check whether the StartIPMIPollers option in the server's configuration file is set to the default value, 0. If so, set it to 1 and restart Zabbix server.

  • Make sure that the sensor names are correct. You can get the sensor names with IPMItool, and you have to use the name as it appears in the IPMItool output with spaces, and without quoting it.

  • Discrete IPMI items are not supported.

  • There is a bug in older OpenIPMI versions. Retrieving data with IPMItool will work fine, but Zabbix will be unable to get any values. OpenIPMI 2.0.7 is known to have this problem, while OpenIPMI 2.0.14 is known to work.

Problems with ICMP checks

  1. Q: All of my ICMP checks are failing.

  2. A: If you are using the SourceIP setting in the Zabbix server configuration file, it requires fping with -S flag support. This support is not available in official fping packages, so you will have to either use a patched one (many distributions provide already patched fping packages), or remove the SourceIP option.

General issues

  1. Q: I am monitoring an item of type counter, but it doesn't work and Zabbix complains that the received data is not suitable for value type.

  2. A: Note that the received data might be transformed; this is especially common with counter items as they usually are stored as delta (speed per second). In this case, the resulting value is fractional, and the item data type should be set to Numeric (float).