zabbix3.4 for centos7安装

zabbix安装部分

安装zabbix 源
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

zabbix服务器端安装
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-java-gateway zabbix-web

zabbix客户端安装
yum -y install zabbix-agent

导入 zabbix 所需信息
cd /usr/share/doc/zabbix-server-mysql-3.4.3

配置 zabbix 参数

主要是以下几个选项参数需要设置(8GB 内存为例):
DBPassword 配置为第 12 步第 3 行中设置的自定义密码

CacheSize=512M

(CacheSize在371行)

HistoryCacheSize=128M

(HistoryCacheSize在397行)

HistoryIndexCacheSize=128M

(HistoryIndexCacheSize在405行)

TrendCacheSize=128M

(TrendCacheSize在414行)

ValueCacheSize=256M

(ValueCacheSize在425行)

Timeout=30

(Timeout在432

其它参数保持默认值即可
如果需要监控VMware虚拟机,则还需要设置以下选项参数:
StartVMwareCollectors=2

(StartVMwareCollectors在272行

VMwareCacheSize=256M

(VMwareCacheSize 在298行)

VMwareTimeout=300

(VMwareTimeout在306行)

17、配置 Apache 中的 PHP 参数(8GB 内存为例)
sudo vim /etc/httpd/conf.d/zabbix.conf

php_value max_execution_time 600

php_value memory_limit 256M

php_value post_max_size 32M

php_value upload_max_filesize 32M

php_value max_input_time 600

php_value always_populate_raw_post_data -1

date.timezone 去掉注释符号#,并将值修改为 Asia/Shanghai

18、重启系统
systemctl stop mysqld && reboot

19、启动 zbx
sudo systemctl start httpd && systemctl start zabbix-server

20、在浏览器中输入 http://zbx监控服务器的IP地址/zabbix,进行 zabbix 的页面初始化配置

这个页面PHP设置要求全部OK

如果密码输错,是跳转不到下一步的。密码是前面设置的 Qingdao@2017

注:第4步的”Zabbix server detail”页面中,”Name”处可填写对此监控系统的描述性文字,支持中文,有点像网站的名称。

21、第一次登录zbx监控系统,默认用户名 admin,默认密码 zabbix,确认可正常登录系统。

22、登录进入系统后,确认 Zabbix server is running 的值是 Yes。
然后选择 Administrator –> Users –> Admin

23、回到”监测中” –> “仪表板”,就可以看到监控系统已设置为中文界面了。

zabbix_agentd.exe命令说明
-c 制定配置文件所在位置
-i 安装客户端
-s 启动客户端
-x 停止客户端
-d 卸载客户端

zabbix_agent 监控 TCP/UDP协议

UserParameter=sockstat.sockets, netstat -ano | find /V "hola" /C
UserParameter=sockstat.tcp.inuse, netstat -ano | findstr ESTABLISHED
UserParameter=sockstat.tcp.inuse.count, netstat -ano | find /C "ESTABLISHED"
UserParameter=sockstat.tcp.orphan, netstat -ano | findstr CLOSE_WAIT
UserParameter=sockstat.tcp.orphan.count, netstat -ano | find /C "CLOSE_WAIT"
UserParameter=sockstat.tcp.timewait, netstat -ano | findstr TIME_WAIT
UserParameter=sockstat.tcp.timewait.count, netstat -ano | find /C "TIME_WAIT"
UserParameter=sockstat.tcp.allocated, netstat -ano | findstr LISTENING
UserParameter=sockstat.tcp.allocated.count, netstat -ano | find /C "LISTENING"
UserParameter=sockstat.udp.inuse, netstat -ano | findstr UDP
UserParameter=sockstat.udp.inuse.count, netstat -ano | find /C "UDP"

数据库mysql参数配置
innodb_file_per_table = 1
innodb_status_file = 1
innodb_buffer_pool_size = 6G
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 16M
innodb_log_file_size = 64M
innodb_support_xa = 0
default-storage-engine = innodb
bulk_insert_buffer_size = 8M
join_buffer_size = 16M
max_heap_table_size = 32M
tmp_table_size = 32M
max_tmp_tables = 48
read_buffer_size = 32M
read_rnd_buffer_size = 16M
key_buffer_size = 32M
thread_cache_size = 32
innodb_thread_concurrency = 8
innodb_flush_method = O_DIRECT
innodb_rollback_on_timeout = 1
query_cache_size = 16M
query_cache_limit = 16M
collation_server = utf8_bin
character_set_server = utf8

猜你喜欢

转载自blog.51cto.com/zjunzz/2298637