How to solve the error “Unknown Object Identifier (Index out of range: XXX (ifIndex))”

Once I made a Zabbix template for drawing traffic graphs from GPON ports on Huawei SmartAX MA5683T.

From Linux, I looked at the interface indexes with the command:

Continue reading “How to solve the error “Unknown Object Identifier (Index out of range: XXX (ifIndex))””

Monitoring current RX and TX network interface buffers in Zabbix

One day after restarting the Ubuntu server, due to the long start of a large number of network interfaces, my script which increased the values of the buffers and also performed other settings was performed ahead of time, respectively, the changes did not apply and I found out about this problem only after 24 hours, so I decided monitor current RX and TX buffers.

Continue reading “Monitoring current RX and TX network interface buffers in Zabbix”

Examples of Items for Zabbix

In this article I will give some examples of items for Zabbix agent and server.

Here is an example of counting the number of active processes (Element type is Zabbix agent, so I often count the number of processes nginx, apache2, sshd, named, radiusd, etc., and for a value of 0 you can make a trigger that the process does not work):

Continue reading “Examples of Items for Zabbix”

Zabbix notifications by phone via Asterisk

One night at the station, the air conditioners turned off and the temperature started to rise, naturally, I received email notifications on the phone, but since it was night, I only saw them in the morning, so it was necessary for such an emergency to quickly make the possibility of phone call notifications.

I will give an example of the variant of Zabbix alerts using a phone call through Asterisk.

Asterisk should have a module loaded, to do this, open the module configuration file, for example, in the nano editor (Ctrl+X to exit, y/n to save or cancel changes):

sudo nano /etc/asterisk/modules.conf

Continue reading “Zabbix notifications by phone via Asterisk”

Installing and Configuring Zabbix Server on Linux Ubuntu

Zabbix — system monitoring, tracking servers and network equipment.

Below I will give an example of installing Zabbix Server and Zabbix Agent from the official Ubuntu repository, if you need to install the latest version, you must first install Zabbix repositories, for example, see my article – Installing Zabbix Server 3.4 on Ubuntu 16.04

Install the server, web interface and agent:

sudo apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent traceroute fping

If during the installation did not configure the mysql parameters, then manually create the MySQL user and complete the rights to the database:

mysql -uroot -p
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'PASSWORD';
exit

We import tables into the database:

cd /usr/share/zabbix-server-mysql
sudo gunzip schema.sql.gz
sudo gunzip images.sql.gz
sudo gunzip data.sql.gz
mysql -uroot -p zabbix < schema.sql
mysql -uroot -p zabbix < images.sql
mysql -uroot -p zabbix < data.sql

Configs are located at /etc/zabbix/

The web interface configuration is located at /etc/apache2/conf-available/zabbix
If it does not exist, you can copy the template and configure:

sudo cp /etc/zabbix/apache.conf /etc/apache2/sites-enabled/zabbix.conf

Or we will make a symbolic link to the web server directory on the zabbix files:

sudo ln -s /usr/share/zabbix/ /var/www/html/

Open the configuration file PHP for example in the editor nano (CTRL+X for exit, y/n for saving or canceling the changes):

sudo nano /etc/php5/apache2/php.ini

And change some of the minimum parameters:

date.timezone = Europe/Kiev
max_execution_time 300
memory_limit 128M
post_max_size 16M
upload_max_filesize 2M
max_input_time 300

For the changes to take effect, you must restart the web server:

sudo /etc/init.d/apache2 restart

Open the web interface at http://SERVER/zabbix/ and follow the prompts for further installation.
By default, the user name for logging in through the web interface is admin, the password is zabbix.
When saving the configuration file zabbix.conf.php there will be a message that there is no write permission, so we will temporarily allow them:

sudo chmod 777 /etc/zabbix

When the configuration file is saved back:

sudo chmod 755 /etc/zabbix

Also, in the second configuration file zabbix_server.conf, the login and password for connecting to the MySQL database (same as in zabbix.conf.php):

sudo nano /etc/zabbix/zabbix_server.conf

If the message appears in the web interface that the zabbix server is not running, then you need to change the START=no parameter to START=yes in the /etc/default/zabbix-server file and execute the start command:

sudo service zabbix-server start

After installation, I recommend changing the password to admin and disabling the guest user.

Installing Zabbix Server 3.4 on Ubuntu 16.04

On the test I will install Zabbix Server 3.4 in Ubuntu Server 16.04.

First of all, we will install a repository with Zabbix 3.4 version for Ubuntu 16.04, as the old version is available in the official Ubuntu repository:

sudo wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb
sudo dpkg -i zabbix-release_3.4-1+xenial_all.deb
sudo apt update

Now run the Zabbix Server and Zabbix Agent installation command:

sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent

Connect to MySQL:

mysql -uroot -p

Create the database and the user:

create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'PASSWORD';
quit;

I import the tables into the created database:

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

Open the configuration file in a text editor and where “DBPassword” is the password for the database:

sudo nano /etc/zabbix/zabbix_server.conf

Open the configuration file in a text editor and where “DBPassword” write the password to the database:

systemctl restart zabbix-server zabbix-agent
systemctl enable zabbix-server zabbix-agent

To restart it is still possible so:

sudo service zabbix-server start

In php.ini, specify the date.timezone, for example Europe/Kiev, or uncomment it in /etc/zabbix/apache.conf if it is copied to the web server configuration:

sudo cp /etc/zabbix/apache.conf /etc/apache2/sites-enabled/zabbix.conf

Or we will make the link where we need:

sudo ln -s /usr/share/zabbix/ /var/www/html/

Open the web interface at http://SERVER/zabbix/ and follow the prompts for further installation.
By default, the user name for logging in through the web interface is admin, the password is zabbix.

See also my article:
Installing and Configuring Zabbix Server on Linux Ubuntu