顯示具有 zabbix 標籤的文章。 顯示所有文章
顯示具有 zabbix 標籤的文章。 顯示所有文章

2024年6月28日 星期五

ubuntu 安裝 zabbix-sender

 ubuntu 安裝 zabbix-sender

# wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-1+ubuntu24.04_all.deb

# sudo dpkg -i zabbix-release_7.0-1+ubuntu24.04_all.deb

# sudo 1apt update

# sudo apt install zabbix-sender

2023年8月2日 星期三

ubuntu 22.04.1 install zabbix 6.4_nginx

 ubuntu 22.04.1 install zabbix 6.4_ngnix


設定固定IP

1.sudo nano /etc/netplan/00-installer-config.yaml

設定固定IP


network:

  version: 2

  ethernets:

    ens32:

      dhcp4: false

      addresses: [192.168.0.50/24]

      routes:

      - to: default

        via: 192.168.0.1

      nameservers:

        addresses: [1.1.1.1,8.8.8.8]


重啟網路設定

sudo netplan apply


更新系統及軟體

sudo apt-get update && sudo apt-get upgrade -y


更改系統的時區

看目前時區

timedatectl


修改時區

sudo timedatectl set-timezone Asia/Taipei


安裝NTP同步時間

sudo apt install -y ntp

sudo systemctl start ntp

sudo systemctl enable ntp

------------------------------------------------------

下載Zabbix-Nginx安裝包

sudo wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb


sudo dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb

sudo apt update


sudo apt install -y zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent mysql-server


# mysql --version

# sudo systemctl start mysql.service

# sudo systemctl enable mysql.service


sudo mysql -uroot


# ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by '1qaz2wsx';


exit;


sudo mysql_secure_installation


Securing the MySQL server deployment.


Enter password for user root:


VALIDATE PASSWORD COMPONENT can be used to test passwords

and improve security. It checks the strength of password

and allows the users to set only those passwords which are

secure enough. Would you like to setup VALIDATE PASSWORD component?


Press y|Y for Yes, any other key for No: n

Using existing password for root.

Change the password for root ? ((Press y|Y for Yes, any other key for No) : n


... skipping.

By default, a MySQL installation has an anonymous user,

allowing anyone to log into MySQL without having to have

a user account created for them. This is intended only for

testing, and to make the installation go a bit smoother.

You should remove them before moving into a production

environment.


Remove anonymous users? (Press y|Y for Yes, any other key for No) : y

Success.



Normally, root should only be allowed to connect from

'localhost'. This ensures that someone cannot guess at

the root password from the network.


Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y

Success.


By default, MySQL comes with a database named 'test' that

anyone can access. This is also intended only for testing,

and should be removed before moving into a production

environment.



Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y

- Dropping test database...

Success.


- Removing privileges on test database...

Success.


Reloading the privilege tables will ensure that all changes

made so far will take effect immediately.


Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

Success.


All done!


mysql -uroot -p


# mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;

# mysql> create user zabbix@localhost identified by '1qaz2wsx';

# mysql> grant all privileges on zabbix.* to zabbix@localhost;

# mysql> set global log_bin_trust_function_creators = 1;

# mysql> SHOW VARIABLES LIKE 'char%';

# mysql> SHOW VARIABLES LIKE 'collation%';

# mysql> quit;


sudo zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix


mysql -uroot -p

mysql> set global log_bin_trust_function_creators = 0;

mysql> quit;



sudo nano /etc/zabbix/zabbix_server.conf

修改

DBPassword=1qaz2wsx


sudo nano /etc/zabbix/nginx.conf

  listen          80;

  server_name     192.168.137.243;--zabbix server ip



sudo systemctl restart zabbix-server zabbix-agent nginx php8.1-fpm

sudo systemctl enable zabbix-server zabbix-agent nginx php8.1-fpm

http://IP --設定一些規則

http://IP Admin--zabbix  --登入

---------------------------------------------------------

sudo nano /usr/share/zabbix/include/locales.inc.php #打開此文件確認中文已經打開顯示(true)

'zh_TW' => ['name' => _('Chinese (zh_TW)'),     'display' => true],


sudo apt install -y language-pack-zh-hant language-pack-zh-hans #安裝中文


sudo nano /etc/environment 

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"

添加以下2行

LANG="zh_TW.UTF-8"

LANGUAGE="zh_TW:zh:en_US:en"


sudo dpkg-reconfigure locales 


sudo systemctl restart zabbix-server zabbix-agent nginx php8.1-fpm


---------------------------------------------------------

find / -name fonts 

cd /usr/share/zabbix/assets/fonts

ls

graphfont.ttf


sudo wget https://alist.yyzq.cf/d/%20%E6%9C%AC%E5%9C%B0%E7%BD%91%E7%9B%98/software%20/fonts/simkai.ttf #下載新字體

sudo mv graphfont.ttf graphfont.ttfbak #備份原字體

sudo mv simkai.ttf graphfont.ttf #使用新字體


sudo systemctl restart zabbix-server zabbix-agent nginx php8.1-fpm

---------------------------------------------------------



資料庫出現

mysql -uroot -p

Enter password:

ERROR 1698 (28000): Access denied for user 'root'@'localhost'


解決辦法

sudo mysql -u root # I had to use "sudo" since it was a new installation


mysql> USE mysql;

mysql> SELECT User, Host, plugin FROM mysql.user;

+------------------+-----------+-----------------------+

| User             | Host      | plugin                |

+------------------+-----------+-----------------------+

| debian-sys-maint | localhost | caching_sha2_password |

| mysql.infoschema | localhost | caching_sha2_password |

| mysql.session    | localhost | caching_sha2_password |

| mysql.sys        | localhost | caching_sha2_password |

| root             | localhost | auth_socket           |

| zabbix           | localhost | caching_sha2_password |

+------------------+-----------+-----------------------+

As you can see in the query, the "root" user is using the "auth_socket" plugin.


sudo mysql -u root # I had to use "sudo" since it was a new installation


mysql> USE mysql;

mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';

mysql> FLUSH PRIVILEGES;

mysql> exit;


sudo systemctl restart mysql.service


-----------------------------------------------------

sudo apt update出現

Failed to fetch http://tw.archive.ubuntu.com/dists/jammy/InRelease


1.先ping tw.archive.ubuntu.com 是否又問題

2.如果無法ping到,修改source.list

3.cd /etc/apt

4.cp sources.list sources.list.bak

5.sudo nano sources.list

將全部http://tw.archive.ubuntu.com 改成http://archive.ubuntu.com/ubuntu/  存檔

6.再執行一次sudo apt update 

----------------------------------------------------------

linux agent 安裝

安裝ubuntu22.04.1後

到https://www.zabbix.com/download?zabbix=6.4&os_distribution=ubuntu&os_version=22.04&components=agent_2&db=&ws=

看如何安裝,注意執行動作前要記得核對版本喔!!

wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb

sudo dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb

sudo apt update


安裝 Zabbix Agent2

sudo apt install zabbix-agent2 zabbix-agent2-plugin-*


修改參數

sudo nano /etc/zabbix/zabbix_agent2.conf

Server、ServerActive 2選1

Server=192.168.137.243   ---被動提供資料給zabbix server

ServerActive=127.0.0.1   ---主動提供資料給zabbix server

Hostname=192.168.137.33  ---被監控主機IP或名稱


因為剛有調整參數,所以必須重啟服務

sudo systemctl restart zabbix-agent2 


設定開機啟動

sudo systemctl enable zabbix-agent2







免費的 Let's Encrypt 憑證,如何使用

 免費的 Let's Encrypt 憑證,如何使用


要使用 Let's Encrypt 憑證來為您的 Zabbix Server 提供 HTTPS 連接,您需要遵循以下步驟:


1. 在 Zabbix Server 上安裝 certbot 工具。Certbot 是一個由 Let's Encrypt 提供的免費工具,可以自動獲取和安裝 SSL/TLS 憑證。


您可以使用以下命令在 Ubuntu 上安裝 certbot:


sudo apt-get update

sudo apt-get install certbot


2. 啟用 certbot 來獲取 Let's Encrypt 憑證。輸入以下命令:


sudo certbot certonly --standalone -d example.com


請將 example.com 替換為您的域名或 IP 地址。


3. 完成認證流程。Certbot 將會自動向 Let's Encrypt 伺服器發送認證請求,並在成功認證後,將 SSL/TLS 憑證和相關檔案下載到 /etc/letsencrypt/live/example.com 目錄中。


4. 編輯 Zabbix Server 的配置文件 /etc/zabbix/zabbix_server.conf,找到並修改以下內容:


# 設置 Zabbix Server 使用 HTTPS 連接,啟用 SSL/TLS 加密

TLSConnect=psk

TLSAccept=psk

TLSCAFile=/etc/letsencrypt/live/example.com/chain.pem

TLSCertFile=/etc/letsencrypt/live/example.com/cert.pem

TLSKeyFile=/etc/letsencrypt/live/example.com/privkey.pem


請替換上述路徑為您實際安裝 SSL/TLS 憑證的路徑。


5. 重啟 Zabbix Server 服務以應用更改:


sudo systemctl restart zabbix-server


現在,您已經成功地使用 Let's Encrypt 憑證為您的 Zabbix Server 提供了免費的 HTTPS 連接。

zabbix 實現https登入設定

 zabbix 實現https登入設定


要實現 Zabbix 的 HTTPS 登入設定,您需要遵循以下步驟:


1. 確認已經在 Zabbix Server 上安裝了 SSL/TLS 憑證。如果還未安裝,可以使用免費的 Let's Encrypt 憑證進行安裝。


2. 編輯 Zabbix Server 的配置文件 /etc/zabbix/zabbix_server.conf,找到並修改以下內容:


# 設置 Zabbix Server 使用 HTTPS 連接,啟用 SSL/TLS 加密

TLSConnect=psk

TLSAccept=psk

TLSCAFile=/path/to/your/ca.crt

TLSCertFile=/path/to/your/server.crt

TLSKeyFile=/path/to/your/server.key


請替換上述路徑為您實際安裝 SSL/TLS 憑證的路徑。


3. 重啟 Zabbix Server 服務以應用更改:


sudo systemctl restart zabbix-server


4. 確認 Zabbix Web 界面的 Nginx 設置,使其可以使用 HTTPS 連接。找到 Nginx 設置文件 /etc/nginx/sites-available/default,找到以下內容:


listen 80 default_server;


將其修改為:


listen 443 ssl default_server;


接著,在同一個文件中找到以下內容:


server_name example.com;


替換成您的域名或 IP 地址。


最後,在同一個文件中找到以下內容:


ssl_certificate /path/to/your/server.crt;

ssl_certificate_key /path/to/your/server.key;


替換成您實際安裝 SSL/TLS 憑證的路徑。


5. 重啟 Nginx 服務以應用更改:


sudo systemctl restart nginx


現在您已經完成了 Zabbix 的 HTTPS 登入設定,可以使用 HTTPS 連接到 Zabbix Web 界面。

簡易安裝docker zabbix

 Detailed Guide – Method: 1

The example demonstrates how to run Zabbix server with MySQL database support, Zabbix web interface based on the Nginx web server and Zabbix Java gateway.


1. Create network dedicated for Zabbix component containers:

# docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 zabbix-net


2. Start empty MySQL server instance

# docker run --name mysql-server -t \

      -e MYSQL_DATABASE="zabbix" \

      -e MYSQL_USER="zabbix" \

      -e MYSQL_PASSWORD="1qaz2wsx" \

      -e MYSQL_ROOT_PASSWORD="1qaz2wsx" \

      --network=zabbix-net \

      --restart unless-stopped \

      -d mysql:8.0 \

      --character-set-server=utf8 --collation-server=utf8_bin \

      --default-authentication-plugin=mysql_native_password


3. Start Zabbix Java gateway instance

# docker run --name zabbix-java-gateway -t \

      --network=zabbix-net \

      --restart unless-stopped \

      -d zabbix/zabbix-java-gateway:alpine-6.2-latest


4. Start Zabbix server instance and link the instance with created MySQL server instance

# docker run --name zabbix-server-mysql -t \

      -e DB_SERVER_HOST="mysql-server" \

      -e MYSQL_DATABASE="zabbix" \

      -e MYSQL_USER="zabbix" \

      -e MYSQL_PASSWORD="1qaz2wsx" \

      -e MYSQL_ROOT_PASSWORD="1qaz2wsx" \

      -e ZBX_JAVAGATEWAY="zabbix-java-gateway" \

      --network=zabbix-net \

      -p 10051:10051 \

      --restart unless-stopped \

      -d zabbix/zabbix-server-mysql:alpine-6.2-latest


5. Start Zabbix web interface and link the instance with created MySQL server and Zabbix server instances

# docker run --name zabbix-web-nginx-mysql -t \

      -e ZBX_SERVER_HOST="zabbix-server-mysql" \

      -e DB_SERVER_HOST="mysql-server" \

      -e MYSQL_DATABASE="zabbix" \

      -e MYSQL_USER="zabbix" \

      -e MYSQL_PASSWORD="1qaz2wsx" \

      -e MYSQL_ROOT_PASSWORD="1qaz2wsx" \

      --network=zabbix-net \

      -p 80:8080 \

      --restart unless-stopped \

      -d zabbix/zabbix-web-nginx-mysql:alpine-6.2-latest


Zabbix web interface instance exposes 80/TCP port (HTTP) to host machine.



Zabbix server主機安裝Zabbix agent2服務

sudo mkdir /var/lib/docker/volumes/zabbix-agent2-volume

docker volume create zabbix-agent2-volume

docker run -v /etc/localtime:/etc/localtime \

      --name zabbix-agent2 \

      -v zabbix-agent2-volume:/etc/zabbix \

      -e ZBX_HOSTNAME="zabbix-server" \

      -e ZBX_SERVER_HOST="zabbix-server-mysql" \

      -p 10050:10050 \

      -e ZBX_SERVER_PORT=10051 \

      -v /opt/zabbix/agent2/modules:/var/lib/zabbix/modules \

      --privileged \

      --network=zabbix-net \

      --restart unless-stopped \

      -d zabbix/zabbix-agent2:ubuntu-6.0-latest


給/var/run/docker.sock 所有用戶可讀權限(zabbix用戶)

sudo chmod 666 /var/run/docker.sock

ubuntu 22.04.1 install zabbix 6.4_apache2

 設定固定IP選1或2

1.sudo nano /etc/netplan/00-installer-config.yaml

設定固定IP


network:

  version: 2

  ethernets:

    ens32:

      dhcp4: false

      addresses: [192.168.0.50/24]

      routes:

      - to: default

        via: 192.168.0.1

      nameservers:

        addresses: [1.1.1.1,8.8.8.8]

或


network:

  version: 2

  ethernets:

    eth0:

      dhcp4: false

      addresses: [192.168.137.214/24]

      routes:

      - to: default

        via: 192.168.137.1

      nameservers:

        addresses: [1.1.1.1,8.8.8.8]



重啟網路設定

sudo netplan apply


2.設定固定IP

sudo nano /etc/netplan/00-installer-config.yaml

例如:

# This is the network config written by 'subiquity'

network:

  ethernets:

    eth0:

      dhcp4: no

      addresses: [192.168.137.200/24]

      optional: true

      gateway4: 192.168.137.1

      nameservers:

        addresses: [172.30.156.1, 172.30.156.20]

  version: 2


重啟網路設定

sudo netplan apply


更新系統及軟體

sudo apt-get update && sudo apt-get upgrade -y


更改系統的時區

看目前時區

timedatectl


修改時區

sudo timedatectl set-timezone Asia/Taipei


安裝NTP同步時間

sudo apt install -y ntp

sudo systemctl start ntp

sudo systemctl enable ntp

------------------------------------------------------

下載Zabbix-Nginx安裝包

sudo wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb


sudo dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb

sudo apt update


sudo apt -y install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent zabbix-get mysql-server


# mysql --version

# sudo systemctl start mysql.service

# sudo systemctl enable mysql.service


sudo mysql -uroot


# ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by '1qaz2wsx';


exit;


sudo mysql_secure_installation


Securing the MySQL server deployment.


Enter password for user root:


VALIDATE PASSWORD COMPONENT can be used to test passwords

and improve security. It checks the strength of password

and allows the users to set only those passwords which are

secure enough. Would you like to setup VALIDATE PASSWORD component?


Press y|Y for Yes, any other key for No: n

Using existing password for root.

Change the password for root ? ((Press y|Y for Yes, any other key for No) : n


... skipping.

By default, a MySQL installation has an anonymous user,

allowing anyone to log into MySQL without having to have

a user account created for them. This is intended only for

testing, and to make the installation go a bit smoother.

You should remove them before moving into a production

environment.


Remove anonymous users? (Press y|Y for Yes, any other key for No) : y

Success.



Normally, root should only be allowed to connect from

'localhost'. This ensures that someone cannot guess at

the root password from the network.


Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y

Success.


By default, MySQL comes with a database named 'test' that

anyone can access. This is also intended only for testing,

and should be removed before moving into a production

environment.



Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y

- Dropping test database...

Success.


- Removing privileges on test database...

Success.


Reloading the privilege tables will ensure that all changes

made so far will take effect immediately.


Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

Success.


All done!


mysql -uroot -p


# mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;

# mysql> create user zabbix@localhost identified by '1qaz2wsx';

# mysql> grant all privileges on zabbix.* to zabbix@localhost;

# mysql> set global log_bin_trust_function_creators = 1;

# mysql> SHOW VARIABLES LIKE 'char%';

# mysql> SHOW VARIABLES LIKE 'collation%';

# mysql> quit;


sudo zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix


mysql -uroot -p

mysql> set global log_bin_trust_function_creators = 0;

mysql> quit;



sudo nano /etc/zabbix/zabbix_server.conf

修改

DBPassword=Taisugar1


sudo systemctl restart zabbix-server zabbix-agent apache2

sudo systemctl enable zabbix-server zabbix-agent apache2

http://IP/zabbix    Admin--zabbix

---------------------------------------------------------

sudo nano /usr/share/zabbix/include/locales.inc.php #打開此文件確認中文已經打開顯示(true)

'zh_TW' => ['name' => _('Chinese (zh_TW)'),     'display' => true],


sudo apt install -y language-pack-zh-hant language-pack-zh-hans #安裝中文


sudo nano /etc/environment 

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"

添加以下2行

LANG="zh_TW.UTF-8"

LANGUAGE="zh_TW:zh:en_US:en"


sudo dpkg-reconfigure locales 


sudo systemctl restart zabbix-server zabbix-agent apache2


---------------------------------------------------------

find / -name fonts 

cd /usr/share/zabbix/assets/fonts

ls

graphfont.ttf


sudo wget https://alist.yyzq.cf/d/%20%E6%9C%AC%E5%9C%B0%E7%BD%91%E7%9B%98/software%20/fonts/simkai.ttf #下載新字體

sudo mv graphfont.ttf graphfont.ttfbak #備份原字體

sudo mv simkai.ttf graphfont.ttf #使用新字體


sudo systemctl restart zabbix-server.service apache2

---------------------------------------------------------



資料庫出現

mysql -uroot -p

Enter password:

ERROR 1698 (28000): Access denied for user 'root'@'localhost'


解決辦法

sudo mysql -u root # I had to use "sudo" since it was a new installation


mysql> USE mysql;

mysql> SELECT User, Host, plugin FROM mysql.user;

+------------------+-----------+-----------------------+

| User             | Host      | plugin                |

+------------------+-----------+-----------------------+

| debian-sys-maint | localhost | caching_sha2_password |

| mysql.infoschema | localhost | caching_sha2_password |

| mysql.session    | localhost | caching_sha2_password |

| mysql.sys        | localhost | caching_sha2_password |

| root             | localhost | auth_socket           |

| zabbix           | localhost | caching_sha2_password |

+------------------+-----------+-----------------------+

As you can see in the query, the "root" user is using the "auth_socket" plugin.


sudo mysql -u root # I had to use "sudo" since it was a new installation


mysql> USE mysql;

mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';

mysql> FLUSH PRIVILEGES;

mysql> exit;


sudo systemctl restart mysql.service



2022年11月21日 星期一

ubuntu 簡易安裝docker zabbix

 ubuntu要先安裝docker及docker-compose

Detailed Guide – Method: 1

The example demonstrates how to run Zabbix server with MySQL database support, Zabbix web interface based on the Nginx web server and Zabbix Java gateway.


1. Create network dedicated for Zabbix component containers:

# docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 zabbix-net


2. Start empty MySQL server instance

# docker run --name mysql-server -t \

      -e MYSQL_DATABASE="zabbix" \

      -e MYSQL_USER="zabbix" \

      -e MYSQL_PASSWORD="zabbix_pwd" \

      -e MYSQL_ROOT_PASSWORD="root_pwd" \

      --network=zabbix-net \

      -d mysql:5.7 \

      --character-set-server=utf8 --collation-server=utf8_bin


3. Start Zabbix Java gateway instance

# docker run --name zabbix-java-gateway -t \

      --network=zabbix-net \

      --restart unless-stopped \

      -d zabbix/zabbix-java-gateway:alpine-5.4-latest


4. Start Zabbix server instance and link the instance with created MySQL server instance

# docker run --name zabbix-server-mysql -t \

      -e DB_SERVER_HOST="mysql-server" \

      -e MYSQL_DATABASE="zabbix" \

      -e MYSQL_USER="zabbix" \

      -e MYSQL_PASSWORD="zabbix_pwd" \

      -e MYSQL_ROOT_PASSWORD="root_pwd" \

      -e ZBX_JAVAGATEWAY="zabbix-java-gateway" \

      --network=zabbix-net \

      -p 10051:10051 \

      --restart unless-stopped \

      -d zabbix/zabbix-server-mysql:alpine-5.4-latest


5. Start Zabbix web interface and link the instance with created MySQL server and Zabbix server instances

# docker run --name zabbix-web-nginx-mysql -t \

      -e ZBX_SERVER_HOST="zabbix-server-mysql" \

      -e DB_SERVER_HOST="mysql-server" \

      -e MYSQL_DATABASE="zabbix" \

      -e MYSQL_USER="zabbix" \

      -e MYSQL_PASSWORD="zabbix_pwd" \

      -e MYSQL_ROOT_PASSWORD="root_pwd" \

      --network=zabbix-net \

      -p 80:8080 \

      --restart unless-stopped \

      -d zabbix/zabbix-web-nginx-mysql:alpine-5.4-latest


Zabbix web interface instance exposes 80/TCP port (HTTP) to host machine.



Zabbix server主机安装Zabbix agent2服务

#sudo mkdir /var/lib/docker/volumes/zabbix-agent2-volume

#docker volume create zabbix-agent2-volume

#docker run -v /etc/localtime:/etc/localtime \

      --name zabbix-agent2 \

      -v zabbix-agent2-volume:/etc/zabbix \

      -e ZBX_HOSTNAME="zabbix-server" \

      -e ZBX_SERVER_HOST="zabbix-server-mysql" \

      -p 10050:10050 \

      -e ZBX_SERVER_PORT=10051 \

      -v ${server_dir}/agent2/modules:/var/lib/zabbix/modules \

      --privileged \

      --network=zabbix-net \

      --restart unless-stopped \

      -d zabbix/zabbix-agent2:ubuntu-6.0-latest