How to make your site work stably and not crash. Part 2: Resource monitoring in Zabbix

Zabbix_logo

Zabbix is a tool for monitoring servers and applications. It collects data about how the server is running: how many resources it uses, whether there are failures or overloads. This is important for administrators who want to keep their systems stable and avoid problems.

How does it work? Agents are installed on servers that collect information and send it to the central Zabbix server. Administrators can then see all relevant information in a user-friendly interface: graphs, reports and notifications. This allows problems to be quickly identified and resolved before they affect users.

 

Zabbix

We wrote about Zabbix installation in detail in the article: How to install and work with Zabbix on VPS.

Zabbix is popular because it is free, powerful and flexible in customization. Many companies use it to monitor server performance and it is considered one of the best tools on the market.

To rent virtual private servers (VPS), contact a proven provider LikeVPS. This service offers a variety of solutions that will help you optimize the management of your resources and ensure reliable operation of your applications.

Zabbix features

Zabbix offers a few basic features.

  • First, performance monitoring. Zabbix monitors how the server is running, what resources are used by CPU, memory and disk space. If the server starts to “slow down” or overload, the administrator is immediately notified and can take action.
  • Secondly, Zabbix allows you to monitor network traffic. This means you can see how much data is passing through your server and if there is any suspicious activity. For example, if someone tries to connect to your server without authorization, Zabbix will immediately report it. This helps prevent attacks and protect important data.
  • Zabbix also monitors the availability of services. If a site or database stops working, the administrator will be notified.

Setting up monitoring in Zabbix

Setting up monitoring in Zabbix starts by adding hosts (servers or devices) that you want to monitor. After adding a host, you can configure metrics such as CPU, memory, disk space, and network traffic usage. And here's how to do it:

  1. Open the Zabbix interface.

Zabbix мониторинг

  1. Go to “Configuration” on the main navigation bar, then click “Hosts”.

Zabbix настройка мониторинга

  1. Add a new host. Click the “Create host” button in the upper right corner of the screen.

мониторинг в Zabbix

  1. Fill in the host information. Enter the host name in the “Host name” field, add its group (for example, “Servers”), and specify the IP address or DNS name in the “Agent interfaces” field.
  2. Save your changes. Click the “Add” button to save the new host.

Next, let's customize what metrics we want to see:

  1. Go to the host settings. In the list of hosts, find the host you just added and click on its name.
  2. Add monitoring items. Go to the “Items” section and click “Create item”.

Zabbix метрики

  1. Customize the item.
  • Name: Specify the name of the item (for example, “CPU Load”).
  • Type: Select the type (for example, “Zabbix agent”).
  • Key: Enter the metric key (e.g. for CPU load use system.cpu.load).
  • Update interval: Set the update interval (e.g. 30s to update every 30 seconds).
  1. Save the item. Click “Add” to save.

Now let's set up the triggers:

  1. Go to the “Triggers” section. In the host settings, select “Triggers”.
  2. Create a trigger. Click “Create trigger”.

Zabbix триггеры

  1. Fill in the trigger information.
  • Name: Enter the name of the trigger (for example, “High CPU Load”).
  • Expression: Enter a condition for the trigger (e.g. {host:system.cpu.load.last()} > 0.9 for CPU load over 90%).
  1. Save the trigger. Click “Add”.

Let's set up alerts:

  1. Go to the “Actions” section. In Zabbix settings, select “Configuration”, then “Actions”.
  2. Create a new action. Click “Create action”.

Zabbix настройка оповещений

  1. Customize the action.
  • Name: Specify the name of the action (e.g. “Notify Admins”).
  • Conditions: Add a condition (for example, “Trigger = High CPU Load”).
  • Operations: Configure who will receive notifications (for example, select a user group).
  1. Save the action. Click “Add”.

Done! Now let's see how to see graphs and reports.

Graphs and reports in Zabbix

Create and customize graphics:

  1. Open the Zabbix interface. 
  2. Navigate to “Graphs”. From the sidebar, select “Graphs” to view the available graphs.
  3. Create a new graph. Click on the “Create graph” button in the upper right corner.
  4. Customize the graph. Specify a name for the graph and select the host to be tracked. Next, add metrics such as CPU, memory, or disk space usage, and select the graph type (line graph, bar graph, etc.).

Zabbix графики

  1. Save the changes. After customization, click “Save” to save the graph. Now you can see the data visualization in real time.

Report generation

  1. Go to the “Reports” section. From the sidebar, select “Reports” to access the report generation functionality.
  2. Select the type of report. Zabbix offers different types of reports such as “Availability” and “Performance”. Select the desired type.
  3. Customize the report parameters. Specify the time range to analyze (for example, “Last 7 days” or “Last month”) and other parameters if necessary.
  4. Generate the report. Click the “Generate” button to generate the report. Zabbix will generate a report based on the selected metrics and time range.

Zabbix отчеты

  1. Save or export the report. After generation, you can save the report in PDF or CSV format for further analysis or sending to colleagues.

These functions help you visualize and analyze data. This allows you to quickly identify problems. Here's how it works:

A large organization that deals with sensitive data applied Zabbix to monitor their database. They set up triggers that monitored suspicious activity, such as unauthorized connections. As a result, when the system detected unusual requests, administrators were immediately notified and could take action to prevent data leakage.

Zabbix на VPS

Server monitoring is the key to the smooth operation of any company. It helps detect problems before they develop into serious failures, which saves time and money. Without monitoring, administrators may encounter unpleasant surprises, such as unexpected server shutdowns, which, of course, does not please either users or businesses.

Zabbix is a great tool to solve these problems. It is easy to set up and use, and it provides a lot of options for tracking the health of servers. With Zabbix, administrators can rest assured that their system is running like clockwork and all important metrics are under control. This makes Zabbix an indispensable assistant for any IT team.

To rent virtual private servers (VPS), turn to the proven provider LikeVPS. This service offers a variety of solutions that will help you optimize the management of your resources and ensure reliable operation of your applications.