Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Using yum to quickly build zabbix2.2

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

System version: CentOS 6.9

The software version installed by yum is: zabbix2.2.16,apache2.2.15,mysql5.1.73

(permanent address of this article: http://woymk.blog.51cto.com/10000269/1924813)

The installation steps are as follows:

1. Install the package

Install the epel extension source

Rpm-ivh http://mirrors.sohu.com/fedora-epel/epel-release-latest-6.noarch.rpm

Yum installs lamp environment

Yum install-y httpd mysql mysql-libs php php-mysql mysql-server php-bcmath php-gd php-mbstring

Yum installs the zabbix package

Yum install-y zabbix22 zabbix22-agent zabbix22-server zabbix22-server-mysql zabbix22-web zabbix22-web-mysql net-snmp-devel

Modify apache configuration file

Vi / etc/httpd/conf/httpd.conf

find

# ServerName www.example.com:80

Change to

ServerName localhost:80

Start zabbix

/ etc/init.d/zabbix-server start

/ etc/init.d/zabbix-agent start

Start apache

/ etc/init.d/httpd start

Modify mysql configuration file

Vi / etc/my.cnf

To modify or add.

[mysql]

Default-character-set = utf8

[mysqld]

Character_set_server = utf8

Start mysql

/ etc/init.d/mysqld start

Modify the password

/ usr/bin/mysqladmin-u root password' new-password'

Build a library and import data

Mysql-uroot-p-e "create database zabbix"

Mysql-uroot-p-- default-character-set=utf8 zabbix < / usr/share/zabbix-mysql/schema.sql

Mysql-uroot-p-- default-character-set=utf8 zabbix < / usr/share/zabbix-mysql/p_w_picpaths.sql

Mysql-uroot-p-- default-character-set=utf8 zabbix < / usr/share/zabbix-mysql/data.sql

Authorized user

Mysql-uroot-p-e "grant all on zabbix.* to 'zabbix'@localhost identified by' 1234'"

Remember the library name, user name and password set here, which will be used later.

two。 Install zabbix on the web page

Browser access

Http://ip/zabbix

If the web page is unreachable, please check that iptables and selinux are closed.

Temporarily shut down iptables and selinux:

Iptables-F

Setenforce 0

Click [Next] to continue

Modify the configuration in / etc/php.ini according to the prompts on the page

Change time zone to

Date.timezone= "Asia/Chongqing"

Restart apache after modification

/ etc/init.d/httpd restart

Then click [Retry] and you will have all "OK".

Click [Next] to continue

Fill in the database name, user name and password you just wrote down

Point [Test connection] test

Continue to click [Next] after testing

Fill in the server name

Next, follow the prompts to operate all the way [Next], and finally click [Finish].

Modify the configuration file after installation

Vi / etc/zabbix/zabbix_server.conf

Modify the DBUser and DBPassword in it, such as:

DBPassword=1234

Restart the service

/ etc/init.d/zabbix-server restart

Next, log in to zabbix

The default administrator account is admin:zabbix

Click [Sign in] login

Login is in English by default, and we can set it to Chinese

Click [Profile] in the upper right corner, find the [Language] option, change it to [Chinese (zh CN)], and click [Save].

Zabbix has been successfully installed

The solution of Chinese garbled Code in zabbix

When displaying Chinese in zabbix, there will be garbled codes, because there is no Chinese font, so you just need to copy the font in windows. Windows font file c:\ windows\ fonts directory, for example, Chinese Font Song font file name is STFANGSO.ttf.

Upload the font file to the system (you can upload it using file transfer tools such as PSFTP) and overwrite the original font file

Mv STFANGSO.ttf / usr/share/fonts/dejavu/DejaVuSans.ttf

Or

Modify the configuration file

Vi / usr/share/zabbix/include/defines.inc.php

Find the following two lines

Define ('ZBX_FONTPATH',' / usr/share/fonts/dejavu'); / / Font directory

Define ('ZBX_GRAPH_FONT_NAME',' DejaVuSans'); / / Font file name

Modify the font file name and the directory where the font is located. Note that you do not need to write .font after the file name. Ttf

3. Access to the host to be monitored

Install the zabbix client with yum on the client

Yum install zabbix22-agent

Modify configuration

Vi / etc/zabbix_agentd.conf

Change the Server= server ip

ServerActive= server ip # active mode

Hostname= custom name, to be unique

Start the client after saving

/ etc/init.d/zabbix-agent start

Execute the following command test on the server

Zabbix_get-s client ip-p10050-k "system.hostname"

If you can get the client hostname, the connection is normal.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report