In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to install and use Zabbix, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Zabbix software can monitor many network parameters and the health and integrity of the server. Zabbix uses a flexible alarm mechanism that allows users to configure mail-based alerts for almost any event. This allows users to respond quickly to server problems.
1. Installation of lamp environment
1. Yum install lamp
# yum-y update#yum-y installgcc gcc-c++ autoconfhttpd php mysql mysql-server php-mysqlhttpd-manual mod_ssl mod_perl mod_auth_mysql php-gd php-xml php-mbstring php-ldapphp-pearphp-xmlrpcphp-bcmathmysql-connector-odbcmysql-devellibdbi-dbd-mysqlnet-snmp-devel curl-develunixODBC-develOpenIPMI-develjava-devel
2. Modify php.ini because the relevant parameters of php.ini will be detected during later installation, and an error will be reported on the page if it is not satisfied, so you need to modify the relevant parameters in advance. The parts that need to be modified are as follows:
# vim / etc/php.inidate.timezone = Asia/Shanghaimax_execution_time = 300post_max_size = 32Mmax_input_time=300memory_limit = 128Mmbstring.func_overload = 2
You can also modify it directly through the shell statement, as follows:
# sed-I "s / 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 = 0/ambstring.func_overload = 2n "/ etc/ php.ini II, installation of zabbix
1. Install the dependency packages required for zabbix compilation
# yum-y install curl curl-devel pcre pcre-devel libssh3-devel openldap-devel
2. Download and install zabbix to the next official download page of zabbix to download the new stable version. The latest version is 2.2.3.
# wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.3/zabbix-2.2.3.tar.gz# tar zxvf zabbix-2.2.3.tar.gz
3. Compile and install
# useradd zabbix#. / configure-- prefix=/usr--sysconfdir=/etc/zabbix--enable-server-- enable-proxy--enable-agent--enable-ipv6-- with-mysql=/usr/bin/mysql_config-- with-net-snmp--with-libcurl--with-openipmi--with-unixodbc--with-ldap--with-ssh3--enable-java# make install Note:
A. If you just want to install a server, just turn on-enable-server, and you don't need to select other parameters, but here you can use all the following functions, so you can enable a lot of parameters.
B. usually in an environment that requires automatic processing, it is generally necessary to unify the ID value of the user name of the batch host, which can be obtained through the
Groupadd-g 201 zabbix; useradd-g zabbix-u 201-m zabbix.
4. Add services configuration
Edit the / etc/services configuration file and add the following section:
# vim / etc/serviceszabbix-agent 10050/tcp # Zabbix Agentzabbix-agent 10050/udp # Zabbix Agentzabbix-trapper 10051/tcp # Zabbix Trapperzabbix-trapper 10051/udp # Zabbix Trapper III. Mysql data configuration
Configure mysql to boot by default and start the mysql service:
# chkconfig mysqld on# services mysqld start
Change the mysql root password and log in to the test:
# mysqladmin-uroot password 12345 mysql-uroot-p123456
Create the database used by zabbix and configure the username and password:
Mysql > create database zabbix character set utf8;Query OK, 1 row affected (0.00 sec) mysql > grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';Query OK, 0 rows affected (0.00 sec) mysql > flush privileges;Query OK, 0 rows affected (0.00 sec)
Here, you have created an account whose user name and password are all zabbix. Remember to use zabbix-uzabbix-pzabbix to test whether you can connect properly.
Enter the directory where the zabbix source code package is decompressed, and import mysql data:
[root@localhost zabbix-2.2.3] # mysql-uzabbix-pzabbix zabbix IV, zabbix startup script and conf configuration
1. Configure the zabbix startup script and set it to boot
# cp misc/init.d/fedora/core/zabbix_* / etc/init.d/# chmod 755 / etc/init.d/zabbix_*# sed-I "s#BASEDIR=/usr/local#BASEDIR=/usr/#g" / etc/init.d/zabbix_server# sed-I "s#BASEDIR=/usr/local#BASEDIR=/usr/#g" / etc/init.d/zabbix_agentd// setup Boot self-boot # chkconfig zabbix_server on# chkconfig zabbix_agentd on
2. Zabbix_server.conf server configuration
Modify the / etc/zabbix/zabbix_server.conf configuration file. The result of the modified configuration file is similar to the following:
# egrep-v "(# | ^ $)" / etc/zabbix/zabbix_server.confLogFile=/var/log/zabbix/zabbix_server.logDBHost=localhostDBName=zabbixDBUser=zabbixDBPassword=zabbix// the following parts are optional, and you can use the default value to DBSocket=/var/lib/mysql/mysql.sockDBPort=3306StartPollers=160StartTrappers=20StartPingers=100StartDiscoverers=120MaxHousekeeperDelete=5000CacheSize=1024MStartDBSyncers=16HistoryCacheSize=1024MTrendCacheSize=1024MHistoryTextCacheSize=512MAlertScriptsPath=/etc/zabbix/alertscriptsLogSlowQueries=1000
3 、 zabbix_agentd.conf
It should be noted that there will be a zabbix_agent.conf and a zabbix_agentd.conf under the / etc/zabbix/ directory. Here, a configuration file with d is used. The difference between the two is that zabbix_agent.conf is started as a super service (xinetd) and zabbix_agentd.conf is started as an independent process.
# egrep-v "(# | ^ $)" / etc/zabbix/zabbix_agentd.confLogFile=/var/log/zabbix/zabbix_agentd.logEnableRemoteCommands=0Server=127.0.0.1192.168.1.100StartAgents=8ServerActive=192.168.1.100:10051Hostname=test1Timeout=30Include=/etc/zabbix/zabbix_agentd.conf.d/UnsafeUserParameters=1
Working mode: Server adopts passive working mode, which allows access to the ip address, and the server side obtains the data. ServerActive adopts active working mode. Which server to upload data to, you need to enter the port of server. The default is 10051 syntax is "ip1,ip2". You can enter multiple server ends, separated by commas. The value of UnsafeUserParameters indicates whether custom scripts are enabled, and the default value of 0 means that it is not enabled.
4. Start the service
After completing the above configuration, start the service with the following command:
# service zabbix_server start# service zabbix_agentd start 5. Zabbix frontends frontend configuration
1. Copy the frontend page file
# cp-r. / frontends/php/ / var/www/html/zabbix# chown-R apache.apache / var/www/html/zabbix# service httpd start
2. Configure apache virtual host
ServerAdmin admin@361way.comDocumentRoot / var/www/html/zabbixServerName zabbix.361way.comErrorLog logs/dummy-zabbix.361way.com-error_logCustomLog logs/dummy-zabbix.361way.com-access_log common
3. Generation of zabbix.conf.php configuration file
Enter the virtual hostname configured above in the browser to enter the zabbix_frontend configuration and installation interface, as follows:
Installation of zabbix detailed zabbix zabbix detailed zabbix installation
In the figure above, if you do not modify the parameters of / etc/php.ini in the installation of lamp in step 1, a red alarm will appear.
Installation of zabbix detailed zabbix zabbix detailed zabbix installation
The above is the database configuration section of zabbix.
Installation of zabbix detailed zabbix zabbix detailed zabbix installation
The hostname is recommended here because the IP address may change and the hostname is less likely to change. If the hostname is used, the change of the IP address will not affect the parameters.
Installation of zabbix detailed zabbix zabbix detailed zabbix installation
You may encounter a problem with the inability to create a file here, which is caused by no write permission. It can be solved by the following command:
# chown-R apache.apache / var/www/html/zabbix
After the security is completed by pressing finish, the default login user name is admin and the password is zabbix.
VI. Selinux Firewall issues
After logging in to the web page, the error message is found as follows:
Zabbix server is not running:the information displayed may not be cuurrent.
Solution: after vim / etc/sysconfig/selinux modifies the selinux=disabled, restart the server to solve the problem.
Thank you for reading this article carefully. I hope the article "how to install and use Zabbix" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.