534523 发表于 2016-12-7 08:49:40

CentOS6.5安装zabbix监控及汉化

1.下载zabbix安装包
# wgethttps://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.4.7/zabbix-2.4.7.tar.gz/
2.安装依赖包
# yum install –y make mysql-server httpd php mysql-devel gcc net-snmp-devel curl-devel perl-DBI php-gd php-mysqlphp-bcmath php-mbstring php-xml
3.启动mysql
# useradd zabbix ---新建用户zabbix
# /etc/init.d/mysqld start
# mysqladmin -u root password 'eisoo.com'
# mysql -uroot -p
Enter password:
mysql> create database zabbix character set utf8; ---创建zabbix数据库
Query OK, 1 row affected (0.00 sec)

mysql> grant all on zabbix.* TO zabbix@'localhost' identified by'zabbixpass'; ---授权
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
4.导入zabbix数据
# tar xf zabbix-2.4.7.tar.gz
# ls
bin download lib media proc selinux tmp zabbix-2.4.7
boot etc lib64 mnt root srv usr zabbix-2.4.7.tar.gz
dev home lost+found opt sbin sys var
# cd zabbix-2.4.7/database/mysql/
# mysql -h localhost -uroot -peisoo.com zabbix <schema.sql
# mysql -h localhost -uroot -peisoo.com zabbix<images.sql
# mysql -h localhost -uroot -peisoo.com zabbix<data.sql
5.查看服务器时间,不准则需要修改
# date
Tue Feb 16 15:52:48 CST 2016
6.安装zabbix
# ./configure --with-mysql --with-net-snmp--with-libcurl --enable-server --enable-agent --enable-proxy--prefix=/usr/local/zabbix
# make &&make install
7.增加端口
# vi /etc/services
zabbix-agent 10050/tcp # Zabbix Agent
zabbix-agent 10050/udp # Zabbix Agent
zabbix-trapper 10051/tcp # Zabbix Trapper
zabbix-trapper 10051/udp # Zabbix Trapper
8.修改配置文件
# vi/etc/httpd/conf/httpd.conf----apache配置文件
DirectoryIndex index.html index.html.var index.php
# vi /usr/local/zabbix/etc/zabbix_server.conf -----zabbix服务器配置文件
DBName=zabbix
DBUser=zabbix 连接数据库的账号,与Mysql授权账号对应
DBPassword=zabbixpass 连接数据库的密码,与Mysql授权账号的密码对应
9.修改服务启动
# cd misc/init.d/fedora/core5
# cp zabbix_* /etc/init.d/
# chmod 700 /etc/init.d/zabbix_*
# vi /etc/init.d/zabbix_server
ZABBIX_BIN="/usr/local/zabbix/sbin/zabbix_server"
# vi /etc/init.d/zabbix_agentd
ZABBIX_BIN="/usr/local/zabbix/sbin/zabbix_agentd"
10.zabbix启动并设置开机启动
# /etc/init.d/zabbix_server start
Starting Zabbix Server: [ OK ]
# /etc/init.d/zabbix_agentd start
Starting Zabbix Agent: [ OK ]
# chkconfig zabbix_server on
# chkconfig zabbix_agentd on
11.修改php参数
# vi /etc/php.ini
max_execution_time = 300
max_input_time = 300
date.timezone = PRC
post_max_size = 32M
# /etc/init.d/httpd restart
Stopping httpd:
Starting httpd: httpd: apr_sockaddr_info_get() failed for zdj
httpd: Could not reliably determine the server's fullyqualified domain name, using 127.0.0.1 for ServerName
[ OK ]
# cd zabbix-2.4.7/frontends/
# cp -rf php /var/www/html/zabbix
# chown -R zabbix:zabbix /var/www/html/zabbix
12.web登录配置zabbix
账号:Admin 密码:zabbix













汉化
# cd /var/www/html/zabbix/fonts/
# ls
DejaVuSans.ttf simkai.ttf --红色的为新上传的字体
# cd /var/www/html/zabbix/include/
# pwd
/var/www/html/zabbix/include
# ls
acknow.inc.php graphs.inc.php perm.inc.php
actions.inc.php hosts.inc.php profiles.inc.php
audit.inc.php html.inc.php regexp.inc.php
blocks.inc.php httptest.inc.php reports.inc.php
classes ident.inc.php schema.inc.php
config.inc.php images.inc.php screens.inc.php
db.inc.php items.inc.php services.inc.php
debug.inc.php js.inc.php sounds.inc.php
defines.inc.php locales.inc.php translateDefines.inc.php
discovery.inc.php maintenances.inc.php triggers.inc.php
draw.inc.php maps.inc.php users.inc.php
events.inc.php media.inc.php validate.inc.php
forms.inc.php menu.inc.php valuemap.inc.php
func.inc.php page_footer.php views
gettextwrapper.inc.php page_header.php
# cp defines.inc.php defines.inc.php.backup
# vi defines.inc.php ---修改配置文件
define('ZBX_FONT_NAME', 'simkai');
define('ZBX_GRAPH_FONT_NAME', 'simkai'); // font file name







babyrn 发表于 2016-12-13 16:42:33


页: [1]
查看完整版本: CentOS6.5安装zabbix监控及汉化