日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Zabbix学习之路(一)之Zabbix安装

發布時間:2024/10/12 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Zabbix学习之路(一)之Zabbix安装 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
  • 一、Zabbix環境準備

[root@linux-node1 ~]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) [root@linux-node1 ~]# uname -r 3.10.0-693.5.2.el7.x86_64 [root@linux-node1 ~]# getenforce Disabled [root@linux-node1 ~]# systemctl stop firewalld Failed to stop firewalld.service: Unit firewalld.service not loaded. [root@linux-node1 ~]# ifconfig eth0|awk -F '[ :]+' 'NR==2{print $3}' 192.168.56.11 [root@linux-node1 ~]# hostname linux-node1 [root@linux-node1 ~]# yum install -y ntpdate [root@linux-node1 ~]# ntpdate time1.aliyun.com [root@linux-node1 ~]# crontab -e */5 * * * * /usr/sbin/ntpdate time1.aliyun.com &>/dev/null
  • 二、Zabbix安裝

Zabbix存儲配置包以及yum配置文件[root@linux-node1 ~]# rpm -ivh http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm [root@linux-node1 ~]# yum list |grep zabbixZabbix程序包安裝,以及MySQL、Zabbix-agent [root@linux-node1 ~]# yum install -y zabbix-server-mysql zabbix-web-mysql mariadb-server zabbix-agent
  • 三、初始化數據庫

創建Zabbix數據庫以及用戶 [root@linux-node1 ~]# systemctl start mariadb [root@linux-node1 ~]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y/n] Y New password: 123456 Re-enter new password: 123456 Password updated successfully! Reloading privilege tables..... Success! [root@linux-node1 ~]# mysql -uroot -p Enter password: 123456 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 Server version: 10.1.20-MariaDB MariaDB Server Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin; Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> quit; Bye導入初始模式和數據: [root@linux-node1 ~]# zcat /usr/share/doc/zabbix-server-mysql-3.0.13/create.sql.gz |mysql -uzabbix -p zabbix Enter password: zabbix [root@linux-node1 ~]# mysql -uroot -p123456 -e "use zabbix;show tables;" +----------------------------+ | Tables_in_zabbix | +----------------------------+ | acknowledges | | actions | | alerts | | application_discovery | | application_prototype | | application_template | | applications | | auditlog | | auditlog_details | | autoreg_host | | conditions | | config | |......   | +----------------------------+
  • 四、Zabbix服務器進程啟動

在Zabbix_server.conf編輯數據庫配置 [root@linux-node1 ~]# grep ^[a-Z] /etc/zabbix/zabbix_server.conf LogFile=/var/log/zabbix/zabbix_server.log LogFileSize=0 PidFile=/var/run/zabbix/zabbix_server.pid DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix SNMPTrapperFile=/var/log/snmptrap/snmptrap.log Timeout=4 AlertScriptsPath=/usr/lib/zabbix/alertscripts ExternalScripts=/usr/lib/zabbix/externalscripts LogSlowQueries=3000啟動Zabbix服務器進程 [root@linux-node1 ~]# systemctl enable zabbix-server#默認端口為10051 [root@linux-node1 ~]# systemctl start zabbix-server
  • 五、編輯Zabbix前端PHP配置

Apache的配置文件/etc/httpd/conf.d/zabbix.conf,取消注釋,設置正確的時區:Asia/Shanghai[root@linux-node1 ~]# vim /etc/httpd/conf.d/zabbix.conf php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 php_value always_populate_raw_post_data -1 php_value date.timezone Asia/Shanghai通過改變配置文件啟動Apache Web服務器[root@linux-node1 ~]# vim /etc/httpd/conf/httpd.conf Severname 127.0.0.1:80 [root@linux-node1 ~]# systemctl enable httpd.service Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service. [root@linux-node1 ~]# systemctl start httpd.service [root@linux-node1 ~]# netstat -lntp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 863/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2085/master tcp6 0 0 :::80 :::* LISTEN 21955/httpd tcp6 0 0 :::22 :::* LISTEN 863/sshd tcp6 0 0 ::1:25 :::* LISTEN 2085/master tcp6 0 0 :::3306 :::* LISTEN 21820/mysqld
  • 六、Zabbix的web安裝

step1:

在瀏覽器中,打開Zabbix?URL:http:// <server_ip_or_name> /?zabbix

step2:

確保滿足所有軟件的先決條件。

step3:

輸入連接到數據庫的詳細信息。Zabbix數據庫必須已經創建。

step4:

輸入Zabbix服務器的詳細信息。

step5:

查看設置摘要。

step6:

完成安裝,會在/etc/zabbix/web/zabbix.conf.php生成配置文件

當數據庫遇到瓶勁,在進行數據庫拆分的時候,需要修改配置文件/etc/zabbix/web/zabbix.conf.php,指向新的數據庫地址。 [root@linux-node1 ~]# vim /etc/zabbix/web/zabbix.conf.php <?php // Zabbix GUI configuration file. global $DB; $DB['TYPE'] = 'MYSQL'; $DB['SERVER'] = 'localhost'; $DB['PORT'] = '0'; $DB['DATABASE'] = 'zabbix'; $DB['USER'] = 'zabbix'; $DB['PASSWORD'] = 'zabbix'; // Schema name. Used for IBM DB2 and PostgreSQL. $DB['SCHEMA'] = ''; $ZBX_SERVER = 'localhost'; $ZBX_SERVER_PORT = '10051'; $ZBX_SERVER_NAME = ''; $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;

step7:

Zabbix前端準備就緒!默認的用戶名是Admin,密碼zabbix。

?

轉載于:https://www.cnblogs.com/linuxk/p/9450616.html

總結

以上是生活随笔為你收集整理的Zabbix学习之路(一)之Zabbix安装的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。