Установка и настройка Zabbix
INSTALL ZABBIX
zabbix version: 7.0
os: CentOS
version: 9 stream
zabbix component: Server, Frontend, Agent
database: mysql
webserver: apache
# rpm -Uvh https://repo.zabbix.com/zabbix/7.0/centos/9/x86_64/zabbix-release-latest-7.0.el9.noarch.rpm # dnf clean all # dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent # dnf install mariadb # dnf install mariadb-server # systemctl start mariadb # mysql_secure_installation set password all answer: Y
- mysql -uroot -p
password mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin; mysql> create user zabbix@localhost identified by 'Password54321'; mysql> grant all privileges on zabbix.* to zabbix@localhost; mysql> set global log_bin_trust_function_creators = 1; mysql> quit;
- zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
- mysql -uroot -p
password mysql> set global log_bin_trust_function_creators = 0; mysql> quit;
Edit file /etc/zabbix/zabbix_server.conf
DBPassword=password
- systemctl restart zabbix-server zabbix-agent httpd php-fpm
- systemctl enable zabbix-server zabbix-agent httpd php-fpm
Открыть порт Zabbix server
- sudo firewall-cmd --zone=public --add-port=10051/tcp --permanent
Открыть порт Zabbix agent
- sudo firewall-cmd --zone=public --add-port=10050/tcp --permanent
Открыть веб-интерфейс (если используется)
- sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
- sudo firewall-cmd --zone=public --add-port=443/tcp --permanent
Применить изменения
- sudo firewall-cmd --reload
- sudo firewall-cmd --zone=public --list-ports
open: //ip_address/zabbix
default login password: Admin zabbix
INSTALL ZABBIX Agent on client vm
# rpm -Uvh https://repo.zabbix.com/zabbix/7.0/centos/9/x86_64/zabbix-release-latest-7.0.el9.noarch.rpm # sudo yum install zabbix-agent # vim /etc/zabbix/zabbix_agentd.conf
change ip add
ServerActive=127.0.0.1
- sudo systemctl restart zabbix-agent.service
{$MACRO} = variable For check SSL certificate. (run script on VM)
Item: Key = system.run[command,<mode>] Key = system.run[/opt/check_cert.sh] ./check_cert.sh $HOST=example.com $PORT=443
Config Telegram alerts
Create user: sadmin
Groups: Zabbix administrators
Set password: ********
Permissions => Role (Super admin role)
copy telegram from media type and “enable”
Open telegram:
Bot Father
/newbot
Choose name: azsmart
Username: azsmartm_bot
Copy Token: 8111611674:AAGW9ylV8qj0OV2ehmezV_kB6Qv8ICjRoak
Create group and add IDBot azsmartm_bot and you
then click /getgroupid