Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Linux / Zabbix Installation and Basic Configuration Guide

May 10, 2023 CentOSLinuxUbuntuWindows Server 2016

Zabbix Installation and Basic Configuration Guide

Zabbix is an enterprise-level open-source monitoring system. Currently, Zabbix is one of the most popular and powerful free monitoring systems. Due to its simple installation and configuration, Zabbix may be used to monitor large infrastructures with hundreds of hosts, as well as small configurations. In this article we’ll show you how to install and configure basic features of a Zabbix server 5.0  with a web interface on Linux Ubuntu and CentOS, and how to install Zabbix agent on a server running Windows or Linux and add new hosts for monitoring.

You can see the Zabbix server dashboard interface on a screenshot below.

zabbix dashboard

Contents:
  • How to Install Zabbix Server on Linux (Ubuntu, CentOS)?
  • Zabbix Web Interface Configuration
  • How to Install Zabbix Agent on Windows?
  • How to Add New Host on Zabbix Server?
  • Installing Zabbix Agent on Linux

Simple and easy-to-configure Zabbix is written on C (a server, a proxy, and an agent) and PHP (frontend). Zabbix Server and Zabbix Proxy work in Linux systems only. The Zabbix agent can be installed on a wide variety of supported operating systems and platforms.

Zabbix server installation consists of:

  • A zabbix_server binary (usually, it is working as a service);
  • MySQL/MariaDB/PostgreSQL database;
  • Apache2/Nginx web server with a PHP handler;
  • Frontend site files (.php, .js, .css, etc.).

Usually, the operating scheme looks like this:

  • A Zabbix agent sends data to a server;
  • A Zabbix server receives and processes the data;
  • If the received data meet the specified conditions, a trigger is activated;
  • The activated trigger indicates that there is a problem. A notification appears in the frontend (on a site), and depending on the configuration, an email notification is sent or some actions are performed (for example, a monitored service is restarted).

Zabbix can work with all known protocols. Thanks to the ability to use external scripts, Zabbix can execute and receive data from any executable scripts/binaries.

How to Install Zabbix Server on Linux (Ubuntu, CentOS)?

In this tutorial we’ll show how to install Zabbix Server on Linux (Ubuntu Server 18.4 and CentOS 8) using a package manager.

Go to the download page https://www.zabbix.com/download and select the repository that matches your Linux distribution. There are ready packages for all popular Linux distros.

For example, to install Zabbix on Ubuntu 18.04, select the following in turn:

Zabbix Version (5.0 LTS) -> OS Distribution (Ubuntu) -> OS Version (18.04 Bionic) -> Database (MySQL) -> Web server (Nginx or Apache).

download and install zabbix on linux

Download and add the repository:

# wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+bionic_all.deb
# dpkg -i zabbix-release_5.0-1+bionic_all.deb
# apt update

Then you can install the required packages:

# apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-agent

apt install zabbix-server-mysql on ubuntu

To install Zabbix on CentOS 8/RHEL 8, connect the repository with the latest Zabbix version (you can install Zabbix from the 4.0/5.0 LTS branch or the latest Zabbix 5.2):

# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
# dnf clean all

Suppose that nginx, MySQL/MariaDB, php and php-fpm are already installed on the server. Use the dnf (yum) package manager to install Zabbix Server and the agent:

# dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-agent

Then create a database for Zabbix in MySQL (you can use PostgreSQL instead of MySQL, just replace ‘mysql’ with ‘pgsql’ in the previous commands).

Create a database and grant permissions to the user account, under which Zabbix will access the DB:

mysql -uroot
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'ZabbixP@$$w0rd';
mysql> quit;

Import the Zabbix database. Enter the password you specified when you created a user.

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

Edit /etc/zabbix/zabbix_server.conf, specify the password of the user you have created.

DBPassword=Zabbix_User_Password

Since in my case nginx is used as a web server, edit nginx.conf by uncommenting the following lines:

# listen 80;
# server_name example.com;

Remove # and replace example.com with the Zabbix server hostname. In my case it is test.zabbix.local.

For Apache, edit /etc/httpd/conf.d/zabbix.conf.

Set the time zone in PHP. Uncomment the following line in /etc/zabbix/php-fpm.conf:

php_value[date.timezone] = Canada/Pacific
Make sure that the time on your Zabbix server is synchronized with a reliable NTP source.

You can also set these PHP parameters in /etc/php.ini:

memory_limit 128M
upload_max_filesize 8M
post_max_size 16M
max_execution_time 300
max_input_time 300
max_input_vars 10000

Add the zabbix-server service to startup and run it:

# systemctl enable zabbix-server zabbix-agent nginx php7.2-fpm
# systemctl restart zabbix-server zabbix-agent nginx php7.2-fpm

Zabbix Web Interface Configuration

Now you must configure Zabbix frontent (web interface). Open the Zabbix server URL specified earlier in a browser. In my case, it is test.zabbix.local (or the domain you have specified. Remember to register it in your hosts file or on the DNS server). Make sure that OK is shown next to all installer requirements.

zabbix install script

Specify the database connection parameters and user credentials to connect to the DB. Use the username and password created earlier.

configure zabbix connection to mysql database

Specify the name of your Zabbix server. I recommend to leave the default port – TCP 10051.

By default, Zabbix uses two network ports:

  • TCP 10050 — passive agent port, which Zabbix server uses to poll clients;;
  • TCP 10051 — port through which Zabbix server receives data from clients (active agents).

Remember to open these ports on firewall. For example, on a Zabbix server running CentOS you can open the ports in firewalld using firewall-cmd:

# firewall-cmd --add-service={http,https} --permanentfirewall-cmd --add-port={10051/tcp,10050/tcp} –permanent

It is enough to open port 10050 on the agent:

# firewall-cmd --permanent --add-port=10050/tcp

Restart firewalld:

# firewall-cmd –reload

set zabbix server hostname and port 10051

Then click Next Step and Finish. After the installation, you will be prompted to login. The default login is Admin, the default password is zabbix (change it).

zabbix dashboard login webpage

Zabbix Server installation is over.

You can find step-by-step instructions on Zabbix Server installation on other OS and the guides on how to build zabbix-server from the source code or run it in docker containers on https://www.zabbix.com/download.

You can configure Zabbix to authenticate users using Active Directory LDAP.

How to Install Zabbix Agent on Windows?

Let’s try to install a Zabbix agent on a server running Windows and add it to our Zabbix monitoring server. You can download a Zabbix agent version for Windows here: https://www.zabbix.com/download_agents. download zabbix agent for windows server

Select the agent version you need. I will choose msi (amd64) (without OpenSSL). If you are going to install Zabbix Agent on domain servers/computers using GPO or SCCM, you can download a ZIP archive with binary and configuration files.

Run the installer, accept the license agreement and specify the settings for connecting to the Zabbix server. Please note that in the “Server or Proxy for active checks” field I have entered an IP address in the IP:PORT format. Since I left a default port, I have entered 192.168.20.30:10051.

configure zabbix agent settings on windows

Click Next a couple of times, then click Install.

Make sure that the agent has been installed. Zabbix Agent must appear in the list of services.

zabbixagent windows service

Allow inbound connections from your Zabbix server IP address in Windows Firewall on your Windows host:

New-NetFirewallRule -DisplayName "ZabbixMonitoring" –RemoteAddress 192.168.20.30 -Direction Inbound -Protocol TCP –LocalPort 10050 -Action Allow

How to Add New Host on Zabbix Server?

To make sure that the agent is operable, add testnode2 host to your Zabbix server and assign some checks (templates) to it.

Note. There are 2 types of checks in Zabbix:

  • Passive — a Zabbix server requests some data from the agent;
  • Active — the agent is sending data to the server.

During the agent installation, we specified the server as IP:PORT for active checks.

You can add a new monitoring host via Zabbix web interface. Go to Configuration -> Hosts.

Click Create host and fill in the details. Note that the Host name must exactly match the device hostname or the value of the Hostname parameter in the agent configuration file.

adding new host to zabbix

Add built-in Windows templates in the Templates tab. Templates in Zabbix are sets of values, triggers, graphs and discovery rules that may be assigned to one or more hosts.

The built-in templates have “active” label, and it means that active checks will be used.

linking zabbix templates to host

Click Add. In order not to wait till the server and agent see each other (it usually takes a couple of minutes), restart Zabbix Agent service on the testnode2 and view the agent log (C:\Program Files\Zabbix Agent\zabbix_agentd.txt).

restart zabbix agent on linux

zabbix_agentd log file

The “started [active checks #1]” message means that some active checks for the host have been found on the server. Then have a look at the data that your Zabbix server received from the agent. To do it, go to Monitoring -> Latest Data and select the host in the Hosts field.

zabbix host dashboard

This section shows the latest data on the selected host or groups of hosts that have come to the Zabbix server.

Please note that in my case the Zabbix dashboard contains a notification that the BITS service is not running. The notification appeared since we assigned built-in templates to our host. One of the templates has a BITS check, and the corresponding trigger activated if the BITS service is no in the Running state.

view dashboard in zabbix

The Agent for Windows is configured.

Installing Zabbix Agent on Linux

Let’s install Zabbix Agent on Linux. To install Zabbix Agent on Ubuntu Server 18.04 using a package manager, download and the install Zabbix repo. Then install Zabbix Agent from the repository:
# wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+$(lsb_release -sc)_all.deb
# sudo dpkg -i zabbix-release_5.0-1+$(lsb_release -sc)_all.deb
# sudo apt update
# sudo apt -y install zabbix-agent

To add the repository and install Zabbix Agent on CentOS, use these commands:
# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
# dnf clean all
# dnf install zabbix-agent

Prior to starting Zabbix agent, edit the configuration file /etc/zabbix/zabbix_agentd.conf. Specify the IP address of your Zabbix server for active checks.

Server=IP
ServerActive=192.168.20.30:10051
Hostname=testagent

Then start the agent service:

# service zabbix-agent start

Make sure that the agent has started successfully.

# cat /var/log/zabbix/zabbix_agentd.log

zabbix_agentd.log - cannot parse list of active checks

The line “cannot parse list of active checks” means that there are no active checks for the host on the server.

Like with Windows agent, you must add your Linux host to Zabbix . Note the Host name parameter in the host settings of your Zabbix server: it must match the Hostname parameter we have specified in the Zabbix Agent configuration file. In the config file above I specified the host name as testagent.

linking zabbix template to linux host

Restart your Zabbix agent and check the log. Make sure that data from the agent have appeared on your Zabbix server. Zabbix agent on Linux is configured.
In the next article we’ll look at agentless monitoring of host availability in Zabbix via ICMP Ping.

0 comment
1
Facebook Twitter Google + Pinterest
previous post
How to Detect Who Deleted a File on Windows Server with Audit Policy?
next post
Windows: Block Remote Network Access for Local User Accounts

Related Reading

How to Increase Size of Disk Partition in...

October 5, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

Redirect HTTP to HTTPS in IIS (Windows Server)

September 7, 2023

Add an Additional Domain Controller to an Existing...

September 6, 2023

How to Install an SSL Certificate on IIS...

September 5, 2023

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023
  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Configure MariaDB Master-Master/Slave Replication?
  • How to Mount Google Drive or OneDrive in Linux?
  • KVM: How to Expand or Shrink a Virtual Machine Disk Size?
  • Adding VLAN Interface in CentOS/Fedora/RHEL
  • Install and Configure SNMP on RHEL/CentOS/Fedor
  • Configuring High Performance NGINX and PHP-FPM Web Server
  • How to Install and Use ClamAV Antivirus on CentOS/RHEL?
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top