Установка и настройка Zabbix: Difference between revisions
No edit summary |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 105: | Line 105: | ||
'''Paste Token and GroupID''' : | '''Paste Token and GroupID''' : | ||
P.S. in new version Zabbix 7.0 template was change. For issue | P.S. in new version Zabbix 7.0 template was change. For issue download telegram template this: | ||
<nowiki>https://github.com/zabbix/zabbix/tree/release/6.0/templates/media/telegram</nowiki> | <nowiki>https://github.com/zabbix/zabbix/tree/release/6.0/templates/media/telegram</nowiki> | ||
Choose 6.0 version | Choose 6.0 version or | ||
[https://git.initmax.cz/zabbix/zabbix/-/blob/78774f702f8d222235c6e5a8b27db9490386c2e9/templates/media/telegram/media_telegram.yaml Zabbix Telegram Template] | |||
[[File:Zabbix3.jpg|center|thumb|941x941px]] | [[File:Zabbix3.jpg|center|thumb|941x941px]] | ||
Create user, set password: | Create user, set password: | ||
Latest revision as of 06:07, 14 October 2025
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


Paste Token and GroupID :
P.S. in new version Zabbix 7.0 template was change. For issue download telegram template this:
https://github.com/zabbix/zabbix/tree/release/6.0/templates/media/telegram
Choose 6.0 version or

Create user, set password:

and set role:

Open Alerts => Actions => Add Conditions (Host group)



Users => Users => select user => Media => Add
Send to: <groupID>
