⬆️ ⬇️

Overview of php-frontend of Zabbix monitoring system

Hello, habrayuzer!



I think that every self-respecting system administrator of a local network will install a monitoring system in order to be aware of all changes and events. I want to tell about the monitoring system Zabbix, or rather about its php-frontend. Here, only my personal experience obtained on a real local network.



Create user



We assume that our Zabbix server is installed and bolted by php-frontend. Log in as the admin username and password zabbix (first login).

image



First of all I suggest to add my user and delete the default Admin account. Go to the Administration-Users, in the drop-down menu in the upper right corner select users and click on the add user button.

image

')

Next, fill out the form and advise you to choose Russian. Reboot under the new account.



Network nodes



The most important menu in zabbiks is Settings-Network nodes. Here are the cars (and not only) that we are watching. My page looks like this.

image

For each node there are settings:

In each of the 4 settings, of course, you can add your own groups of elements, your own data elements, triggers and graphics.

It is desirable to attach a data elements template to each node, they have already been carefully prepared by the developers. There are templates for Windows, Linux, Freebsd and other operating systems. Templates differ in different ways of getting data.

In addition to these 4 settings, you can see on the right the DNS of the host, its IP, the port on which the Zabbix Agent is located, the attached template, the status, whether this node is observed or not, and the availability of Zabbix Agent.

Add the host you want to monitor and attach the template corresponding to the installed OS. If you want to watch, for example, a Wi-Fi router, then you just need to ping it. How to do this - I will explain in the next article, if necessary.



Alert Methods



So, now you are watching the server, now you need to configure the notification of admins when the data deviates from the norm. To do this, go to the Administration-Ways alerts.

image

I have set up an alert through a script that sends an email through a script to the admin box. The way of notification by E-mail, and not through the script, requires some additional configuration of the regular program for sending E-mail. Therefore, it is easier through the script. When creating a notification method and choosing the type of notification through a script, just write the name of the script. I give the text of the script.



#!/bin/sh



export smtpemailfrom=zabbix@domain.com #,

export smtpdomain=gmail.com # smtp

export smtpserver=smtp.gmail.com # smtp

export smtplogin=login #

export smtppass=password #



echo "From: \"Zabbix Monitor\" <$smtpemailfrom>" > /usr/home/zabbix/mailz

echo "To: $1" >> /usr/home/zabbix/mailz

echo "Subject: $2" >> /usr/home/zabbix/mailz

echo "" >> /usr/home/zabbix/mailz

echo "$3" >> /usr/home/zabbix/mailz



/usr/local/bin/nbsmtp -d $smtpdomain -f $smtpemailfrom -h $smtpserver -U $smtplogin -D -s -P $smtppass -S < /usr/home/zabbix/mailz

rm /usr/home/zabbix/mailz



Here is a script to send to gmail. It is enough to install the nbsmtp program from FreeBSD ports, on Linux, I think, there is such a program too. The script itself is in / usr / home / zabbix / bin /, i.e. in the home folder of the user zabbix, you need to create a bin folder in it and put a script named smtp and execute chmod + x smtp.

You also need to specify in the zabbix_server.conf config parameter where the alert scripts are located.



...

AlertscriptsPath=/usr/home/zabbix/bin/

....



Now you need to edit your user in zabbix and add notification methods, if you have not done so already. I have been configured to send sms-coy to the mail and to the phone (beeline service), the same feature is available for megaphone subscribers. The operator creates an e-mail box, and incoming letters to this box are sent to you by SMS to the phone. In this case, you will always receive timely alerts from zabbiksa.

image

When adding an alert method, you can specify the importance of using this alert method, for example, all alerts can be sent to the mail, and only important and extraordinary ones to the phone.



Actions



The next step is to set up actions. Those. what to do and under what conditions.

image

In the upper right corner, you can create a new action, consider what you need to fill out here.

image





Now we will receive timely notifications from zabbix when the triggers are rejected.



Complex screens



The following menu, it is desirable to customize this integrated screens.

image

The complex screen is a group of the same type of graphs of different machines. For example, the CPU load of all machines. This is very clear and nice :)

Let's see how to create an integrated screen. As always, in the upper right corner, click on the button to create a complex screen; here you will be asked to enter only the name and size of the complex screen. After creation, click on the name of the complex screen, a grid will appear in front of us and a change button in each cell. Change each cell under the desired schedule and save. You can view complex screens in action in Monitoring - Complex screens.

image



Detection



Just for the sake of curiosity, you can configure the detection of computers on the network. This is done using the Setup-Detection menu.

image

In my case, it is useful to find out which IP has never been used and which can be removed from the DHCP database, since Our IP space is not rubber. When creating a discovery rule, it is enough to specify the range of scanned IPs and what to check: ping, http, samba, etc.



Here are all the main things in zabbix that I wanted to tell you. If I liked the article, then I can write the second how to add my own data elements (it will be interesting, most likely only FreeBSD's), how you can control Wi-Fi routers and in general more details about everything. For the size of the images do not kick, probably not very nicely done.

Source: https://habr.com/ru/post/125340/



All Articles