In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Based on centos6.5 + zabbix-2.4.6 and most of the commands are in the zabbix installation path! For example, / usr/local/zabbix/
Yum-y install gcc gcc-c++ autoconf httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmath mysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp-devel curl-devel
Edit the PHP-related / etc/php.ini file. (the response must be modified here, otherwise an error will be reported later in the web initialization process. )
If the yum installation is not successful, download php-bcmath-5.3.3-26.el6.x86x64; and php-mbstring-5.3.3-26.el6.x86_64, two rpm packages, and run
Yum-y install php-*, then execute the yum installation command in the first step!
Vim / etc/php.ini
Modify the following entries or use the sed command to replace the content
Date.timezone = Asia/Shanghai
Max_execution_time = 300
Post_max_size = 16m # # sometimes it is set to 32m, but according to the information in the initialization prompt later, it is required to set to 16m
Max_input_time=300
Memory_limit = 128m
Mbstring.func_overload = 2 # sometimes there is an error in the installation interface, so log out this line. (mbstring.func_overload does not show okeboxes! )
Or replace the content through sed:
# sed-I "sbank date. Timezone = / date.timezone = Asia\ / Shanghai/g" / etc/php.ini
# sed-I "s#max_execution_time = 30#max_execution_time = 300g" / etc/php.ini
# sed-I "s#post_max_size = 8M#post_max_size = 32M#g" / etc/php.ini
# sed-I "s#max_input_time = 60#max_input_time = 300g" / etc/php.ini
# sed-I "s#memory_limit = 128M#memory_limit = 128M#g" / etc/php.ini
# sed-I "/; mbstring.func_overload = 0Universe ambstring.functionally overload = 2\ n" / etc/php.ini
Finally, turn on httpd and set the boot self-boot.
# chkconfig httpd on
# service httpd start
2. Preparation of MySQL database
Turn on mysql and set Boot self-boot:
# chkconfig mysqld on
# service mysqld start
Add the zabbix user for the mysql database and set the password:
Log in to mysql as root and execute the following command
Mysql > use mysql
Mysql > insert into mysql.user (Host,User,Password) values ("localhost", "zabbix", password ("zabbix"))
Mysql > flush privileges
3. Create zabbix users for centos system
# groupadd zabbix-g 501
# useradd-g zabbix-u 501-m zabbix
PS: here the UID and GID of zabbix users are both set to 501.
# tar xvf zabbix-2.x.x.tar.gz
#. / configure-prefix=/usr/local/zabbix-enable-server-enable-proxy-enable-agent-with-mysql=/usr/bin/mysql_config-with-net-snmp-with-libcurl
# make
# make install
3. Check whether zabbix is added to the system service file.
# tail-N4 / etc/services
If you see the following message, it means it has been added successfully, or you can manually add it to the / etc/services file:
Zabbix-agent 10050/tcp # Zabbix Agent
Zabbix-agent 10050/udp # Zabbix Agent
Zabbix-trapper 10051/tcp # Zabbix Trapper
Zabbix-trapper 10051/udp # Zabbix Trappe
4. Set up the database needed by zabbix
Root identity and others go to the mysql database and execute the following command to establish the zabbix database:
Mysql > create database zabbix character set utf8
Mysql > grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'
Mysql > flush privileges
Then there is a database/mysql subdirectory in the downloaded source file, which is stored in the SQL script file that establishes the zabbix database structure. First go to the directory where the zabbix source file is located and execute the following statement:
# mysql-u zabbix-p zabbix <. / database/mysql/schema.sql
# mysql-u zabbix-p zabbix <. / database/mysql/p_w_picpaths.sql
# mysql-u zabbix-p zabbix <. / database/mysql/data.sql
PS: the above three instructions are intended to execute the sql script and build the structure of the zabbix database, entering the password of the zabbix account in the mysql each time.
5. Create log files and connections for zabbix
# mkdir / var/log/zabbix
# chown zabbix.zabbix / var/log/zabbix
# ln-s / usr/local/zabbix/etc / etc/zabbix
# ln-s / usr/local/zabbix/bin/* / usr/bin/
# ln-s / usr/local/zabbix/sbin/* / usr/sbin/
6. Copy and configure zabbix startup files
# cp misc/init.d/fedora/core/zabbix_* / etc/init.d/
# chmod 755 / etc/init.d/zabbix_*
# sed-I "s#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix#g" / etc/init.d/zabbix_server
# sed-I "s#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix#g" / etc/init.d/zabbix_agentd
7. Configure zabbix_server.conf server files
Edit and modify the / etc/zabbix/etc/zabbix_server.conf file and modify the following entries:
DBName=zabbix database name
DBUser=zabbix database user
DBPassword=zabbix database password (for demonstration purposes, the zabbix database password was previously set to zabbix)
Or replace the contents of the file with sed:
# sed-I "s/DBUser\ = root/DBUser\ = zabbix/g" / etc/zabbix/zabbix_server.conf
# sed-I "/ # DBPassword=/aDBPassword=zabbix\ n" / etc/zabbix/zabbix_server.conf
# sed-i "s#tmp/zabbix_server.log#var/log/zabbix/zabbix_server.log#g" / etc/zabbix/zabbix_server.conf
8. Configure the zabbix_agentd.conf file (here is to monitor the server itself, such as monitoring other servers, the configuration file is similar)
PS: what you want to live here is that zabbix_agentd.conf is a client configuration file, and this is for demonstration, so the purpose of configuring this file here is to be able to monitor the local server. The file needs to be modified with the following four entries:
Server=127.0.0.1 add the server ip here. If the server is not local, you need to enter the ip address of the remote zabbix_server.
ServerActive=127.0.0.1 is changed to the ip of the server, and it should be changed to the ip address of the server.
/ tmp/zabbix_agentd.log modify log path
UnsafeUserParameters=0 does not enable custom scripting by default. To customize key, enable it and set it to 1.
Include=/etc/zabbix/zabbix_agentd.conf.d/ custom agentd configuration files can be written in this directory
The execution command for content substitution using sed mode is as follows:
# sed-I "s/Server\ = 127.0.0.1/Server\ = 127.0.0.1192.168.81.129CMG" / etc/zabbix/zabbix_agent.conf
# sed-I "s/ServerActive\ = 127.0.0.1/ServerActive\ = 192.168.81.129purl 10051CMG" / etc/zabbix/zabbix_agent.conf
# sed-I "s#tmp/zabbix_agentd.log#var/log/zabbix/zabbix_agentd.log#g" / etc/zabbix/zabbix_agentd.conf
# sed-I "# UnsafeUserParameters=0#aUnsafeUserParameters=1\ n" / etc/zabbix/zabbix_agentd.conf
9. Copy the PHP web page file to Apache
# cp-r. / frontends/php/ / var/www/html/zabbix
# chown-R apache.apache / var/www/html/zabbix
10. Enable zabbix
# / etc/init.d/zabbix_server start
# / etc/init.d/zabbix_agentd start
At this point, the installation of zabbix is complete.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.