OS準備 關閉selinux vi /etc/selinux/config setenforce 0 開啟防火牆80埠訪問 firewall-cmd --permanent --add-rich-rule 'rule family=ipv4 port port=80 protocol=tcp ac ...
OS準備
關閉selinux
vi /etc/selinux/config
setenforce 0
開啟防火牆80埠訪問
firewall-cmd --permanent --add-rich-rule 'rule family=ipv4 port port=80 protocol=tcp accept'
firewall-cmd --reload
聯網安裝REPO源
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
yum安裝前端準備
安裝apache,php,java,mysql
yum clean all
yum list
yum grouplist
yum groupinstall "Web Server" "PHP Support" "MySQL Database server" "MySQL Database client" "Java Platform"
安裝擴展包
yum install gcc mysql-devel php-mbstring php-bcmath php-mysql OpenIPMI OpenIPMI-devel libcurl libcurl-devel libxml2 libxml2-devel net-snmp net-snmp-devel
yum install fping
安裝zabbix組件
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
資料庫安裝配置
yum install mariadb-server mariadb -y
配置創建資料庫
配置資料庫密碼
mysqladmin -uroot password <newpassword>
# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
mysql> quit;
資料庫導入
# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
配置Zabbix server的資料庫
vi /etc/zabbix/zabbix_server.conf
DBPassword=password
配置ZABBIX前端
vi /etc/httpd/conf.d/zabbix.conf,
# ZABBIX
<VirtualHost *:80>
ServerName zbserver
ServerAdmin root@localhost
DocumentRoot /usr/share/zabbix
Alias /zabbix /usr/share/zabbix
<Directory "/usr/share/zabbix">
Options FollowSymLinks
AllowOverride None
Require all granted
<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 Aisa/Shanghai
</IfModule>
</Directory>
<Directory "/usr/share/zabbix/conf">
Require all denied
</Directory>
<Directory "/usr/share/zabbix/app">
Require all denied
</Directory>
<Directory "/usr/share/zabbix/include">
Require all denied
</Directory>
<Directory "/usr/share/zabbix/local">
Require all denied
</Directory>
ErrorLog /var/log/httpd/zabbix/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/httpd/zabbix/access.log combined
ServerSignature On
</VirtualHost>
準備日誌文件夾
mkdir /var/log/httpd/zabbix/
touch /var/log/httpd/zabbix/error.log
touch /var/log/httpd/zabbix/access.log
啟動進程
systemctl enable mariadb zabbix-server zabbix-agent httpd
systemctl restart mariadb zabbix-server zabbix-agent httpd
配置前端
配置過程參考Installing frontend
問題處理
圖片顯示亂碼https://www.cnblogs.com/kevingrace/p/5957283.html
埠監控https://www.linuxidc.com/Linux/2013-10/90799.htm