Zabbix3.0 Install

Zabbix3.0 Install

#install epel-release adn zabbix requires package

yum install epel-release

yum install -y unzip vim lrzsz wget gcc gcc-c++ glibc glibc-devel automakelibaio libaio-devel

ntpdate pool.ntp.org

#install mysql

groupadd mysql

useradd -r -g mysql -s /bin/false mysql

mkdir -p /opt/mysql/{data,log}  && chown -R mysql.mysql /opt/mysql

chmod -R 755 /opt/mysql

vim /etc/my.cnf

[client]

port = 3306

socket=/opt/mysql/data/mysql.sock

[mysqld]

port = 3306

user=mysql

socket=/opt/mysql/data/mysql.sock

datadir=/opt/mysql/data

character_set_server=utf8

expire_logs_days = 15

explicit_defaults_for_timestamp=true

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

skip-name-resolve

wait_timeout = 28800

query_cache_type = 1

innodb_file_per_table = 1

innodb_file_format = barracuda

innodb_strict_mode = 1

relay-log = relay-bin

back_log = 512

max_connections = 1024

max_connect_errors = 512

table_open_cache = 512

max_allowed_packet = 1024M

binlog_cache_size = 16M

max_heap_table_size = 64M

read_buffer_size = 2M

read_rnd_buffer_size = 2M

sort_buffer_size = 2M

join_buffer_size = 4M

thread_cache_size = 16

thread_concurrency = 8

query_cache_size = 32M

query_cache_limit = 4M

ft_min_word_len = 4

default-storage-engine = innodb

thread_stack = 256K

transaction_isolation = REPEATABLE-READ

tmp_table_size = 32M

log-bin=mysql-bin

binlog_format=mixed

log_slave_updates

slow_query_log

slow_query_log_file = mysql-slow.log

long_query_time = 2

server-id = 1921683123

key_buffer_size = 128M

bulk_insert_buffer_size = 64M

myisam_sort_buffer_size = 64M

myisam_max_sort_file_size = 10G

myisam_repair_threads = 1

myisam_recover

innodb_use_sys_malloc= on

innodb_buffer_pool_size = 3G

innodb_data_file_path = ibdata1:10M:autoextend

innodb_data_home_dir=/opt/mysql/data

innodb_write_io_threads = 8

innodb_read_io_threads = 8

innodb_thread_concurrency = 16

innodb_flush_log_at_trx_commit = 1

sync_binlog=1

innodb_log_buffer_size = 16M

innodb_log_file_size = 256M

innodb_log_files_in_group = 5

innodb_max_dirty_pages_pct = 90

innodb_lock_wait_timeout = 120

innodb_monitor_enable = ‘%‘

performance_schema = ON

performance_schema_instrument = ‘%=on‘

[mysqldump]

quick

max_allowed_packet = 1024M

[mysql]

no-auto-rehash

[myisamchk]

key_buffer_size = 512M

sort_buffer_size = 512M

read_buffer = 8M

write_buffer = 8M

[mysqlhotcopy]

interactive-timeout

[mysqld_safe]

open-files-limit = 65536

log-error=/opt/mysql/log/mysqld_run_error.log

pid-file=/opt/mysql/mysqld.pid

chown mysql.mysql /etc/my.cnf

chmod 755 /etc/my.cnf

rpm -ivh MySQL-server-5.6.26-1.el6.x86_64.rpm

rpm -ivh MySQL-shared-5.6.26-1.el6.x86_64.rpm

rpm -ivh MySQL-client-5.6.26-1.el6.x86_64.rpm

rpm -ivh MySQL-devel-5.6.26-1.el6.x86_64.rpm

mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

mysql -u root mysql

UPDATE user SET Password=PASSWORD(‘123456‘) where USER=‘root‘;

flush privileges;

#Create zabbix database

mysql> create database zabbix character set utf8;

mysql> grant all privileges on zabbix.* to [email protected] identified by ‘zabbixpwd‘;

mysql> grant all privileges on zabbix.* to [email protected]"%" identified by "zabbixpwd" ;

mysql> flush privileges;

#Import zabbix db

mysql> source /root/zabbix-3.0.1/database/mysql/schema.sql;

mysql> source /root/zabbix-3.0.1/database/mysql/images.sql;

mysql> source /root/zabbix-3.0.1/database/mysql/data.sql;

#Zabbix and php requires package

yum install -y libpng-devel libpng freetype mcrypt libmcrypt-devel freetype-devel libvpx libvpx-devel openssl openssl-devel policycoreutils nasm nasm*  libxml2 libxml2-devel libtiff libtiff-devel gd gd-devel libXpm libXpm-devel  gmp gmp-devel bzip2 bzip2-devel libjpeg libjpeg-devel zlib zlib-devel fontconfig fontconfig-devel curl curl-devel mhash mhash-devel enca perl-libintl libcroco gettext gettext-devel t1lib t1lib-devel expat expat-devel systemtap-sdt-devellibicu-devel gd gd-devel enca libxslt libxslt-devel libc-client-devel openldap-devel  unixODBC-devel postgresql-devel  sqlite-devel aspell-devel net-snmp-devel pcre-devel db4-devel libc-client-devel

ln -s /usr/lib64/libexpat.* /usr/lib/

cp /usr/lib64/libmysqlclient.* /usr/lib/

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

tar zvxf libiconv-1.14.tar.gz

cd libiconv-1.14

./configure

make && make install

ln -s /usr/local/lib/libiconv.so.2 /usr/lib64/

#Install PHP

./configure --prefix=/usr/local/php --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d--with-mysqli=/usr/bin/mysql_config --with-ldap --with-mysql --with-mcrypt --with-freetype-dir --with-gettext --with-png-dir --with-openssl --with-jpeg-dir=/usr/lib --with-pcre-dir --with-pcre-regex --with-zlib --with-gd --with-vpx-dir --with-iconv --with-png-dir --with-t1lib --with-gettext --with-gmp --with-xpm-dir=/usr/lib --with-mhash  --enable-pcntl --with-xmlrpc --with-libxml-dir --with-libexpat-dir --with-pdo-mysql --with-curl --enable-bcmath --enable-shmop --enable-sysvsem --enable-exif --enable-zip --enable-inline-optimization --enable-shmop --enable-sockets --enable-mbregex --enable-pcntl --enable-dba --enable-calendar --enable-libgcc --enable-fpm --enable-mbstring --enable-gd-native-ttf  --enable-ftp --enable-gd-jis-conv --enable-sysvsem --enable-sysvshm--enable-inline-optimization --enable-zip --enable-soap --enable-opcache --disable-maintainer-zts --enable-static --enable-mbstring --enable-intl --enable-sysvmsg --enable-wddx --enable-dtrace --enable-sigchild --enable-phpdbg --enable-mod-charset --enable-re2c-cgoto --enable-embedded-mysqli=shared --enable-shared  --enable-session

#Load php.ini

/usr/local/php/bin/php --ini

#Testing php-fpm.conf

/usr/local/php/sbin/php-fpm --test

#php.ini

always_populate_raw_post_data = -1

date.timezone = "Asia/Shanghai"

max_execution_time = 300

memory_limit = 128M

post_max_size = 16M

max_input_time = 300

#nginx install

./configure --prefix=/usr/local/nginx --with-http_ssl_module --user=nginx --group=nginx --with-threads --with-pcre=~/pcre-8.35 --with-zlib=~/zlib-1.2.8 --with-mail_ssl_module --with-mail --with-stream --with-http_ssl_module --with-http_dav_module --with-http_auth_request_module --with-http_gzip_static_module --with-http_sub_module --with-stream_ssl_module

#zabbix requires pakages

yum install -y net-snmp net-snmp-devel net-snmp-python net-snmp-utils net-snmp-perl snmptt libssh2-devel openssl-devel OpenIPMI-devel OpenIPMI libssh2 iksemel iksemel-devel fping vim wget libX11 libX11-devel openldap openldap-devel  telnet ntpdate

#zabbix install

./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-ldap --with-openssl --with-openipmi --with-ssh2

#zabbix client

./configure --prefix=/usr/local/zabbix  --enable-agent

#Setting up Zabbix to receive SNMP traps

#http://www.zabbix.org/wiki/Start_with_SNMP_traps_in_Zabbix

cp ~/zabbix-3.0.1/misc/snmptrap/zabbix_trap_receiver.pl /usr/bin

chmod +x /usr/bin/zabbix_trap_receiver.pl

vi /etc/snmp/snmptrapd.conf

# you can set multiple community names:

# authCommunity execute public

# authCommunity execute [email protected]

authCommunity execute public

perl do "/usr/bin/zabbix_trap_receiver.pl";

vi /etc/zabbix/zabbix_server.conf

StartSNMPTrapper=1

SNMPTrapperFile=/tmp/zabbix_traps.tmp

/etc/init.d/zabbix-server restart

chkconfig snmptrapd on

/etc/init.d/snmptrapd restart

mkdir -p /var/log/zabbix_traps_archive

/etc/logrotate.d/zabbix_traps contents :

/tmp/zabbix_traps.tmp {

weekly

size 10M

compress

compresscmd /usr/bin/bzip2

compressoptions -9

notifempty

dateext

dateformat -%Y%m%d

missingok

maxage 365

rotate 10

}

#Testing

#Send test trap:

snmptrap -v 1 -c public 127.0.0.1 ‘.1.3.6.1.6.3.1.1.5.4‘ ‘0.0.0.0‘ 6 33 ‘55‘ .1.3.6.1.6.3.1.1.5.4 s "eth0"

#and check that trap received in the /tmp/zabbix_traps.tmp. You should see:

18:58:38 2014/02/26 ZBXTRAP 127.0.0.1

PDU INFO:

notificationtype               TRAP

version                        0

receivedfrom                   UDP: [127.0.0.1]:40780->[127.0.0.1]

errorstatus                    0

messageid                      0

community                      public

transactionid                  7

errorindex                     0

requestid                      0

VARBINDS:

DISMAN-EVENT-MIB::sysUpTimeInstance type=67 value=Timeticks: (55) 0:00:00.55

SNMPv2-MIB::snmpTrapOID.0      type=6value=OID: IF-MIB::linkUp.0.33

IF-MIB::linkUp type=4  value=STRING: "eth0"  SNMP-COMMUNITY

MIB::snmpTrapCommunity.0 type=4  value=STRING: "public"

SNMPv2-MIB::snmpTrapEnterprise.0 type=6  value=OID: IF-MIB::linkUp

cat >> /etc/services << EOF

zabbix-agent    10050/tcp               #Zabbix Agent

zabbix-agent    10050/udp               #Zabbix Agent

zabbix-trapper  10051/tcp               #Zabbix Trapper

zabbix-trapper  10051/udp               #Zabbix Trapper

EOF

解决中文乱码问题:

中文支持:

zabbix实际是有中文语言的,我们可以通过修改web端源文件来开启中文语言。

修改你的 /include/locales.inc.php 这个文件

‘zh_CN‘ => [‘name‘ => _(‘Chinese (zh_CN)‘), ‘display‘ => true], #也就是把false改为true

找到本地 C:\Windows\Fonts\simkai.ttf(楷体)上传到服务器 zabbix 网站目录 fonts 目录下。

Linux

2.2 修改 zabbix php 配置文件

# cd /data/site/www.ttlsa.com/zabbix/

# 我 zabbix 安装目录

# sed -i ‘s/DejaVuSans/simkai/g‘ ./include/defines.inc.php

UserParameter= {使用脚本获取值}

来源: https://d.docs.live.net/227b85655d89fc2d/Zabbix3.0%20Install.docx

来自为知笔记(Wiz)

时间: 2024-09-29 19:32:53

Zabbix3.0 Install的相关文章

zabbix2.4.5迁移到zabbix3.0

参考文档 http://qicheng0211.blog.51cto.com/3958621/1744603 起因 zabbix 2.4.5数据库mysql突然死掉了,查找mysql数据库日志发现保存数据磁盘读写错误,原来那是台r410的老机,后来索性换了1台R610的稍微好的机子,现在机器都换了打算zabbix版本也 一块儿换掉,开启zabbix3.0模式,下面是主要步骤,数据库这块儿是这次才发现有个简单方法的. 0,首先要有原来数据库备份 硬件服务器也升级了 ,只有最近一份数据库全部备份,发

CentOS6下yum升级Zabbix2.2/2.4到Zabbix3.0

本文适用于在CentOS6下zabbix2.2及以上版本升级到zabbix3.0.     zabbix3.0的环境要求: Software Version Comments MySQL 5.0.3 or later Apache 1.3.12 or later PHP 5.4.0 or later PHP v7 is not supported yet. libcurl  For SMTP authentication, version 7.20.0 or higher is required

zabbix-3.0.4安装部署

zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案,由一个国外的团队持续维护更新,软件可以自由下载使用,运作团队靠提供收费的技术支持赢利.zabbix由2部分构成,zabbix server与可选组件zabbix agent.zabbix server可以通过SNMP,zabbix agent,ping,端口监视等方法提供对远程服务器/网络状态的监视,数据收集等功能.zabbix agent需要安装在被监视的目标服务器上,它主要完成对硬件信息或与操作系统有

zabbix2.2升级到zabbix3.0.2

1.操作系统环境 [[email protected] ~]# cat /etc/issue CentOS release 6.4 (Final) Kernel \r on an \m [[email protected] ~]# uname -r 2.6.32-358.el6.x86_64 [[email protected] ~]# uname -m x86_64 备份备份.. [[email protected] ~]# cp -a /usr/share/zabbix /tmp/zabbi

zabbix3.0/3.2/3.4自动安装脚本

自动化安装zabbix脚本(3.0/3.2/3.4) 一.zabbix简介 zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案.zabbix能监视各种网络参数,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题. 二.zabbix特点 1.企业级的.开源的.分布式 2.灵活的告警机制.存储数据提供杰出的报告及图形 3.通过内置的绘图方法实现监控数据实时绘图 4.允许灵活地自定义问题阀值 5.支持主动与被动方式(agen

centos6.5 搭建zabbix3.0

一.搭建LAMP平台 注意zabbix3.0需要php5.4以上的版本 (1)安装依赖包 httpd和mysql安装过程省略 rpm -e httpd --nodeps yum -y install mysql-devel gcc gcc-c++ autoconf httpd-manual mod_perl mod_auth_mysql mysql-connector-odbc libdbi-dbd-mysql net-snmp-devel curl-devel unixODBC-devel j

ZABBIX3.0在CentOS6.6上的安装部署

Zabbix3.0界面焕然一新,一改10多年的老面孔,alpha4的更新具体记录下:http://www.zabbix.com/rn3.0.0alpha4.php What's New in 3.0.0alpha4 Zabbix 3.0安装过程与2.x的变化类似,但又少许需要注意的坑(以下标红的),否则会坑的不行... 基础环境: CentOS 6.6 X64 Nginx:1.9.7 Mysql:5.5.32 PHP:5.5.30( zabbix_3.0 要求php版本至少在5.4以上 ) 一.

zabbix3.0安装教程(环境)

 ZABBIX 安装图解教程(环境篇) 说明: 操作系统:Centos6.x(64) IP地址:192.168.1.1 Web环境:Mysql+Nginx+php Zabbix版本:zabbix3.0.3 备注:Linux下安装zabbix需要有LAMP或者LNMP运行环境   准备篇: 一.WEB环境安装:Mysql+Nginx+php CentOS 6.x编译安装Nginx1.8.0+MySQL5.1.73+PHP5.6.23 安装篇: 一.mysql安装 1.下载mysql到/usr/lo

centos7.2 安装zabbix3.0详解

关闭防火墙: systemctl stop firewalld.service systemctl disable firewalld.service 关闭selinux: [[email protected] ~]# setenforce 0 [[email protected] ~]# sed -i'/SELINUX/s/enforcing/disabled/' /etc/selinux/config 配置yun源 rpm -ivh http://repo.zabbix.com/zabbix