设为首页 收藏本站
查看: 841|回复: 0

[经验分享] 部署Zabbix2.2.5

[复制链接]

尚未签到

发表于 2019-1-20 13:34:57 | 显示全部楼层 |阅读模式
  Zabbix安装要求
  webserver、mysql、php
  我一般喜欢用yum安装,很少用编译安装;
  ===========================================================================================

  •   添加软件包源,安装系统基础软件和工具。
# yum -y install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
# yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# yum -y install http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-2.2.5-1.el6.x86_64.rpm
# yum -y install vim wget unzip  老版本:
  # vim /etc/yum.repos.d/zabbix.repo
  [zabbix]
  name=Server
  baseurl=http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/

  enable=1
  gpgcheck=0

  2.  安装webserver(httpd)

# yum -y install httpd  # remove welcome page
# rm -f /etc/httpd/conf.d/welcome.conf  # remove default error page
# rm -f /var/www/error/noindex.html  [configure httpd]
# vim /etc/httpd/conf/httpd.conf  # line 44: change
ServerTokens Prod  # line 262: Admin's Email Address
ServerAdmin carson@iopenstack.com  # line 276: change to your server's name
ServerName        # 写成你ServerName或者IPAddr  # line 338: change
AllowOverride All  # line 402: add file name that it can access only with directory's name
DirectoryIndex index.php index.html index.htm    # 写到最前面的默认首先加载*.php文件  # line 536:change
ServerSignature Off# /etc/rc.d/init.d/httpd start
Starting httpd:            [OK]
# chkconfig httpd on  [Create a html page use test server]
# vim /var/www/html/index.html



Test Page


  3.  安装mysql
# yum -y install mysql-server
# /etc/rc.d/init.d/mysqld start
Initializing MySQL database:  WARNING: The host 'webserver1.lisys.cn' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h webserver1.lisys.cn password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation            # 使用此命令初始化mysql
which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
                                                           [  OK  ]
Starting mysqld:                                           [  OK  ]
# chkconfig mysqld on# /usr/bin/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] y
New password:                     # 输入为root设置的密码
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] y    # 移除匿名用户
... 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] y    # 不允许root远程登陆
... Success!
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] y    # 删除test数据库
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!http://www.server-world.info/en/note?os=CentOS_6&p=zabbix&f=1
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y    # 重新加载权限表
... Success!
Cleaning up...

All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!  4.  安装php
yum -y install php php-mysql php-devel  5.  安装Zabbix
# yum -y --enablerepo=zabbix install zabbix-server-mysql zabbix-agent zabbix-web-mysql
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 67
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database zabbix;
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbixpassword';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
# cd /usr/share/doc/zabbix-server-mysql-2.2.3/create/
# ls
data.sql  images.sql  schema.sql
# cat schema.sql | mysql -u root -p zabbix
Enter password:
# cat images.sql | mysql -u root -p zabbix
Enter password:
# cat data.sql | mysql -u root -p zabbix
Enter password:
ex
# cd
# vim /etc/zabbix/zabbix_server.conf
line 91: zabbix databases name  
DBName=zabbix
line 107: zabbix user
DBUser=zabbix
line 115: uncomment and add DB password for Zabbix
DBPassword=zabbixpassword
# vim /etc/zabbix/zabbix_agentd.conf
line 137: change to your hostname or ipaddr
Hostname=zabbix.iopenstack.com
# vim /etc/php.ini
line 440: change to zabbix recomended
max_execution_time = 600
line 449: change to zabbix recomended
max_input_time = 600
line 457: change to zabbix recomended
memory_limit = 256M
line 729: change to zabbix recomended
post_max_size = 32M
line 878: change to zabbix recomended
upload_max_filesize = 16M
line 946: uncomment and add you timezone
date.timezone =Asia/Shanghai
# vim /etc/httpd/conf.d/zabbix.conf
Alias /zabbix /usr/share/zabbix

    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from 192.168.1.0/24 192.168.2.0/24        # change to the range you allow to access
    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

# /etc/rc.d/init.d/zabbix-server start
Starting Zabbix server:                                    [  OK  ]
# /etc/rc.d/init.d/zabbix-agent start
Starting Zabbix agent:                                     [  OK  ]
# /etc/rc.d/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
# chkconfig zabbix-server on
# chkconfig zabbix-agent on  6.  完成配置
  访问 http://$youripaddr/zabbix/


  点击【netx】

  查看是否都已满足要求(如果按照上面配置一般都是ok)
  点击【next】

  填写链接本地数据库信息,密码是刚才上面在数据库中为zabbix设置的密码
  点击【next】

  填写主机名称或者ip地址,以及客户端连接zabbix服务端的端口号,和安装以后显示的名称;
  点击【next】

  再次确认安装信息
  点击【next】

  到此配置完成!

  提示:
默认用户:admin
  默认密码:zabbix





运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-665630-1-1.html 上篇帖子: Zabbix的snmp监控一些snmp常用的一些OID (KEY) 下篇帖子: 监控系统Zabbix的简单应用
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表