标签:virt document load .net open 方案 arch upload path
本文参考借鉴 http://www.zsythink.net/archives/500
前提: 服务器安装了mysql
服务器: 192.168.44.71 zabbix01
wget http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
rpm -ivh zabbix-release-3.0-1.el7.noarch.rpm
执行完上面两步后,会生成一个yum源文件:
[root@zabbix01 ~]# cat /etc/yum.repos.d/zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://repo.zabbix.com/zabbix/3.0/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1
yum install zabbix-server-mysql zabbix-get
[root@zabbix01 ~]# rpm -ql zabbix-server-mysql
/etc/logrotate.d/zabbix-server
/etc/zabbix/zabbix_server.conf
/usr/lib/systemd/system/zabbix-server.service
/usr/lib/tmpfiles.d/zabbix-server.conf
/usr/lib/zabbix/alertscripts
/usr/lib/zabbix/externalscripts
/usr/sbin/zabbix_server_mysql
/usr/share/doc/zabbix-server-mysql-3.0.25
/usr/share/doc/zabbix-server-mysql-3.0.25/AUTHORS
/usr/share/doc/zabbix-server-mysql-3.0.25/COPYING
/usr/share/doc/zabbix-server-mysql-3.0.25/ChangeLog
/usr/share/doc/zabbix-server-mysql-3.0.25/NEWS
/usr/share/doc/zabbix-server-mysql-3.0.25/README
/usr/share/doc/zabbix-server-mysql-3.0.25/create.sql.gz
/usr/share/man/man8/zabbix_server.8.gz
/var/log/zabbix
/var/run/zabbix
找到上面红色的目录中的sql文件
cd /usr/share/doc/zabbix-server-mysql-3.0.25/
gunzip create.sql.gz
创建zabbix数据库并初始化
mysql -uroot -p
create database zabbix charset ‘utf8‘;
grant all on zabbix.* to zabbix@‘localhost‘ identified by ‘123456‘;
flush privileges;
执行sql文件
mysql -uroot -p -Dzabbix < /usr/share/doc/zabbix-server-mysql-3.0.25/create.sql
编辑配置文件
vim /etc/zabbix/zabbix_server.conf
ListenPort=10051 #监控端口
SourceIP=192.168.44.71 #服务器ip
LogType=file
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
DebugLevel=3
PidFile=/var/run/zabbix/zabbix_server.pid
DBHost=localhost
DBName=zabbix #mysql中数据库名称
DBUser=zabbix #mysql数据库用户
DBPassword=123456 #mysql数据库密码
DBSocket=/var/lib/mysql/mysql.sock
DBPort=3306 #mysql端口
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000
配置完成后,启动zabbix server
systemctl start zabbix-server.service
依赖环境
yum install httpd php php-mysql php-mbstring php-gd php-bcmath php-ldap php-xml
安装zabbix web
yum install zabbix-web zabbix-web-mysql
修改配置文件 注意红色部分
vim /etc/httpd/conf.d/zabbix.conf
<VirtualHost 192.168.44.71:80> servername zabbix01 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 max_input_vars 10000 php_value always_populate_raw_post_data -1 php_value date.timezone Asia/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> </VirtualHost>
启动httpd服务
systemctl start httpd.service
访问192.168.44.71/zabbix 进行一步步配置即可,默认的管理员用户密码为 Admin:zabbix
登录完成后:
更改为中文界面:
重新登录即可。
yum install -y zabbix-agent zabbix-sender
修改配置文件
vim /etc/httpd/conf.d/zabbix.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=192.168.44.71 #服务端ip
ServerActive=192.168.44.71 #服务端ip
Hostname=zabbix01_agent #agent名称
Include=/etc/zabbix/zabbix_agentd.d/
启动zabbix agent
systemctl start zabbix-agent.service
标签:virt document load .net open 方案 arch upload path
原文地址:https://www.cnblogs.com/blazeZzz/p/10557492.html