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

How to install zabbix under centos

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

Share

Shulou(Shulou.com)05/31 Report--

In this article, the editor introduces in detail "how to install zabbix under centos". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to install zabbix under centos" can help you solve your doubts.

Centos-dvd1 version system fixed ip address is 192.168.159.128, centos-mininal version system address is 192.168.1.* or 192.168.2.* network segment

Zabbix2.4 installation (centos6.5)

Zabbix has its own yum source. Lnmp can download and install it.

The first step is to install zabbix's official zabbix source at the following address:

Rpm-ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm

The second step is to use the yum installation method to automatically install the zabbix server, agent and other related rpm packages

Yum install-y mysql mysql-server zabbix-server-mysql zabbix-web-mysql zabbix-agent

Zabbix-get: this command is mainly used to get monitoring data. After the installation is successful, you need to create a zabbix database and user in mysql.

Failed to enter the database, check that the mysqld service is not started, just start it!

Start the mysql database service: / etc/init.d/mysqld start

Enter the database: mysql-uroot

*

Format: grant permissions on database name. Table name to user @ login host identified by "user password"

Grant all privileges on *. * to zabbixuser@ "%" identified by "xxx"; flush privileges

*

Create databases and users:

Mysql > createdatabase zabbix character set utf8 collate utf8_bin;mysql > grant all privileges on zabbix.* to zabbix@localhostidentified by 'zabbix';flush privileges;show databases

Mysql > quit; or\ Q

Zabbix monitoring system data is stored in the database, it is necessary to establish some tables.

View the table creation statement and import

[root@localhost~] # cd / usr/share/doc/zabbix-server-mysql-2.4.8/create [root@localhost create] # ll

Import the database:

[root@localhost create] # mysql-uroot zabbix

< schema.sql[root@localhostcreate]# mysql -uroot zabbix < images.sql[root@localhostcreate]# mysql -uroot zabbix < data.sql 修改 zabbix 服务器配置文件:(该去除#号的就去除#号) [root@localhost ~]#vi /etc/zabbix/zabbix_server.confdbhost=localhostdbname=zabbixdbuser=zabbixdbpassword=zabbixvim的安装#yum search vim //查看vim相关软件信息#yum install -y vim* //在线安装vim

Modify time zone

[root@localhost~] # vim / etc/php.ini// adds the following at the end of the php.ini configuration file [shift+g jumps to the last line of the file] php_valuemax_execution_time 300php_valuememory_limit 128mphp_valuepost_max_size 16mphp_valueupload_max_filesize 2mphp_valuemax_input_time 300

Remove the semicolon before "; date.timezone =", write in the top box, and give the equal sign: asia/shanghai

After the modification is completed, it will not take effect until the system is restarted!

View the current time:

[root@localhost~] # date

When viewing the current time, the time is out of sync and needs to be synchronized

Install time synchronization command

[root@localhost~] # yum install ntpdate

Perform synchronization of US time

[root@localhost~] # ntpdate us.pool.ntp.org

Modify time zone: (ln sf a b b points to a) synchronization time

[root@localhost~] # ln-sf / usr/share/zoneinfo/asia/shanghai / usr/localtime [root@localhost~] # date

Start the necessary services (restart): (boot up, if you don't start the system, the service will not start, you can start the service manually)

Manually start the necessary services (do not restart)

Unable to open the zabbix configuration page when the firewall is enabled and chkconfig httpd on starts the httpd service

Apache starts, but cannot open zabbix through the browser, workaround, turn off the firewall, turn off selinux

Close selinux:sed-I "s/selinux=enforcing/selinux=disabled/g" / etc/selinux/config

Confirm whether the modification is successful: # grepselinux / etc/selinux/config

Stop the firewall: / etc/init.d/iptables stop

Accidentally found a phenomenon, when I shut down iptables and stop the iptables service, but there will always be something strange happen, when I start the system again, check the iptables status, iptables automatically turned on, very helpless ah! After studying that libvirt (the c function library of virtualization tools) will drive iptables to start when it is started, the way to permanently shut down iptables is through the chkconfig tool, we only need chkconfig iptables off.

[system environment]

Centos release 6.7 (final)

Close iptables

Start httpd: chkconfig httpd on

/ etc/init.d/iptables stop # turn off iptables

Chkconfig iptables off # permanently shut down iptables

Chkconfig-- list iptables # check iptables

Chkconfig-- list httpd / / View httpd startup

Iptables-l or / etc/init.d/iptables status # to view the running status of iptables

Cat / etc/redhat-release / / View the system version

Modify the time zone:

# vim / etc/php.ini modification; date.timezone = asia/shanghai and remove the preceding semicolon. You can also add it when you modify the time zone earlier

# / etc/init.d/httpd restart / / restart after the modification is completed

Restart httpd will report an error, edit the httpd.conf file, vi / etc/httpd/conf/httpd.conf, and cancel the first # of servername!

After rebooting the system, the database did not start again because the database did not boot. Perform boot startup, and the next boot will not report an error.

[root@localhost ~] # chkconfig mysqld on

After all the installation is complete, you need to boot up all the time.

After reading this, the article "how to install zabbix under centos" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, welcome to follow the industry information channel.

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

Development

Wechat

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

12
Report