zabbix安装笔记-转www.allposs.ml

# yum -y install httpd mysql mysql-server php php-mysql php-common php-mbstring php-gd php-odbc php-pear curl curl-devel net-snmp net-snmp-devel perl-DBI php-xml ntpdate  php-bcmath mysql-devel
# ntpdate cn.pool.ntp.org
# hwclock �Cw
# vi ~/.bashrc
alias vi='vim'
# alias vi='vim'
# vi ~/.vimrc
Set nu
# groupadd  -g 201  zabbix
# useradd  -g zabbix  -u 201 -m zabbix
# service mysqld start
# mysqladmin �Curoot password “Password123”
# mysql �Curoot �Cp
> create database zabbix character set utf8;
> grant all on zabbix.* to 'zabbix'@'localhost' identified by 'Password123' with grant option;
> flush privileges;
> exit
# uname -a
# wget http://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.4.4/zabbix-2.4.4.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fzabbix%2Ffiles%2F&ts=1426731695&use_mirror=jaist
# tar �Czxvf zabbix.tar.gz
# cd zabbix/
# mysql -u'zabbix' -p'Password123' zabbix <database/mysql/schema.sql
# mysql -u'zabbix' -p'Password123' zabbix <database/mysql/images.sql
# mysql -u'zabbix' -p'Password123' zabbix <database/mysql/data.sql
# ./configure --prefix=/usr/local/zabbix --sysconfdir=/etc/zabbix/ --enable-server --enable-agent --enable-proxy --with-mysql --enable-net-snmp --with-libcurl
#此处指定sysconfdir配置文件的路径就在/etc/zabbix/目录下了,如果不指定默认在/usr/local/etc下
# make && make install
# vi /etc/service
zabbix-agent    10050/tcp    //客户端
zabbix-agent    10050/udp  
zabbix-trapper  10051/tcp    //服务端
zabbix-trapper  10051/udp
# cp ./misc/init.d/tru64/zabbix_agentd  /etc/init.d/    //客户端
# cp ./misc/init.d/tru64/zabbix_server  /etc/init.d/    //服务端
# chmod +x /etc/init.d/zabbix_*
# mkdir -v /var/www/html/zabbix
# cp -a ./frontends/php/* /var/www/html/zabbix/
# usermod -G apache zabbix
# chown -R apache.apache /var/www/html/zabbix/
# vi /etc/init.d/zabbix_agentd
1:修改DAEMON=/usr/local/zabbix/sbin/zabbix_agentd
2:#!/bin/bash下面增加
#chkconfig: 345 95 95
#description:zabbix_agentd
# vi /etc/init.d/zabbix_server
1:修改DAEMON=/usr/local/zabbix/sbin/zabbix_server
2:#!/bin/bash下面增加
#chkconfig: 345 95 95
#description:Zabbix_Server
# chkconfig --add zabbix_server
# chkconfig --add zabbix_agentd
# chkconfig zabbix_server on
# chkconfig zabbix_agentd on
# chkconfig mysqld on
# chkconfig httpd on
# vim /etc/httpd/conf/httpd.conf
ServerName 192.168.255.200
<VirtualHost 192.168.255.200:80>
 DocumentRoot  "/var/www/html/zabbix/"
 ServerName 192.168.255.200
</VirtualHost>
# vim /etc/zabbix/zabbix_server.conf
ListenPort=10051
DBHost=192.168.255.200
DBName= zabbix
DBUser=zabbix
DBPassword=Password123
StartPollers=30                         #开启多线程数,一般不要超过30个
StartTrappers=20                        #trapper线程数
StartPingers=10                         #fping线程数
StartDiscoverers=120           
MaxHousekeeperDelete=5000      
CacheSize=1024M                         #用来保存监控数据的缓存数,根据监控主机的数量适当调整
StartDBSyncers=8                        #数据库同步时间
HistoryCacheSize=1024M         
TrendCacheSize=128M                     #总趋势缓存大小
HistoryTextCacheSize=512M
AlertScriptsPath=/etc/zabbix/alertscripts
LogSlowQueries=1000
# vi /etc/zabbix/zabbix_agentd.conf
ListenPort=10050
 
# vim /etc/php.ini
date.timezone = Asia/Shanghai
max_execution_time = 300
max_input_time = 300
post_max_size = 32M
memory_limit = 128M
mbstring.func_overload = 2
post_max_size = 16M




转自www.allposs.ml


你可能感兴趣的:(zabbix)