CentOS 6.5 最小化安装zabbix
安装EPEL源
#rpm –ivh
服务端安装LAMP环境
#yum -y install gcc gcc-c++ autoconf httpdphp mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysqlphp-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmathmysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp-devel curl-develunixODBC-devel OpenIPMI-devel java-devel
修改PHP的配置文件
#vim /etc/php/ini
修改如下行:
947 date.timezone = Asia/Shanghai
440 max_execution_time = 300
449 max_input_time = 300
729 post_max_size = 32M
457 memory_limit = 128M
1588 mbstring.func_overload = 2
启动mysql、apache并添加至开机自启动
# service mysqld start
# chkconfig mysqld on
# service httpd start
# chkconfig httpd on
安装zabbix:
创建zabbix用户及组
# groupadd zabbix -g 201
# useradd -g zabbix -u 201 -m zabbix
解压安装zabbix
# tar xf zabbix-2.0.8.tar.gz
# ./configure --prefix=/usr/local--sysconfdir=/etc/zabbix --enable-server --enable-proxy--enable-agent--with-net-snmp --with-libcurl --with-openipmi --with-unixodbc--enable-java --with-mysql=/usr/bin/mysql_config
# make && make install
添加zabbix到系统服务文件
# vim /etc/services
在文件尾部添加以下行
#zabbix
zabbix-agent 10050/tcp #Zabbix Agent
zabbix-agent 10050/udp #Zabbix Agent
zabbix-trapper 10051/tcp #Zabbix Trapper
zabbix-trapper 10051/udp #Zabbix Trapper
创建zabbix数据库
# mysqladmin password zabbix
# mysql -u root -pzabbix
mysql> create database zabbix characterset utf8;
mysql> grant all on zabbix.* tozabbix@localhost identified by 'zabbix';
mysql> flush privileges;
mysql> quit
导入zabbix的表结构及数据
# cd zabbix-2.0.8/database/mysql/
# mysql -u zabbix -pzabbix zabbix
# mysql -u zabbix -pzabbix zabbix
# mysql -u zabbix -pzabbix zabbix
创建zabbix日志存放目录,并复制脚本
# mkdir /var/log/zabbix
# chown zabbix.zabbix /var/log/zabbix
# cp zabbix-2.0.8/misc/init.d/fedora/core/zabbix_*/etc/init.d/
# chmod 755 /etc/init.d/zabbix_*
配置zabbix服务端的配置文件
# vim /etc/zabbix/zabbix_server.conf
87 DBName=zabbix
102 DBUser=zabbix
113 DBPassword=zabbix
复制zabbix安装文件,添加可执行的权限
# cp -r php /var/www/html/zabbix
# chown -R apache.root /var/www/html/zabbix
启动zabbix_server添加开机自启动
# chkconfig --add zabbix_server
# chkconfig --add zabbix_agentd
# service zabbix_server start
# chkconfig zabbix_server on
1. 首先登陆到数据库,选择zabbix数据库,查看Admin用户。
mysql> use zabbix
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select * from users\G
*************************** 1. row ***************************
userid: 1
alias: Admin
name: Zabbix
surname: Administrator
passwd: e2798af12a7a0f4f70b4d69efbc25f4d
url:
autologin: 1
autologout: 0
lang: en_US
refresh: 30
type: 3
theme: default
attempt_failed: 0
attempt_ip: 210.51.19.2
attempt_clock: 1421286613
rows_per_page: 50
从查询结果可以看出Admin的密码是一串加密MD5值,因为我们只要替换这个MD5值即可。
2. 生成一个字符串的MD5值。
echo -n redhat|openssl md5
(stdin)= e2798af12a7a0f4f70b4d69efbc25f4d
此处添加-n参数是保证数值唯一
3. 替换Admin的密码
mysql> update users set passwd='e2798af12a7a0f4f70b4d69efbc25f4d' where userid='1';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
阅读(768) | 评论(0) | 转发(0) |