zabbix监控系统-1:系统搭建

 

官网:https://www.zabbix.com/

#rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm

#yum install zabbix-server-mysql zabbix-web-mysql
#yum install zabbix-agent
#yum install -y mysql-server mysql
#cp /usr/share/mysql/my-medium.cnf /etc/my.cnf #vim /etc/my.cnf
character-set-server = utf8
init-connect = 'SET NAMES utf8'
collation-server = utf8_general_ci

 

 

create database zabbix character set utf8 collate utf8_bin; 

grant all privileges on zabbix.* to 'zabbix'@'%' identified by 'zabbix';
flush privileges;

 
 
# cd /usr/share/doc/zabbix-server-mysql-2.2.0/create
# mysql -uroot zabbix < schema.sql
# mysql -uroot zabbix < images.sql
# mysql -uroot zabbix < data.sql
 
# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
# service zabbix-server start

 

 

vim /etc/httpd/conf.d/zabbix.conf

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 date.timezone Europe/Riga

php_value date.timezone Asia/Shanghai

 

# service httpd restart
 
 
 
vim /etc/zabbix/zabbix_agentd.conf
Server=10.80.0.165
service zabbix-agent start
 
yum install –y zabbix-get
自定义key
# vim /etc/zabbix/zabbix_agentd.conf
UserParameter=login-user,uptime |awk -F ' ' '{print $6}'
# /etc/init.d/zabbix-agent restart
 
在server上获取这个key的值

[root@zabbix2 ~]# zabbix_get -s 10.80.0.161 -k login-user
3

 
 
posted @ 2018-09-19 12:18  snailshadow  阅读(146)  评论(0编辑  收藏  举报