In this section you will learn how to log in and set up a system user in Zabbix.
This is the Zabbix “Welcome” screen. Enter the user name Admin with password zabbix to log in as a Zabbix superuser.
When logged in, you will see 'Connected as Admin' in the lower right corner of the page. Access to Configuration and Administration menus will be granted.
In case of five consecutive failed login attempts, Zabbix interface will pause for 30 seconds in order to prevent brute force and dictionary attacks.
The IP address of a failed login attempt will be displayed after a successful login.
To view information about users, go to Administration → Users and select Users in the dropdown.
Initially there are only two users defined in Zabbix.
To add a new user, click on Create user.
In the new user form, make sure to add your user to one of the existing user groups, for example 'Network administrators'.
By default, new users have no media (notification delivery methods) defined for them. To create one, go to the 'Media' tab and click on Add.
In this pop-up, enter an e-mail address for the user.
You can specify a time period when the medium will be active (see Time period specification page for description of the format), by default a medium is always active. You can also customise trigger severity levels for which the medium will be active, but leave all of them enabled for now.
Click on Add, then click Save in the user properties form. The new user appears in the userlist.
By default, a new user has no permissions to access hosts. To grant the user rights, click on the group of the user in the Groups column (in this case - 'Network administrators'). In the group properties form, go to the Permissions tab.
This user is to have read-only access to Linux servers group, so click on Add below the 'Read only' listbox.
In this pop-up, mark the checkbox next to 'Linux servers', then click Select. Linux servers should be displayed in the respective box. In the user group properties form, click Save.
Done! You may try to log in using the credentials of the new user.
In this section you will learn how to set up a new host.
A host in Zabbix is a networked entity (physical, virtual) that you wish to monitor. The definition of what can be a “host” in Zabbix is quite flexible. It can be a physical server, a network switch, a virtual machine or some application.
Information about configured hosts in Zabbix is available in Configuration → Hosts. There is already one pre-defined host, called 'Zabbix server', but we want to learn adding another.
To add a new host, click on Create. This will present us with a host configuration form.
The bare minimum to enter here is:
Host name
Groups
IP address
Other options will suit us with their defaults for now.
When done, click Save. Your new host should be visible in the hostlist.
In this section you will learn how to set up an item.
Items are the basis of gathering data in Zabbix. Without items, there is no data - because only an item defines a single metric or what data to get off of a host.
All items are grouped around hosts. That is why to configure a sample item we go to Configuration → Hosts and find the 'New host' we have created.
The Items link in the row of 'New host' should display a count of '0'. Click on the link, and then click on Create item. This will present us with an item definition form.
For our sample item, the essential information to enter is:
Name
Key
Type of information
Other options will suit us with their defaults for now.
When done, click Save. The new item should appear in the itemlist. Click on Details above the list to view what exactly was done.
With an item defined, you might be curious if it is actually gathering data. For that, go to Monitoring → Latest data, click on the + before - other - and expect your item to be there and displaying data.
With that said, first data may take up to 60 seconds to arrive. That, by default, is how often the server reads configuration changes and picks up new items to execute.
If you see no value in the 'Change' column, maybe only one value has been received so far. Wait 30 seconds for another value to arrive.
If you do not see information about the item as in the screenshot, make sure that:
With the item working for a while, it might be time to see something visual. Simple graphs are available for any monitored numeric item without any additional configuration. These graphs are generated on runtime.
To view the graph, go to Monitoring → Latest data and click on the 'Graph' link next to the item.
In this section you will learn how to set up a trigger.
Items only collect data. To automatically evaluate incoming data we need to define triggers. A trigger contains an expression that defines a threshold of what is an acceptable level for the data.
If that level is surpassed by the incoming data, a trigger will “fire” or go into a 'Problem' state - letting us know that something has happened that may require attention. If the level is acceptable again, trigger returns to an 'Ok' state.
To configure a trigger for our item, go to Configuration → Hosts, find 'New host' and click on Triggers next to it and then on Create trigger. This presents us with a trigger definition form.
For our trigger, the essential information to enter here is:
Name
Expression
This is the trigger expression. Make sure that the expression is entered right, down to the last symbol. The item key here (system.cpu.load) is used to refer to the item. This particular expression basically says that the problem threshold is exceeded when the CPU load average value for 3 minutes is over 2. You can learn more about the syntax of trigger expressions.
When done, click Save. The new trigger should appear in the trigger list.
With a trigger defined, you might be interested to see its status.
For that, go to Monitoring → Triggers. After 3 minutes or so (we asked to evaluate a 3-minute average after all) your trigger should appear there, presumably with a green 'OK' flashing in the 'Status' column.
The flashing indicates a recent change of trigger status, one that has taken place in the last 30 minutes.
If a red 'PROBLEM' is flashing there, then obviously the CPU load has exceeded the threshold level you defined in the trigger.
In this section you will learn how to set up alerting in the form of notifications in Zabbix.
With items collecting data and triggers designed to “fire” upon problem situations, it would also be useful to have some alerting mechanism in place that would notify us about important events even when we are not directly looking at Zabbix front-end.
This is what notifications do. E-mail being the most popular delivery method for problem notifications, we will learn how to set up an e-mail notification.
Initially there are several predefined notification delivery methods in Zabbix. E-mail is one of those.
To configure e-mail settings, go to Administration → Media types and click on Email in the list of pre-defined media types.
This will present us with the e-mail settings definition form.
Set the values of SMTP server, SMTP helo and SMTP e-mail to the appropriate for your environment.
Press Save when ready.
Now you have configured 'Email' as a working media type. A media type must be linked to users by defining specific delivery addresses (like we did when configuring a new user), otherwise it will not be used.
Delivering notifications is one of the things actions do in Zabbix. Therefore, to set up a notification, go to Configuration → Actions and click on Create action.
In this form, enter a name for the action.
{TRIGGER.STATUS} and {TRIGGER.NAME} macros (or variables), visible in the Default subject and Default message fields, will be replaced with the actual trigger status and trigger name values.
In the most simple case, if we do not add any more specific conditions, the action will be taken upon any trigger change from 'Ok' to 'Problem'.
We still should define what the action should do - and that is done in the Operations tab. Click on New in there, which opens a new operation form.
Here, click on Add in the Send to Users block and select the user ('user') we have defined. Select 'Email' as the value of Send only to. When done with this, click on Add.
That is all for a simple action configuration, so click Save in the action form.
Now, with delivering notifications configured it would be fun to actually receive one. To help with that, we might on purpose increase the load on our host - so that our trigger “fires” and we receive a problem notification.
Open the console on your host and run:
cat /dev/urandom | md5sum
You may run one or several of these processes.
Now go to Monitoring → Latest data and see how the values of 'CPU Load' have increased. Remember, for our trigger to fire, the 'CPU Load' value has to go over '2' for 3 minutes running. Once it does:
In this section you will learn how to set up a template.
Previously we learned how to set up an item, a trigger and how to get a problem notification for the host.
While all of these steps offer a great deal of flexibility in themselves, it may appear like a lot of steps to take if needed for, say, a thousand hosts. Some automation would be handy.
This is where templates come to help. Templates allow to group useful items, triggers and other entities so that those can be reused again and again by applying to hosts in a single step.
When a template is linked to a host, the host inherits all entities of the template. So, basically a pre-prepared bunch of checks can be applied very quickly.
To start working with templates, we must first create one. To do that, in Configuration → Templates click on Create. This will present us with a template configuration form.
The required parameters to enter here are:
Template name
Groups
When done, click Save. Your new template should be visible in the list of templates.
As you may see, the template is there, but it holds nothing in it - no items, triggers or other entities.
To add an item to the template, go to the item list for 'New host'. In Configuration → Hosts click on Items next to 'New host'.
Then:
If you now go to Configuration → Templates, 'New template' should have one new item in it.
We will stop at one item only for now, but similarly you can add any other items, triggers or other entities to the template until it's a fairly complete set of entities for given purpose (monitoring OS, monitoring single application).
With a template ready, it only remains to add it to a host. For that, go to Configuration → Hosts, click on 'New host' to open its property form and go to the Templates tab.
There, click on Add, mark the template we have created ('New template') and click on Select. The template should appear in the form.
Click Save in the form to save the changes. The template is now added to the host, with all entities that it holds.
As you may have guessed, this way it can be applied to any other host as well. Any changes to the items, triggers and other entities at the template level will propagate to the hosts the template is linked to.
As you may have noticed, Zabbix comes with a set of predefined templates for various OS, devices and applications. To get started with monitoring very quickly, you may link the appropriate one of them to a host, but beware that these templates need to be fine-tuned for your environment. Some checks may not be needed, and polling intervals may be way too frequent.
More information about templates is available.