lchl0388 发表于 2019-1-20 10:37:24

zabbix2.4安装笔记

zabbix2.4安装笔记
  一、关闭防火墙和Selinux
  临时性的完全关闭防火墙,可以不重启机器:
  /etc/init.d/iptables status                ## 查看防火墙状态
  /etc/init.d/iptable stop                  ## 本次关闭防火墙
  /etc/init.d/iptable restart                ## 重启防火墙
  永久性关闭防火墙:
  chkconfig --level 35 iptables off   ## 注意中间的是两个英式小短线;重启
  [查看状态root@bogon selinux]# /etc/init.d/iptables status
  iptables: Firewall is not running.
  关闭selinux
  vi /etc/selinux/conf
  修改SELINUX=disabled
  

  [查看状态root@bogon selinux]# /usr/sbin/sestatus -v
  SELinux status:               disabled
  

  二、配置zabbix的yum安装源
  centos6.X   
rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm

centos5.X   
rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
  # pwd
  /etc/yum.repos.d
  # ll
  total 20
  -rw-r--r--. 1 root root 1924 Jan6 23:31 CentOS-Base.repo
  -rw-r--r--. 1 root root638 Nov 272013 CentOS-Debuginfo.repo
  -rw-r--r--. 1 root root630 Nov 272013 CentOS-Media.repo
  -rw-r--r--. 1 root root 3664 Nov 272013 CentOS-Vault.repo
  -rw-r--r--. 1 root root401 Sep 11 16:10 zabbix.repo
  

  

  

  三、yum安装所需的安装包
  yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent mysql-server mysql -y
  

  四、配置数据库并导入数据
  配置数据库
  # /etc/init.d/mysqld start
  Initializing MySQL database:Installing MySQL system tables...
  OK
  mysql -e "create database zabbix character set utf8 collate utf8_bin;"
  mysql
  grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
  flush privileges;
  

  导入数据库
  # cd usr/share/doc/zabbix-server-mysql-2.4.3/
  # ls
  createupgrades
  # cd create/
  # ls
  data.sqlimages.sqlschema.sql
  # mysql zabbix < schema.sql
  # mysql zabbix < images.sql
  # mysql zabbix < data.sql
  五、修改配置文件zabbix_server.conf
  # cd /etc/zabbix/
  # ls
  webzabbix_agentd.confzabbix_agentd.dzabbix_server.conf
  配置控制文件,添加DBPassword=zabbix语句,然后保存退出。
  # Mandatory: no
  # Default:
  # DBPassword=
  DBPassword=zabbix
  

  ### Option: DBSocket
  

  修改php.ini的timezone
  
  ; Defines the default timezone used by the date functions
  ; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
  ;date.timezone =
  date.timezone =Asia/Chongqing
  

  启动服务:
  /etc/init.d/zabbix-server start
  /etc/init.d/zabbix-agent start
  service httpd start
  

  设置开机启动
  chkconfig mysqld on
  chkconfig zabbix-server on
  chkconfig zabbix-agent on
  chkconfig httpd on
  

  中文汉语支持
  修改配置文件/usr/share/zabbix/include/locales.inc.php将zh_CN的falus修改为true)
  function getLocales() {
        return array(
                  'en_GB' => array('name' => _('English (en_GB)'),      'display' => true),
                  'en_US' => array('name' => _('English (en_US)'),      'display' => true),
                  'bg_BG' => array('name' => _('Bulgarian (bg_BG)'),      'display' => false),
                  'zh_CN' => array('name' => _('Chinese (zh_CN)'),      'display' => true),
                  'zh_TW' => array('name' => _('Chinese (zh_TW)'),      'display' => false),
  

  图形中汉字乱码问题
  这个问题是由于zabbix的web端没有中文字库,从windows下控制面板->字体->选择一种中文字库复制(例如“楷体”),更名为graphfont.ttf。然后覆盖掉/usr/share/zabbix/fonts/下的graphfont.ttf(记得对原有graphfont.ttf文件备份),重启服务,刷新页面,
  

  注释:1、zabbix web登陆地址为http://IP地址/zabbix,如http://192.168.1.100/zabbix
  2、zabbix web默认的账户为Admin 密码为zabbix
  

  (3) 安装zabbix客户端并启动
进入到目标主机的c:\zabbix目录下,执行如下命令完成客户端的安装:
zabbix_agentd.exe -c c:\zabbix\zabbix_agentd.conf -i
执行如下命令,启动客户端:
zabbix_agentd.exe -c c:\zabbix\zabbix_agentd.conf -s
参数含义:
-c    制定配置文件所在位置
-I   是安装客户端(注册服务)
-s   启动客户端
-x    停止客户端
-d    卸载客户端



zabbix_agentd.conf文件内容
LogFile=c:\zabbix_agentd.log

Server=192.168.0.11#zabbix server的IP地址

ServerActive=192.168.0.11

Hostname=xyhx
  

  



附件:http://down.运维网.com/data/2365403

页: [1]
查看完整版本: zabbix2.4安装笔记