Centos6系統RPM包安裝Zabbix3.0
1、安裝MySQL
1
2
|
#rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm #yum install -y mysql-server mysql-devel |
1
2
3
4
5
6
7
8
|
service mysqld start mysql_secure_installation #MySQL安全配置嚮導 Enter current password for root (enter for none): <–初次執行直接回車
Set root password? [Y /n ] <– 是否設定root使用者密碼,輸入y並回車或直接回車 Remove anonymous users ? [Y /n ] <– 是否刪除匿名使用者,生產環境建議刪除,所以直接回車 Disallow root login remotely? [Y /n ] <–是否禁止root遠端登入,根據自己的需求選擇Y /n 並回車,建議禁止 Remove test database and access to it? [Y /n ] <– 是否刪除 test 資料庫,直接回車
Reload privilege tables now? [Y /n ] <– 是否重新載入許可權表,直接回車 |
1
2
3
4
5
|
mysql -uroot -p mysql> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin; mysql> GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY `zabbix` ; mysql> flush privileges; mysql> show databases; |
更改資料庫配置檔案,記得重啟服務
1
|
#vim /etc/my.cnf |
1
2
3
4
5
6
7
8
9
|
[mysqld] datadir= /var/lib/mysql socket= /var/lib/mysql/mysql .sock innodb_file_per_table = 1 character- set -server = utf8 #獨立表空間模式 innodb_file_per_table = 1 symbolic-links=0 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES |
2、安裝PHP5.6
1
2
3
4
5
6
|
#rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm #yum install php56w php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap vim /etc/php .ini date .timezone = Asia /Shanghai |
3、安裝依賴包和zabbix-server相關包
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#yum -y install httpd libxml2-devel net-snmp-devel libcurl-devel #yum -y install OpenIPMI-libs #yum -y install fping #yum -y install iksemel #yum -y install zabbix-server zabbix-web #yum -y zabbix-mysql zabbix-agent zabbix-web-mysql #yum -y zabbix_get |
4匯入zabbix資料庫
1
2
3
|
#cd /usr/share/doc/zabbix-server-mysql-3.0.8/ #gunzip create.sql.gz #mysql -uzabbix -pzabbix zabbix < create.sql |
5、建立vhost.conf檔案
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#cd /etc/http/conf.d/ #vim vhost.conf # Zabbix monitoring system php web frontend # Alias /zabbix /usr/share/zabbix
<Directory "/usr/share/zabbix" > Options FollowSymLinks AllowOverride None Order allow,deny Allow from all <IfModule mod_php5.c> 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 Europe/Riga < /IfModule > < /Directory > <Directory "/usr/share/zabbix/conf" > Order deny,allow Deny from all <files *.php> Order deny,allow Deny from all < /files > < /Directory > <Directory "/usr/share/zabbix/app" > Order deny,allow Deny from all <files *.php> Order deny,allow Deny from all < /files > < /Directory > <Directory "/usr/share/zabbix/include" > Order deny,allow Deny from all <files *.php> Order deny,allow Deny from all < /files > < /Directory > <Directory "/usr/share/zabbix/local" > Order deny,allow Deny from all <files *.php> Order deny,allow Deny from all < /files > < /Directory > |
建立/etc/httpd/conf.d/zabbix.conf檔案
1
2
3
4
5
6
7
|
php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 32M 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 |
啟動httpd
1
|
#/etc/init.d/httpd start |
6、配置zabbix_server.conf檔案
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#cat /etc/zabbix/zabbix_server.conf | egrep -v "^$|^#" LogFile= /var/log/zabbix/zabbix_server .log LogFileSize=0 DebugLevel=3 PidFile= /var/run/zabbix/zabbix_server .pid ##DB的地址或計算機名 DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix StartPollers=40 StartPollersUnreachable=20 StartTrappers=8 StartPingers=8 StartDiscoverers=8 StartHTTPPollers=8 SNMPTrapperFile= /var/log/snmptrap/snmptrap .log HousekeepingFrequency=1 CacheSize=128M StartDBSyncers=8 HistoryCacheSize=32M HistoryIndexCacheSize=32M TrendCacheSize=8M ValueCacheSize=128M Timeout=30 TrapperTimeout=120 AlertScriptsPath= /usr/lib/zabbix/alertscripts ExternalScripts= /usr/lib/zabbix/externalscripts LogSlowQueries=3000 |
啟動zabbix server服務
1
|
#/etc/init.d/zabbix-server start |
7、訪問zabbix web並配置
訪問http://$IP/zabbix 進行配置
本文轉自 技術花妞妞 51CTO部落格,原文連結:http://blog.51cto.com/xiaogongju/1940984
相關文章
- Linux系統安裝(CentOS6)LinuxCentOS
- yum如何解除安裝已安裝的rpm並安裝本地rpm包
- rpm包安裝升級與解除安裝
- RPM包安裝與介紹
- RPM包的安裝與升級
- CentOS下使用rpm包安裝MySQLCentOSMySql
- yum,rpm等失效,使用系統安裝包ISO檔案降級程式恢復系統
- centos(linux): rpm -V 驗證rpm包安裝程式的安全CentOSLinux
- mysql8.0.30的RPM包安裝方法MySql
- Linux RPM包安裝、解除安裝、升級命令講解Linux
- Greenplum_原始碼編譯安裝和RPM包安裝原始碼編譯
- yum/dnf/rpm 等 檢視rpm 包安裝路徑 (fedora 中 pygtk 包內容安裝到哪裡了)
- yum安裝軟體之後如何儲存rpm安裝包
- centos以RPM包方式安裝redis的方法CentOSRedis
- 在 Fedora 中安裝替代版本的 RPM 包
- rpm:虛擬包:空白包:欺騙包:do nothing包:滿足現有rpm包安裝依賴的要求
- 使用CheckInstall從原始碼製作RPM安裝包原始碼
- 基於Linux的MySQL5.7RPM包安裝LinuxMySql
- Mysql 5.7在OL 6上以RPM包安裝MySql
- Yum命令之僅下載rpm安裝包且不安裝
- mysql安裝(rpm)MySql
- Linux rpm -e --nodeps rpm解除安裝Linux
- 徹底解除安裝rpm軟體包的指令碼指令碼
- PostgreSQL 10.12 安裝系列 - 本地RPM安裝SQL
- Linux系統下安裝配置JDK(rpm方式及tar.gz方式)LinuxJDK
- Linux下怎麼安裝.deb格式的安裝包?Linux系統下.deb格式安裝包的安裝教程Linux
- centos6安裝telnet服務CentOS
- MySQL 5.7.22 rpm 安裝方式MySql
- Mysql for Linux安裝配置之—— rpm(bundle)安裝MySqlLinux
- PostgreSQL 10.12 安裝系列 - Yum+rpm 安裝SQL
- Linux作業系統中軟體安裝:用RPM包管理器安裝軟體步驟Linux作業系統
- Centos6下使用yum安裝MariaDBCentOS
- CentOS 8 停止維護後透過 rpm 包手動安裝 dockerCentOSDocker
- 透過yum在centos6.6上安裝mysql5.7.21rpm包CentOSMySql
- macOS monterey 12系統離線pkg安裝包Mac
- window 作業系統,安裝 mongodb.zip 包作業系統MongoDB
- clickhouse-backup(RPM方式安裝)
- Oracle 19c RPM安裝Oracle
- rpm方式離線安裝ansible