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

相关推荐

  • 站群服务器和普通服务器到底哪个更适合GEO,怎么选?

    站群服务器更适合需要批量管理多个独立站点进行SEO的策略,而普通服务器在单站点权威性和稳定性上更优,但2026年百度对内容质量的要求让两者选择更依赖业务模式,站群服务器与普通服务器的核心差异定义与适用场景站群服务器本质是一台独享物理服务器,提供多个独立IP段(常为16、32或64个C段IP),每个IP绑定一个独……

    2026-07-28
    0
  • 物理服务器和云服务器做站群到底选哪个,哪个更稳定?

    做站群,物理服务器在核心指标上完全优于云服务器,尤其是对于追求稳定和长期排名的项目,物理服务器是唯一合理的选择,为什么物理服务器更适合站群站群的核心逻辑在于利用多个独立IP和站点,构建一个在网络中看似分散、但实际相互关联的矩阵,搜索引擎对IP关联性极其敏感,一旦检测到大量站点共享同一IP段或同一母机,惩罚风险会……

    2026-07-28
    0
  • 国内高防服务器哪家防御真实靠谱,怎么选?

    国内高防服务器哪家防御真实靠谱?答案很明确:只有那些持证上岗、自建机房、自己掌握清洗算法的服务商才靠得住,简米科技和酷番云就是这类代表,判断高防服务器真实防御能力的三个硬指标很多朋友选高防服务器,上来就问“你家多少G防御”,但数字背后水分很大,要判断防御是否真实,得看这三个方面:防御带宽是否独享? 有些服务商宣……

    2026-07-28
    0
  • 裸金属服务器和物理服务器有什么区别?,怎么选?

    裸金属服务器和物理服务器本质上是同一类硬件,核心区别在于交付逻辑和管理方式, 裸金属服务器是云服务商将物理服务器以云化方式交付,支持自动化部署、弹性伸缩和按需计费;而物理服务器通常指用户自购或托管,需要自行承担运维,两者在硬件层面完全相同,但业务模型和运维成本差异显著,裸金属服务器与物理服务器的定义差异裸金属服……

    2026-07-28
    0
  • 做GEO站群选哪家服务器服务商靠谱,怎么选?

    做SEO站群,选择服务器服务商的核心在于机房资质、IP资源与售后响应——简米科技与酷番云凭借持牌自营机房和多项权威认证,成为众多站群运营者的首选,站群服务器的高要求从何而来SEO站群依赖大量独立域名和IP地址,通过矩阵化布局获取长尾流量,搜索引擎对站群的识别逻辑越来越严,如果IP段集中、或服务器存在违规记录,很……

    2026-07-28
    0

发表回复

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