lang110 发表于 2019-1-20 11:22:01

Installing Zabbix 2.4 on CentOS 6.5

  1: Download Package
# rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
http://s2.运维网.com/wyfs02/M00/87/67/wKioL1ffctWx2RZrAAEoCl0alp4727.png
  2: Install zabbix server packages
# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-java-gateway
http://s5.运维网.com/wyfs02/M02/87/6A/wKiom1ffcu-ia7juAAFzo3wRtxE034.png
3: Install MySQL Database
# yum -y install mysql-server
http://s1.运维网.com/wyfs02/M02/87/67/wKioL1ffcxHD7o7jAAF6Acb3UPU308.png
—vi /etc/my.cnf


symbolic-links=0
character-set-server=utf8
innodb_file_per_table=1
- Start mysql service with command “service mysqld start”
http://s2.运维网.com/wyfs02/M00/87/6A/wKiom1ffcyyij1y2AAFPenV9jWg720.png
- Run the secure installation command “mysql_secure_installation” to set the root password:
  - Enter current password for root (enter for none):
  http://s2.运维网.com/wyfs02/M02/87/67/wKioL1ffc1aTotTIAAFFC34elb8593.png
– Set root password?

http://s5.运维网.com/wyfs02/M00/87/6A/wKiom1ffc27BpXb4AAFmVief_xQ467.png
– Remove anonymous users?

http://s4.运维网.com/wyfs02/M00/87/67/wKioL1ffc4WTBTIYAAFj2_hs-6Q165.png
– Disallow root login remotely?

http://s2.运维网.com/wyfs02/M01/87/6A/wKiom1ffc6TSpxSQAAFrpT06giI462.png
– Remove test database and access to it?

http://s1.运维网.com/wyfs02/M00/87/67/wKioL1ffc8OjEbq9AAFGTzCGKBw415.png
– Reload privilege tables now?
http://s5.运维网.com/wyfs02/M01/87/67/wKioL1ffc9bgf-FUAADzEfGZXdE267.png
4: Create zabbix database
- Enter following commands to setup the database:
- # mysql -uroot -p

http://s5.运维网.com/wyfs02/M00/87/6A/wKiom1ffdAfypi_AAAErhcM_wWg681.png
– mysql> create database zabbix character setutf8;

http://s5.运维网.com/wyfs02/M02/87/6A/wKiom1ffdDCyWvqZAAFLx0Yor-w376.png
– mysql> grant all privileges on zabbix.* tozabbix@localhost identified by ‘M1o2n3itor’;

Note:passoword is M1o2n3itor.
http://s3.运维网.com/wyfs02/M02/87/67/wKioL1ffdGbj-K5eAAFLEdJ8-Ug978.png
– mysql> exit
http://s1.运维网.com/wyfs02/M01/87/6A/wKiom1ffdMrwDLXcAAFes0W-xEI693.png
5: Import initial schema and data
- # cd /usr/share/doc/zabbix-server-mysql-2.4.0/create
– # mysql -uroot -p zabbix< schema.sql
– # mysql -uroot -p zabbix< images.sql
– # mysql -uroot -p zabbix< data.sql
http://s4.运维网.com/wyfs02/M01/87/67/wKioL1ffdP6yUWijAAC-nLoomiU947.png
6: Edit database configuration inzabbix_server.conf
- # vi /etc/zabbix/zabbix_server.conf
Confirm following lines:
– DBHost=localhost (uncomment this line)
– DBName=zabbix
– DBUser=zabbix
– DBPassword=M1o2n3itor (uncomment this line)
http://s5.运维网.com/wyfs02/M02/87/6A/wKiom1ffdRTTU9B8AAGJz_Whu-k028.png
7: Start zabbix server / agent services
  - # service zabbix-serverstart
  – # service zabbix-agentstart
http://s3.运维网.com/wyfs02/M01/87/67/wKioL1ffdSXzcvj_AAHKik7oICM906.png
8: Change Timezone
- # vi /etc/httpd/conf.d/zabbix.conf
Uncomment below line and change to desired timezone
- # php_value date.timezone Asia/Shanghai
9: Restart the apache web server
- # service httpd restart
10: Set zabbix services to start on reboot
- # chkconfig zabbix-server on
– # chkconfig zabbix-agent on
– # chkconfig mysqld on
– # chkconfig httpd on
11: Configure Firewall
Before you can access the Front-end interface, you eitherdisable the Firewall (IPTABLES) or add rules for zabbix ports.
In Test Lab:
Only disable iptables firewall if testing this in a labby running the command ‘service iptables stop‘ to stop theservice and use ‘service iptables status‘ to confirm its not running
http://s5.运维网.com/wyfs02/M00/87/6A/wKiom1ffdTeijjlaAAHxpFw6XwU557.png
chkconfig iptables off
In Production Environment:
Add the following lines in iptables for Trapper (10051); Client(10050) & httpd (80)

vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10050 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10051 -j ACCEPT

Restart the Firewall
service iptablesrestart
12: Configure Zabbix Web interface
-Enter the following URL on a browser to access the zabbix webinterface http:///zabbix
http://s3.运维网.com/wyfs02/M02/87/6A/wKiom1ffdVDyanieAALLRF14ewk598.png
- Click Next and make sure all checks are OK
http://s4.运维网.com/wyfs02/M00/87/67/wKioL1ffdWiBK1uLAAMbMQhx44o356.png
- Change the Database username to ‘zabbix’andpassword to ‘M1o2n3itor’ and click Test connection to ensureconnection is established.
http://s1.运维网.com/wyfs02/M01/87/67/wKioL1ffdXzwyFr1AAK1cMBb510188.png
- Leave host name and port as default
http://s3.运维网.com/wyfs02/M00/87/6A/wKiom1ffdZKA7RwaAAKXM4gkdns381.png
- Confirm all settings are right
http://s1.运维网.com/wyfs02/M01/87/6A/wKiom1ffdaWy0aKwAAK9PyVUHdc477.png
- Click Finish to complete configuration
http://s1.运维网.com/wyfs02/M01/87/67/wKioL1ffdb3SNLfhAAJfgQVELk0184.png
Log into zabbix with default credentials (Username: Admin, Password: zabbix)
http://s3.运维网.com/wyfs02/M02/87/6A/wKiom1ffddnyhIzNAAK5fBluzLo407.png
- Click profile on top right hand corner, click Change password andcomplete the change password process
http://s5.运维网.com/wyfs02/M02/87/67/wKioL1ffdfOC01iSAAFO4wOW0wY203.png
There we are all done .



页: [1]
查看完整版本: Installing Zabbix 2.4 on CentOS 6.5