安装httpd mariadb
yum install -y httpd mariadb-server mariadb php php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mhash
rpm -qa httpd php mariadb
systemctl status httpd
systemctl start httpd
systemctl enable httpd
systemctl enable mariadb.service
systemctl start mariadb.service
设置mysql
mysqladmin -uroot password 123456
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;
安装zabbix
yum -y install zabbix-server-mysql zabbix-web-mysql
导入mysql
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
修改配置文件
vim /etc/zabbix/zabbix_server.conf
DBPassword=password
vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
修改mysql存储路径
show global variables like "%datadir%";
systemctl stop mariadb.service
vim /etc/my.cnf
[mysqld]
#datadir=/var/lib/mysql
datadir=/data/mysqldata/mysql
#socket=/var/lib/mysql/mysql.sock
socket=/data/mysqldata/mysql/mysql.sock
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
socket=/data/mysqldata/mysql/mysql.sock
[client]
socket=/data/mysqldata/mysql/mysql.sock
[mysqld_safe]
socket=/data/mysqldata/mysql/mysql.sock
创建链接
ln -s /data/mysqldata/mysql/mysql.sock /var/lib/mysql/mysql.sock
systemctl start mariadb.service
处理图形乱码
/usr/share/fonts/dejavu/
脚本路径
/usr/lib/zabbix/alertscripts
安装pip、requests
yum -y install epel-release
yum install python-pip
pip install requests
设置mysql允许远程登陆
MySQL mysql -u root -p
use mysql;
update user set host = '%' where user = 'root';
FLUSH PRIVILEGES;