Zabbix2.2 服务端安装

操作系统为CentOS 6.5 64位,采用yum方式安装,操作系统能正常出公网后,建议先更新操作系统
yum -y update
如果yum 安装时错误 Errno 14 Couldn’t resolve host需要修改DNS服务器,可以修改一下 /etc/resolv.conf
添加一个nameserver 8.8.8.8完成

安装epel扩展源spacer.gif
  [root@localhost ~]#yum install -y epel-release安装rpm包的lamp环境
  [root@localhost ~]#yum install -y httpd mysql mysql-libs php php-mysql mysql-server php-bcmath php-gd php-mbstring 安装zabbix的版本可以通过yum search zabbix查看yum源带的是什么版本,确认后选择你需要的版本即可
  [root@localhost ~]# yum search zabbix
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
epel/metalink                                                      | 5.3 kB    00:00   
 * base: centos.ustc.edu.cn
 * epel: ftp.cuhk.edu.hk
 * extras: mirrors.yun-idc.com
 * updates: mirrors.sina.cn
base                                                              | 3.7 kB    00:00   
extras                                                            | 3.4 kB    00:00   
updates                                                            | 3.4 kB    00:00   
================================== N/S Matched: zabbix ===================================
pcp-export-zabbix-agent.x86_64 : Module for exporting from PCP into a Zabbix agent daemon
Python-pyzabbix.noarch : PyZabbix is a Python module for working with the Zabbix API
uwsgi-stats-pusher-zabbix.x86_64 : uWSGI – Zabbix Stats Pusher for uWSGI
zabbix-agent.x86_64 : Zabbix Agent
zabbix-proxy.x86_64 : Zabbix Proxy
zabbix-proxy-mysql.x86_64 : Zabbix proxy compiled to use MySQL
zabbix-proxy-pgsql.x86_64 : Zabbix proxy compiled to use PostgreSQL
zabbix-proxy-sqlite3.x86_64 : Zabbix proxy compiled to use SQLite
zabbix-server.x86_64 : Zabbix server common files
zabbix-server-mysql.x86_64 : Zabbix server compiled to use MySQL
zabbix-server-pgsql.x86_64 : Zabbix server compiled to use PostgresSQL
zabbix-server-sqlite3.x86_64 : Zabbix server compiled to use SQLite
zabbix-web.noarch : Zabbix Web Frontend
zabbix-web-mysql.noarch : Zabbix web frontend for MySQL
zabbix-web-pgsql.noarch : Zabbix web frontend for PostgreSQL
zabbix-web-sqlite3.noarch : Zabbix web frontend for SQLite
zabbix20-agent.x86_64 : Zabbix agent
zabbix20-proxy.noarch : Zabbix proxy common files
zabbix20-proxy-mysql.x86_64 : Zabbix proxy compiled to use MySQL
zabbix20-proxy-pgsql.x86_64 : Zabbix proxy compiled to use PostgreSQL
zabbix20-proxy-sqlite3.x86_64 : Zabbix proxy compiled to use SQLite
zabbix20-server.noarch : Zabbix server common files
zabbix20-server-mysql.x86_64 : Zabbix server compiled to use MySQL
zabbix20-server-pgsql.x86_64 : Zabbix server compiled to use PostgresSQL
zabbix20-web.noarch : Zabbix Web Frontend
zabbix20-web-mysql.noarch : Zabbix web frontend for MySQL
zabbix20-web-pgsql.noarch : Zabbix web frontend for PostgreSQL
zabbix22-agent.x86_64 : Zabbix Agent
zabbix22-dbfiles-mysql.noarch : Zabbix database schemas, images, data and patches
zabbix22-dbfiles-pgsql.noarch : Zabbix database schemas, images, data and patches
zabbix22-dbfiles-sqlite3.noarch : Zabbix database schemas and patches
zabbix22-proxy.noarch : Zabbix Proxy
zabbix22-proxy-mysql.x86_64 : Zabbix proxy compiled to use MySQL
zabbix22-proxy-pgsql.x86_64 : Zabbix proxy compiled to use PostgreSQL
zabbix22-proxy-sqlite3.x86_64 : Zabbix proxy compiled to use SQLite
zabbix22-server.noarch : Zabbix server common files
zabbix22-server-mysql.x86_64 : Zabbix server compiled to use MySQL
zabbix22-server-pgsql.x86_64 : Zabbix server compiled to use PostgreSQL
zabbix22-web.noarch : Zabbix Web Frontend
zabbix22-web-mysql.noarch : Zabbix web frontend for MySQL
zabbix22-web-pgsql.noarch : Zabbix web frontend for PostgreSQL
zabbix.x86_64 : Open-source monitoring solution for your IT infrastructure
zabbix20.x86_64 : Open-source monitoring solution for your IT infrastructure
zabbix22.x86_64 : Open-source monitoring solution for your IT infrastructure
从yum源可以看到配置了zabbix2.0和zabbix2.2
安装zabbix服务端(可以选择安装zabbix2.0或者zabbix2.2)
安装zabbix2.0
 [root@localhost ~]#yum install -y zabbix20 zabbix20-agent zabbix20-server zabbix20-server-mysql zabbix20-web zabbix20-web-mysql net-snmp-devel安装zabbix2.2 [root@localhost ~]#yum install -y zabbix22 zabbix22-agent zabbix22-server zabbix22-server-mysql zabbix22-web zabbix22-web-mysql net-snmp-devel

      启动服务

 [root@localhost ~]# /etc/init.d/zabbix-server startStarting Zabbix server:                                    [确定] [root@localhost ~]# /etc/init.d/zabbix-agent startStarting Zabbix agent:                                    [确定] [root@localhost ~]# /etc/init.d/httpd start正在启动 httpd:httpd: Could not reliably determine the server’s fully qualified domain name, using 0.0.0.133 for ServerName                                                          [确定] 修改mysql配置文件

 [root@localhost ~]# vim /etc/my.cnf增加如下内容

[mysql]default-character-set=utf8[mysqld]character_set_server=utf8 启动mysql

 [root@localhost ~]# /etc/init.d/mysqld startPlease report any problems with the /usr/bin/mysqlbug script!                                                          [确定]正在启动 mysqld:                                          [确定]      创建数据库,导入数据

 [root@localhost ~]# mysql -uroot -e “create database zabbix” [root@localhost ~]# mysql -uroot –default-character-set=utf8 zabbix < /usr/share/zabbix-mysql/schema.sql [root@localhost ~]# mysql -uroot –default-character-set=utf8 zabbix < /usr/share/zabbix-mysql/images.sql [root@localhost ~]# mysql -uroot –default-character-set=utf8 zabbix < /usr/share/zabbix-mysql/data.sql [root@localhost ~]# mysql -uroot -e “grant all on *.* to ‘zabbix’@’localhost’ identified by ‘zabbix’;”      编辑zabbix-server配置文件,配置DBUser,DBPassword,然后重启zabbix-server。

 [root@localhost ~]## vim /etc/zabbix/zabbix_server.confDBUser=zabbixDBPassword=zabbix [root@localhost ~]# /etc/init.d/zabbix-server restartShutting down Zabbix server:                              [失败]Starting Zabbix server:                                    [确定] [root@localhost ~]# netstat -lnp|grep zabbixtcp        0      0 0.0.0.0:10050              0.0.0.0:*                  LISTEN      1691/zabbix_agentdtcp        0      0 0.0.0.0:10051              0.0.0.0:*                  LISTEN      2078/zabbix_servertcp        0      0 :::10050                    :::*                        LISTEN      1691/zabbix_agentdtcp        0      0 :::10051                    :::*                        LISTEN      2078/zabbix_server 网页安装zabbix

      浏览器访问 http://ip/zabbix,默认会有“It is not safe to rely on the system’s timezone settings”这样的警告信息,根据其中提示,需要 vim /etc/php.ini 设置 date.timezone=”Asia/Shanghai”,重启apache后刷新就没有了,点next。
wKiom1d6YZmhbi8sAAEaQMOgHrc357.png
wKiom1d6YZmhbi8sAAEaQMOgHrc357.png

        它会提示一些参数不合适:
wKiom1d6YaSjHNZSAAE9AbFOECk682.png

        编辑配置文件 /etc/php.ini,修改对应的项目,然后点击retry。
 [root@localhost ~]# vim /etc/php.inipost_max_size = 16Mmax_execution_time = 300max_input_time = 300 [root@localhost ~]# service httpd restart停止 httpd:                                              [确定]正在启动 httpd:httpd: Could not reliably determine the server’s fully qualified domain name, using 0.0.0.133 for ServerName                                                          [确定]

wKiom1d6YaezHg3hAAEpUswH7xg707.png

        然后接着输入mysql的信息,首先测试一下,不通过则需要调试,通过则下一步。
wKioL1d6Ya7iwZIEAAKLdhIurpk263.png
        前两项保持默认,其中zabbix-server的port可以用netstat -lnp|grep zabbix查看,Name是可以自定义的,可以写zabbix所在服务器的主机名(这个名字会在web界面上显示,建议写的比较有意义一些) ,下面就是一路next到finish。
wKiom1d6YbCTX9NAAADldJQk7hE944.png
wKioL1d6YbGiJG-WAAECGsu7exs425.png
wKioL1d6YbTAIDSYAADQ4e3D3p4897.png

        下面即进入登录界面,默认管理员账号为 admin,密码为 zabbix。
wKiom1d6YbeimUPnAAEjIrnRVQo831.png
wKioL1d6Yb6iX-5rAAFgBwCVKi4685.png

登陆后如果提示zabbix server is running 值为no的话,需要将server服务器的selinux、iptables关掉,具体操作方式如下:

关闭SELinux的方法:
修改/etc/selinux/config文件中的SELINUX=”” 为 disabled ,然后重启。
如果不想重启系统,使用命令setenforce 0
注:
setenforce 1 设置SELinux 成为enforcing模式
setenforce 0 设置SELinux 成为permissive模式
在lilo或者grub的启动参数中增加:selinux=0,也可以关闭selinux
关闭iptables的方法:
service iptables stop
chkconfig iptables off

 

配置zabbix相关服务开机自动重启:
安装完成后服务器重启,进程均没有自动启动,需要配置开机自动重启。
 chkconfig –add zabbix_server
chkconfig –add zabbix-agent
chkconfig –add httpd
chkconfig –add mysqld
chkconfig –level 345 zabbix-server on

chkconfig –level 345 zabbix-agent on
chkconfig –level 345 mysqld on
 chkconfig –level 345 httpd on
启动后zabbix服务端的日志放在/var/log/zabbixsrv/zabbix_server.log中,如果启动过程中有任何问题可以查看这个日志
启动后如果还提示zabbix server is running,查看zabbix的日志有out of memory的错误提示,需要修改/etc/zabbix_server.conf,修改为如下所示的配置。主要是修改CacheSize的值,根据机器性能修改为100M即可。
LogFile=/var/log/zabbixsrv/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbixsrv/zabbix_server.pid
DBName=zabbix
DBUser=zabbix
 DBPassword=zabbix
DBSocket=/var/lib/mysql/mysql.sock
 StartVMwareCollectors=5
 VMwareFrequency=60
VMwareCacheSize=2000M
CacheSize=100M
AlertScriptsPath=/var/lib/zabbixsrv/alertscripts
ExternalScripts=/var/lib/zabbixsrv/externalscripts
TmpDir=/var/lib/zabbixsrv/t

如何汉化
zabbix2.2.11发现不能汉化,本人觉得还是不汉化好,想要汉化修改一下,如下:
1、 服务端/usr/share/zabbix/include/locales.inc.php文件
2、修改 locales.inc.php内容为:’zh_CN’ => array(‘name’ => _(‘Chinese (zh_CN)’),        ‘display’ => true),
      默认是false,所以不显示Chinese(zh_CN)。保存退出。
3、在web端,按下图设置即可配置为中文模式

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/218992.html<

(0)
运维的头像运维
上一篇2025-04-13 21:55
下一篇 2025-04-13 21:56

相关推荐

  • 个人主题怎么制作?

    制作个人主题是一个将个人风格、兴趣或专业领域转化为视觉化或结构化内容的过程,无论是用于个人博客、作品集、社交媒体账号还是品牌形象,核心都是围绕“个人特色”展开,以下从定位、内容规划、视觉设计、技术实现四个维度,详细拆解制作个人主题的完整流程,明确主题定位:找到个人特色的核心主题定位是所有工作的起点,需要先回答……

    2025-11-20
    0
  • 社群营销管理关键是什么?

    社群营销的核心在于通过建立有温度、有价值、有归属感的社群,实现用户留存、转化和品牌传播,其管理需贯穿“目标定位-内容运营-用户互动-数据驱动-风险控制”全流程,以下从五个维度展开详细说明:明确社群定位与目标社群管理的首要任务是精准定位,需明确社群的核心价值(如行业交流、产品使用指导、兴趣分享等)、目标用户画像……

    2025-11-20
    0
  • 香港公司网站备案需要什么材料?

    香港公司进行网站备案是一个涉及多部门协调、流程相对严谨的过程,尤其需兼顾中国内地与香港两地的监管要求,由于香港公司注册地与中国内地不同,其网站若主要服务内地用户或使用内地服务器,需根据服务器位置、网站内容性质等,选择对应的备案路径(如工信部ICP备案或公安备案),以下从备案主体资格、流程步骤、材料准备、注意事项……

    2025-11-20
    0
  • 如何企业上云推广

    企业上云已成为数字化转型的核心战略,但推广过程中需结合行业特性、企业痛点与市场需求,构建系统性、多维度的推广体系,以下从市场定位、策略设计、执行落地及效果优化四个维度,详细拆解企业上云推广的实践路径,精准定位:明确目标企业与核心价值企业上云并非“一刀切”的方案,需先锁定目标客户群体,提炼差异化价值主张,客户分层……

    2025-11-20
    0
  • PS设计搜索框的实用技巧有哪些?

    在PS中设计一个美观且功能性的搜索框需要结合创意构思、视觉设计和用户体验考量,以下从设计思路、制作步骤、细节优化及交互预览等方面详细说明,帮助打造符合需求的搜索框,设计前的规划明确使用场景:根据网站或APP的整体风格确定搜索框的调性,例如极简风适合细线条和纯色,科技感适合渐变和发光效果,电商类则可能需要突出搜索……

    2025-11-20
    0

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注