zabbix - mata-elang-stable/mataelang-platform GitHub Wiki
We use Zabbix as a monitoring system for Mata Elang.

| Item | Value |
|---|---|
| Zabbix server | 172.16.2.110 |
| Zabbix agent | (Installed on all sensors and servers) |
| Zabbix user / password | Admin (default password is zabbix) |
| MySQL root user / password | root (password will be set below) |
| MySQL zabbix user / password | zabbix (password will be set below) |
ā Ubuntu 20.04 LTS installed and updated with the following command.
sudo apt update && sudo apt -y upgradeā Time Zone and NTP already set.
ā Docker 20.10 or later installed with the following command.
sudo apt -y install docker.ioā Docker Compose 2.13 or later installed with the following command.
sudo curl -L "https://github.com/docker/compose/releases/download/v2.13.0/docker-compose-$(uname -s)-$(uname -m)"\
-o /usr/bin/docker-compose && sudo chmod +x /usr/bin/docker-composegit clone https://github.com/mata-elang-stable/zabbix-asset.git ~/zabbix.MYSQL_ROOT_PASSWORD to change the MySQL root password before initial setup.
nano ~/zabbix/env_vars/.MYSQL_ROOT_PASSWORD.MYSQL_PASSWORD to change the MySQL zabbix password before initial setup.
nano ~/zabbix/env_vars/.MYSQL_PASSWORDsudo docker-compose -f ~/zabbix/docker-compose.yaml up -dā Confirm the containers are running.
sudo docker-compose -f ~/zabbix/docker-compose.yaml ps -aResult
NAME COMMAND SERVICE STATUS PORTS
zabbix-db_data_mysql-1 "sh" db_data_mysql exited (0)
zabbix-mysql-server-1 "docker-entrypoint.sā¦" mysql-server running
zabbix-zabbix-server-1 "/usr/bin/tini -- /uā¦" zabbix-server running 0.0.0.0:10051->10051/tcp, :::10051->10051/tcp
zabbix-zabbix-web-nginx-mysql-1 "docker-entrypoint.sh" zabbix-web-nginx-mysql running (healthy) 0.0.0.0:80->8080/tcp, :::80->8080/tcp, 0.0.0.0:443->8443/tcp, :::443->8443/tcp
wget -P ~/zabbix https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2-4%2Bubuntu20.04_all.debsudo dpkg -i ~/zabbix/zabbix-release_6.2-4+ubuntu20.04_all.debsudo apt update && sudo apt -y install zabbix-agentzabbix_agentd.conf to configure the agent.
sudo nano /etc/zabbix/zabbix_agentd.confConfiguration
š Set the IP address of the Zabbix servers to ZABBIX_SERVER_IP_OR_NAME.
ā The additional value 172.16.238.0/24, which was set on docker-compose.yaml, is required when the Zabbix server and agent run on the same host.
š Set a hostname you like for the Zabbix agent to HOSTNAME_OF_AGENT. It's recommended to name differently for each agent to identify easily.
### Line 117: Set the IP or DNS names of the Zabbix server
#Server=127.0.0.1
Server=<ZABBIX_SERVER_IP_OR_NAME (e.g. 172.16.2.110)>,172.16.238.0/24
### Line 182: Set the hostname of the Zabbix agent.
#Hostname=Zabbix server
Hostname=<HOSTNAME_OF_AGENT (e.g. zabbix)>
sudo systemctl enable zabbix-agentsudo systemctl restart zabbix-agentā Confirm the agent service is active.
systemctl status zabbix-agentClick here to see the result.
ā zabbix-agent.service - Zabbix Agent
Loaded: loaded (/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2023-01-01 00:17:15 WIB; 39s ago
- URL:
http://<ZABBIX_SERVER_IP_OR_NAME (e.g. 172.16.2.110)>/
š The followings are what you should do for monitoring servers.
- Change Admin password.
- Change the time zone of the Admin user.
- Change the interface (IP address) of the host named "Zabbix server" from 127.0.0.1 to the actual address.
- Create hosts in configuration menu, as many as you need to monitor. (name, template, group, interface type, and IP address)
- Configure notifications. (media types, users, and actions)
How to change Admin password and time zone.

How to create a host.
| Item | Value |
|---|---|
| Host name | Monitored hostname |
| Templates | [Select] -> Templates/Operating systems -> Linux by Zabbix agent
|
| Groups | [Select] -> Linux servers
|
| Interfaces | [Add] -> Agent -> IP address of Monitored host |
- And then save your configuration.
- Wait until Zabbix Server identifies your monitored host.
- If your configuration is correct, the availability sign will turn green.
How to add an email notification.
Email.
- Configure
Emailsettings. - Test the settings.
Admin.
- Attach [Media (Email)] to
Admin. - Set an email address to [Send to].
- Attach
Admin (Zabbix Administrator)to [Send to users].
Click to view screen image

Click to show commands
ā Show service status
sudo docker-compose -f ~/zabbix/docker-compose.yaml ps -aResult
NAME COMMAND SERVICE STATUS PORTS
zabbix-db_data_mysql-1 "sh" db_data_mysql exited (0)
zabbix-mysql-server-1 "docker-entrypoint.sā¦" mysql-server running
zabbix-zabbix-server-1 "/usr/bin/tini -- /uā¦" zabbix-server running 0.0.0.0:10051->10051/tcp, :::10051->10051/tcp
zabbix-zabbix-web-nginx-mysql-1 "docker-entrypoint.sh" zabbix-web-nginx-mysql running (healthy) 0.0.0.0:80->8080/tcp, :::80->8080/tcp, 0.0.0.0:443->8443/tcp, :::443->8443/tcp
ā Start services
sudo docker-compose -f ~/zabbix/docker-compose.yaml up -dā Stop services (and remove containers)
sudo docker-compose -f ~/zabbix/docker-compose.yaml downā Stop services (and keep containers)
sudo docker-compose -f ~/zabbix/docker-compose.yaml stopā Restart services
sudo docker-compose -f ~/zabbix/docker-compose.yaml restartā Show agent status
systemctl status zabbix-agentResult
ā zabbix-agent.service - Zabbix Agent
Loaded: loaded (/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2023-01-01 00:17:15 WIB; 39s ago
ā Start agent
sudo systemctl start zabbix-agentā Stop agent
sudo systemctl stop zabbix-agentā Restart agent
sudo systemctl restart zabbix-agentā Login to MySQL
sudo docker-compose -f ~/zabbix/docker-compose.yaml exec mysql-server mysql -u zabbix -psudo docker-compose -f ~/zabbix/docker-compose.yaml exec mysql-server mysql -u root -pā Clean up the Zabbix server installation including MySQL database.
sudo docker ps -a
sudo docker images -a
sudo docker network ls
sudo docker volume ls
sudo docker system prune -a
sudo docker volume prune
sudo rm -rf ~/zabbix/zbx_envā Show environment variables
sudo docker inspect --format='{{range .Config.Env}}{{println .}}{{end}}' zabbix-zabbix-server-1sudo docker inspect --format='{{range .Config.Env}}{{println .}}{{end}}' zabbix-zabbix-web-nginx-mysql-1sudo docker inspect --format='{{range .Config.Env}}{{println .}}{{end}}' zabbix-mysql-server-1ā Show Zabbix Server log
sudo docker-compose -f ~/zabbix/docker-compose.yaml logs zabbix-serversudo docker-compose -f ~/zabbix/docker-compose.yaml logs zabbix-web-nginx-mysqlsudo docker-compose -f ~/zabbix/docker-compose.yaml logs mysql-serverā Show Zabbix Agent log
cat /var/log/zabbix/zabbix_agentd.logā Show Zabbix Server version
sudo docker-compose -f ~/zabbix/docker-compose.yaml exec zabbix-server zabbix_server -Vā Show nginx version
sudo docker-compose -f ~/zabbix/docker-compose.yaml exec zabbix-web-nginx-mysql nginx -vā Show MySQL version
sudo docker-compose -f ~/zabbix/docker-compose.yaml exec mysql-server mysql --versionā Show Zabbix Agent version
zabbix_agentd --versionā Show Docker version
sudo docker versionā Show Docker Compose version
docker-compose versionā Show OS version
cat /etc/os-release