centos6.8安裝zabbix

先後用了兩臺電腦來實驗,先後畫風不同,請忽略php

 

1、安裝php環境html

移除目前系統安裝的 PHP 組件
yum remove php* -y
 
  
安裝 PHP 的 YUM 源 
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
 
    
檢查 YUM 源是否已經存在 
ll /etc/yum.repos.d/webtatic.repo

 

安裝 PHP 環境
  yum -y install `yum list|grep php71w|awk '{printf ("%s ",$1)}'` --skip-broken

 



修改 PHP 參數以安裝 ZABBIX 的安裝需求 
sed -i "s/;date.timezone =/date.timezone = Asia\/Shanghai/g" /etc/php.ini
sed -i "s#`grep max_execution_time /etc/php.ini`#max_execution_time = 300#g" /etc/php.ini
sed -i "s#`grep post_max_size /etc/php.ini`#post_max_size = 32M#g" /etc/php.ini 
sed -i "s#`grep max_input_time = /etc/php.ini`#max_input_time = 300#g" /etc/php.ini 
sed -i "s#`grep memory_limit /etc/php.ini`#memory_limit = 128M#g" /etc/php.ini

 

這句報錯,沒法執行,我是用vim編輯替換的java

sed -i "s#`grep max_input_time = /etc/php.ini`#max_input_time = 300#g" /etc/php.ini 


啓動 PHP-FPM 服務
 
service php-fpm start

 

 
         
檢查程序是否正常啓動
netstat -lntup|grep php-fpm
 
將其加入開機自啓動
 
chkconfig php-fpm on

 

 2、YUM 安裝相關依賴組件mysql

 
安裝 WEB 及數據庫服務
 
yum install -y ntpdate mailx dos2unix vim zcat wget net-snmp-utils gcc gcc-c++ autoconf httpd libxml* mysql mysql-server  httpd-manual mod_ssl mod_perl mod_auth_mysql mysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp-devel curl-devel unixODBC-devel OpenIPMI-devel java-devel fping



啓動 MYSQL 服務 
service mysqld start
chkconfig mysqld on

 

 
                  
建立庫及受權 
mysql -uroot -e "create database zabbix character set utf8;" 
mysql -uroot -e "grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';"
mysql -uroot -e "flush privileges;"

建立 ZABBIX 用戶及組 
groupadd zabbix -g 201 
useradd -g zabbix -u 201 -m -s /sbin/nologin zabbix


 3、ZABBIX 相關組件安裝部署
 
安裝 ZABBIX 源 
rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-release-3.2-1.el6.noarch.rpm 
ll /etc/yum.repos.d/zabbix.repo

 

 
             
建立下載目錄下載相關軟件包 
mkdir /software && cd /software
wget -c --timeout=10 http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/deprecated/zabbix-server-mysql-3.2.7-1.el6.x86_64.rpm
wget -c --timeout=10 http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/deprecated/zabbix-web-3.2.7-1.el6.noarch.rpm
wget -c --timeout=10 http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/deprecated/zabbix-web-mysql-3.2.7-1.el6.noarch.rpm
wget -c --timeout=10 http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-agent-3.2.7-1.el6.x86_64.rpm

安裝 ZABBIX 相關組件 
yum localinstall -y zabbix-server-mysql* zabbix-web-mysql* zabbix-agent zabbix-web*

導入數據庫 
cd /usr/share/doc/zabbix-server-mysql-3.2.7
zcat create.sql.gz | mysql -uroot zabbix

設置 MYSQL 密碼 
mysqladmin -uroot password "mysqladmin"

拷貝網頁文件 
cd /usr/share/
cp -r ./zabbix/ /var/www/html/zabbix

修改配置文件 
echo "DBPassword=zabbix" >> /etc/zabbix/zabbix_server.conf

啓動相關服務 
service httpd start 
service zabbix-server start 
service zabbix-agent start 
chkconfig httpd on 
chkconfig mysqld on 
chkconfig php-fpm on
chkconfig zabbix-server on 
chkconfig zabbix-agent on
 
       
zabbix-agent 安裝失敗,從新安裝

cd /software
find / -name zabbix-agent*
rpm -ivh zabbix-agent-3.2.7-1.el6.x86_64.rpm

 

 
4、WEB界面配置
 
瀏覽器訪問: http://127.0.0.1/zabbix/setup.php
用戶名密碼: zabbix/zabbix

 


 
登陸 admin/zabbix

 




相關文章
相關標籤/搜索