In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
System environment:
[root@it3246] # cat/etc/redhat-releaseCentOS release 6.5 (Final)
Software environment LAMP:
1. Install zabbix on top of the existing LAMP or LNMP, and install some dependency packages:
[root@it3246 ~] # yum-yinstall gcc gcc-c++ autoconf httpd php mysql mysql-server php-mysqlhttpd-manual mod_ssl mod_perl mod_auth_mysql php-gd php-xml php-mbstringphp-ldap php-pear php-xmlrpc php-bcmath mysql-connector-odbc mysql-devellibdbi-dbd-mysql net-snmp-devel curl-devel unixODBC-devel OpenPMI-develjava-devel libxml2-devel
two。 Add a user to the system who manages the zabbix:
[root@it3246 ~] # groupaddzabbix [root@it3246 ~] # useraddzabbix-g zabbix-s / sbin/nologin-m
3. Log in to mysql database, create the database of zabbix system, and add authorized account.
Mysql > createdatabase zabbix character set utf8; mysql > grantall privileges on zabbix.* to zabbix@localhost identified by 'zabbix';mysql > flushprivileges
4. Compile and install zabbix
Download address:
Wget http://nchc.dl.sourceforge.net/project/zabbix/ZABBIXLatest Stable/2.2.6/zabbix-2.2.6.tar.gz
[root@it3246 src] # tarxf zabbix-2.2.6.tar.gz [root@it3246 src] # lsLAMP zabbix-2.2.6 zabbix-2.2.6.tar.gz [root@it3246 src] # cdzabbix-2.2.6 [root@it3246zabbix-2.2.6] #. / configure--prefix=/usr/local/zabbix-- enable-server-- enable-agent\-- with-mysql--with-net-snmp-- with-libcurl
[root@it3246mysql] # make install
5. Import the database (the database initial table contained in the source code package, where the password set by mysql is 123456, which can be changed to the password of your own system mysql database during operation)
Enter the zabbix installation package and view the mysql file as follows
[root@it3246 mysql] # mysql-uroot-p123456 zabbix
< ./schema.sql[root@it3246 mysql]#mysql -uroot -p123456 zabbix < ./p_w_picpaths.sql[root@it3246 mysql]#mysql -uroot -p123456 zabbix < ./data.sql 注意:[root@it3246 mysql]# mysql -uroot -p123456 zabbix < ./data.sql ERROR 1146 (42S02) at line 2: Table 'zabbix.hosts'doesn't exist 错误提示:在第二行表 zabbix.hosts文件不存在。此时差错肯定在表上。 6.修改zabbixServer的配置文件 配置zabbix 连接数据库的账号密码 [root@it3246 mysql]#vim/usr/local/zabbix/etc/zabbix_server.conf 替换:DBUser=root换成DBUser=zabbix 添加:DBPassword DBPassword=123456 脚本替换 sed-i 's/^DBUser=.*$/DBUser=zabbix/g' /usr/local/zabbix/etc/zabbix_server.conf sed-i 's/^.*DBPassword=.*$/DBPassword=zabbix/g'/usr/local/zabbix/etc/zabbix_server.conf 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.配置启动脚本,授予启动权限 [root@it3246zabbix-2.2.6]# pwd/usr/local/src/zabbix-2.2.6[root@it3246zabbix-2.2.6]# lsaclocal.m4 conf configure.ac INSTALL man upgradesAUTHORS config.guess COPYING install-sh miscbin config.log database m4 missingbuild config.status depcomp Makefile NEWSChangeLog config.sub frontends Makefile.am READMEcompile configure include Makefile.in src [root@it3246zabbix-2.2.6]#cpmisc/init.d/fedora/core/zabbix_server /etc/init.d/[root@it3246zabbix-2.2.6]#cpmisc/init.d/fedora/core/zabbix_agentd /etc/init.d/[root@it3246zabbix-2.2.6]#[root@it3246zabbix-2.2.6]cp-R frontends/php/ /var/www/html/zabbix [root@it3246 zabbix-2.2.6]#chmod +x /etc/init.d/zabbix_server[root@it3246zabbix-2.2.6]# chmod +x /etc/init.d/zabbix_agentd 8.添加服务端口: [root@it3246zabbix-2.2.6]# cat >> / etc/services zabbix-agent10050/udp Zabbix Agent > zabbix-trapper10051/tcp Zabbix Trapper > zabbix-trapper10051/udp Zabbix Trapper > EOF
9. Start the service and add the boot entry
[root@it3246zabbix-2.2.6] # / etc/init.d/zabbix_server startStartingzabbix_server: / etc/init.d/functions:line 546: / usr/local/sbin/zabbix_server: no file or directory [failed] / etc/init.d/httpdstart [root@it3246zabbix-2.2.6] # / etc/ Init.d/zabbix_server start Startingzabbix_server: / etc/init.d/functions:line 546: / usr/local/sbin/zabbix_server: there is no file or directory [root@it3246zabbix-2.2.6] # echo "/ etc/init.d/zabbix_server start" > > / etc/rc.local [root@it3246zabbix-2.2.6] # echo "/ etc/init.d/zabbix_agentd start" > > / etc/rc.local
Error prompt
Solve
(1) enter the zabbix_server zabbix_agentd configuration file
[root@it3246zabbix-2.2.6] # vim / etc/init.d/zabbix_server
(2) modify the BASEDIR option
BASEDIR=/usr/local/zabbix
(3) restart httpd after the modification is completed.
10.web page configuration
10.1After configuring http access, web login: http://ip/zabbix will mainly report some php error information, and the corresponding modification will be fine. Date.timezone = Asia/Shanghai
Enter the page and follow the prompts to initialize step by step.
Error report:
PHP option post_max_size 8M 16M Fail
PHP option max_execution_time 30 300 Fail
PHP option max_input_time 60 300 Fail
PHP time zone unknown Fail
By modifying the php configuration file / etc/php.ini
Solution method
(1) Editing and modifying php.ini
[root@it3246 ~] # ls-d/etc/php.php.d/ php.ini [root@it3246 ~] # vi/etc/php.ini [PHP]; About php.ini
(2) Save and exit and restart the httpd service
(3) the error was corrected in the previous step, and the max_input_time change is as follows.
(4) restart httppd again and refresh the page as follows
10.2 View previous authorization, username zabbix password zabbix
10.3 initial login account and password: zabbix zabbix
10.4 the next step is to configure the server-side database:
When this error occurs, it prompts:
Configuration file
"/ var/www/html/zabbix/conf/zabbix.conf.php"
Created:Fail
Solution:
(1) this needs to copy a template file zabbix.conf.php.example to zabbix.conf.php, and then edit the php file, mainly the database connection information, and check it correctly.
Do the following:
[root@it3246 conf] # cpzabbix.conf.php.example zabbix.conf.php [root@it3246 conf] # lsmaintenance.inc.php zabbix.conf.php zabbix.conf.php.example [root@it3246 conf] # vimzabbix.conf.php
(2) the interface you see now, the service and monitoring of the local machine are not running.
(3) Click Configuration and Hosts to see that the Status status of ZabbixServer is Not monitored, and you can click the Not monitored button to set it to Monitored.
Error prompt:
Zabbix server is not running the informationdisplayed may not be current
Solution idea
(1) whether selinux is closed. Be sure to turn this off. Turning on selinux will cause a series of problems, and even the discovery function of zabbix will not work properly.
How to turn off SELinux:
Change the SELINUX= "" in the / etc/selinux/config file to disabled, and then restart.
If you do not want to restart the system, use the command setenforce0 Note:
Setenforce 1 sets SELinux to enforcing mode
Setenforce 0 sets SELinux to permissive mode
Add selinux=0 to the startup parameters of lilo or grub, or you can turn off selinux
(2) whether $ZBX_SERVER under the zabbix web directory is ip, and if so, whether localhost can be resolved under localhost,ping. If not, you need to add the corresponding project to the / etc/hosts file
(3) check whether the fsockopen module of php is enabled.
Method 1:
Step one:
Find in the php.ini file
Allow_url_fopen = On
Make it On
Step 2:
Find in the php.ini file
Extension=php_openssl.dll
If there is a semicolon, remove the semicolon
Step 3:
Restart the web server, apache or IIS
There is another situation, that is, method two:
(1) vi php.ini
Find the parameter allow_url_fopen and set it to On, that is,
Allow_url_fopen = On
(2) make your php support opensll extensions.
By default, there is no openssl extension and can only be recompiled and installed.
Yum install openssl openssl-devel
Cd / usr/local/src/php-5.2.14/ext/openssl
/ usr/local/php/bin/phpize
. / configure-with-openssl-with-php-config=/usr/local/bin/php-config
Make & & make install
Follow the prompt to copy the compiled openssl.so to the extension_dir you specified in php.ini
(3) vi php.ini
Join
Extension=openssl.so
(4) restart web server
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.