This article is supposed to help administrators who need to monitor their network and servers to learn how to configure and use the Zabbix monitoring software quickly and painlessly. I have been a Nagios addict for many years but recently have become a big fan of Zabbix. With this article I would like to share my experiences and provide an introduction to Zabbix. (I’m talking about Zabbix 1.6.5 here.) This article complements my blog entry on different monitoring systems.
Some of the the nice features in Zabbix are:
- trends (it records system parameters to the database – any parameter can be graphed at any time – the polling time can be setup per parameter)
- web interface (no text files where you need to guess which parameters are allowed where)
- explicit (no hidden magic – everything that happens can be configured)
- web monitoring (more than just check_http – checks your website for correctness and benchmarks throughput and response times)
- multi-platform agent (monitors the data on each system – delivers way more system parameters than plain SNMP – can be extended easily by shell scripts and one-liners)
- proxy (allows to monitor remote locations)
- auditing (all configuration changes get recorded)
- additional host information (you can store comments, serial numbers, operating systems and other data along with the host)
- screens (unlimited number of dashboard-style views that can contain textual information, graphs or several other widgets)
- database backends (all information about configuration and trends is stored in MySQL/PostgreSQL/Oracle/SQLite – no funny RRD files)
- real-time monitoring (no need to wait several minutes for a status change – information is updated instantly)
- templates (templates for several kinds of operating systems allow monitoring of new systems with a minimum of extra work – templates can inherit from other templates)
- performs well (the PHP-driven web interface is very fast – collecting system parameters is done very efficiently)
- flexible notifications (notifying the administrators by email, Jabber and GSM modem is built-in – further notifications can be scripted – notification content is completely customizable depending on the context – each contact can be notified for specified levels using specified media at specified days and times)
- remote commands (shell commands can be executed on the remote system to remedy situation where a system may be overloaded or services stop working properly)
- user permissions (each user or user group can get read-only or full access to specified host groups – certain users may only see the services that they are responsible for)
- triggers and actions (thresholds can be configured for each monitored parameter and each system – the actions like notifying someone or executing a shell command can be completely customized – triggers can use complex programming-language-style expressions)
- availability reporting (items can be grouped as IT services that measure whether all services run properly to deliver a certain abstract service – proper SLAs)
Altogether Zabbix is mature, powerful, actively developed, completely open-source (no crippled free version as in Zenoss), has a decent community and their creators offer paid support if so desired. It has a few minor quirks but nothing serious.
From going-wrong to getting-alerted
In other monitoring software monitoring works slightly differently. This is how you get from a service check to a notification in Zabbix. You would configure:
- a host (DNS name or IP address of a system to monitor)
- an item (usually used as part of a template) that represents a system parameter (e.g. CPU load)
- a trigger (expression/threshold that defines if an item depicts a problem – e.g. the CPU load is too high)
- an action (what to do if a certain trigger fires – e.g. send an information to the on-call team that the CPU load is too high)
- a user (a user with username/password, a set of permissions and an email address or cellphone number)
So you are probably in a hurry and would like to set up Zabbix and quickly see results.
Install Zabbix as adequate for your operating system. You will need the “server” and “frontend” component along with a common Apache/PHP server and a database (MySQL, PostgreSQL, Oracle or SQLite) running. On Debian it’s just a matter of “aptitude install zabbix-server-mysql zabbix-frontend-php” for example.
Access the web interface
Go to http://myserver/zabbix and you should see the login screen:
The default login is Admin with the password zabbix. Login:
This is the table showing all the hosts that you monitor. You see that Zabbix already created a host for you called "ZABBIX Server". It is the host you are currently running Zabbix on. In the rightmost column click on Select and a popup will be shown. Select Items here:
You will get a list of items that are monitored for this host. Items are system parameters like the CPU load, the amount of disk space filled or how much Apache processes are running.
The greyed Template_Linux before the item name means that this parameter is defined in a template called "Template_Linux". If you edited the item then it would no longer be connected to the template but rather connected to the current host. (You could click on the template name and Zabbix would take you to the items screen for this template. The template items would then be set automatically for all hosts using this template.)
The Key column shows the machine-readable item name. There is a large number of predefined item keys that you can use and that are documented in the manual (page 95). They are dealing with CPU, network interfaces, processes, uptime, users, file system, (Windows) services and memory. You can even monitor if the checksum of specific files to notice if they have been changed.
Why is Nagios appearing more widespread than Zabbix?
Nagios/Netsaint has been around for much longer than Zabbix. Many people started with Nagios and it is common that you stay with what you know. But Nagios has basically stayed the same over the years. It has grown “organically”. Some features have been added. Some plugins have been written like pnp4nagios for trending or nagvis for nifty screens but they are not well-integrated. Zabbix isn’t as widely known yet although it has been around for many years, too. But it’s definitely worth a look.