zabbix是一个企业级的开源分布式对的监控套件 zabbix可以监控网络和服务的监控状况,zabbix利用灵活的高精机制对事件发送邮件的报警。这样可以保证快速的对问题作出相应,zabbix可以利用储存数据提供杰出的报告及图形方式。这一特性将帮用户完成容量规划
下载安装MySQL5.6版本
[root@iZ2ze6natxix5rt14z26v9Z ssh]# rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
[root@ywcsb ~]# yum -y install mysql-devel mysql-server
在my.cnf文件里面的[mysqld]模块下添加 innodb_file_per_table=1
启动mysql
[root@ywcsb ~]# /etc/init.d/mysqld start
初始化MySQL脚本启动
[root@ywcsb ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none): #按下回车键跳过
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] #是否设置root密码
New password: #输入密码
Re-enter new password: #再次输入密码
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] #是否删除匿名用户
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] #是否允许远程登录
... skipping.
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] #是否删除test测试数据库
- Dropping test database...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
... Failed! Not critical, keep moving...
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] #是否重新加载权限表
... Success!
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Cleaning up...
登录数据库
[root@ywcsb ~]# mysql -uroot -p123456
创建zabbix并授权库
mysql> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbix';
Query OK, 0 rows affected (0.02 sec)
安装webyum源
[root@ywcsb ~]# rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm
安装httpd和php
[root@ywcsb ~]# yum -y install httpd php56w php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap ntpdate net-snmp*
修改php.ini文件
post_max_size=16M
max_execution_time=300
max_input_time=300
date.timezone=Asia/Shanghai
always_populate_raw_post_data=-1
启动httpd
[root@ywcsb ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using ywcsb.vip for ServerName[ OK ]
创建zabbix用户
[root@ywcsb ~]# groupadd zabbix
[root@ywcsb ~]# useradd -g zabbix zabbix
创建zabbix安装目录
[root@ywcsb ~]# mkdir /usr/local/zabbix
[root@ywcsb ~]# cd /usr/local/zabbix/
下载zabbix安装包
[root@ywcsb zabbix]# wget https://www.ywcsb.vip/data/upda/20170805/zabbix-3.2.3.tar.gz
解压安装包
[root@ywcsb zabbix]# tar xf zabbix-3.2.3.tar.gz
进入zabbix文件数据库导入表
[root@ywcsb zabbix]# cd zabbix-3.2.3/database/mysql/
[root@ywcsb mysql]# mysql -u zabbix -pzabbix zabbix<schema.sql
Warning: Using a password on the command line interface can be insecure.
[root@ywcsb mysql]# mysql -u zabbix -pzabbix zabbix<images.sql
Warning: Using a password on the command line interface can be insecure.
[root@ywcsb mysql]# mysql -u zabbix -pzabbix zabbix<data.sql
Warning: Using a password on the command line interface can be insecure.
下载依赖包
[root@ywcsb mysql]# yum install -y gccmysql-community-devel libxml2-devel unixODBC-devel net-snmp-devellibcurl-devel libssh2-develOpenIPMI-developenssl-developenldap-develfping libssh2-devel OpenIPMI-devel curl-devel
编译安装zabbix
[root@ywcsb mysql]# cd /usr/local/zabbix/zabbix-3.2.3
[root@ywcsb zabbix-3.2.3]# ./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-unixodbc --with-ssh2 --with-openipmi --with-openssl && make && make install
修改zabbix_server配置文件
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
FpingLocation=/usr/sbin/fping
创建zabbix访问页面
[root@ywcsb zabbix-3.2.3]# mkdir /var/www/html/zabbix
[root@ywcsb zabbix-3.2.3]# cd /usr/local/zabbix/zabbix-3.2.3/frontends/php/
[root@ywcsb php]# cp -a . /var/www/html/zabbix/
创建一个规则允许web服务器访问前端文件
[root@ywcsb php]# chcon -Rv --type=httpd_sys_content_t /var/www/html
设置Apache用户web接口文件的所有者
[root@ywcsb php]# chown -R apache:apache /var/www/html/zabbix
[root@ywcsb php]# chmod +x /var/www/html/zabbix/conf/
zabbix启动脚本
[root@ywcsb php]# cp /usr/local/zabbix/zabbix-3.2.3/misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix_server
[root@ywcsb php]# cp /usr/local/zabbix/zabbix-3.2.3/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix_agentd
[root@ywcsb php]# chkconfig --add /etc/init.d/zabbix_server
[root@ywcsb php]# chkconfig --add /etc/init.d/zabbix_agentd
发表评论
共 0 条评论
暂无评论