installoncentos 6
TRANSCRIPT
-
7/27/2019 InstallOnCentOS 6
1/3
InstallOnCentOS 6.x RHEL 6.x
From Zabbix.org
===================================================1 For latest changes always check
2 install epel repo 3 Install packages with yum 4 Start next time automatic on boot 5 Start the mysql services now 6 Make mysql secure 7 Configure mysql with user zabbix and database zabbix 8 Import zabbix templates 9 Edit Zabbix_server configuration
o 9.1 Adjust php.ini configurationo 9.2 Adjust selinux so that the zabbix server can access port 10051o 9.3 To allow fping to be used by zabbix u need to create your own
selinux rule
o 9.4 Start / restart the serviceso 9.5 don't forget to open your firewall ports on client and serverside!!o 9.6 Don't forget to restart the firewall
For latest changes always check
http://zabbix.usersgroup.be/index.php/topic,7.0.html http://blog.zabbix.com/zabbix-2-0-packages-for-rhel-centos-sl/1893/ Always check README included in the packages
install epel repo
(add any mirror that u like from epel)
yum install http://mirror.iprimus.com.au/epel/6/x86_64/epel-release-6-8.noarch.rpm
This guide will also work in Centos5/rhel5 when adding Epel5Install packages with yum
yum install zabbix20-server zabbix20-agent zabbix20-web-mysql nmaphttpd policycoreutils-python net-snmp net-snmp-utilsyum groupinstall "MySQL Database Client" "MySQL Database Server"
php-mysql is depended on the frontend you chose for example if u installzabbix20-web-pgsql php-pgsql will be installed same goes for mysql
https://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#For_latest_changes_always_checkhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#For_latest_changes_always_checkhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#install_epel_repohttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#install_epel_repohttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Install_packages_with_yumhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Install_packages_with_yumhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Start_next_time_automatic_on_boothttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Start_next_time_automatic_on_boothttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Start_the_mysql_services_nowhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Start_the_mysql_services_nowhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Make_mysql_securehttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Make_mysql_securehttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Configure_mysql_with_user_zabbix_and_database_zabbixhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Configure_mysql_with_user_zabbix_and_database_zabbixhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Import_zabbix_templateshttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Import_zabbix_templateshttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Edit_Zabbix_server_configurationhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Edit_Zabbix_server_configurationhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Adjust_php.ini_configurationhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Adjust_php.ini_configurationhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Adjust_selinux_so_that_the_zabbix_server_can_access_port_10051https://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Adjust_selinux_so_that_the_zabbix_server_can_access_port_10051https://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#To_allow_fping_to_be_used_by_zabbix_u_need_to_create_your_own_selinux_rulehttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#To_allow_fping_to_be_used_by_zabbix_u_need_to_create_your_own_selinux_rulehttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#To_allow_fping_to_be_used_by_zabbix_u_need_to_create_your_own_selinux_rulehttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#To_allow_fping_to_be_used_by_zabbix_u_need_to_create_your_own_selinux_rulehttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#To_allow_fping_to_be_used_by_zabbix_u_need_to_create_your_own_selinux_rulehttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Start_.2F_restart_the_serviceshttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Start_.2F_restart_the_serviceshttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#don.27t_forget_to_open_your_firewall_ports_on_client_and_serverside.21.21https://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#don.27t_forget_to_open_your_firewall_ports_on_client_and_serverside.21.21https://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Don.27t_forget_to_restart_the_firewallhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Don.27t_forget_to_restart_the_firewallhttp://zabbix.usersgroup.be/index.php/topic,7.0.htmlhttp://zabbix.usersgroup.be/index.php/topic,7.0.htmlhttp://blog.zabbix.com/zabbix-2-0-packages-for-rhel-centos-sl/1893/http://blog.zabbix.com/zabbix-2-0-packages-for-rhel-centos-sl/1893/http://blog.zabbix.com/zabbix-2-0-packages-for-rhel-centos-sl/1893/http://zabbix.usersgroup.be/index.php/topic,7.0.htmlhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Don.27t_forget_to_restart_the_firewallhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#don.27t_forget_to_open_your_firewall_ports_on_client_and_serverside.21.21https://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Start_.2F_restart_the_serviceshttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#To_allow_fping_to_be_used_by_zabbix_u_need_to_create_your_own_selinux_rulehttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#To_allow_fping_to_be_used_by_zabbix_u_need_to_create_your_own_selinux_rulehttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Adjust_selinux_so_that_the_zabbix_server_can_access_port_10051https://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Adjust_php.ini_configurationhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Edit_Zabbix_server_configurationhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Import_zabbix_templateshttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Configure_mysql_with_user_zabbix_and_database_zabbixhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Make_mysql_securehttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Start_the_mysql_services_nowhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Start_next_time_automatic_on_boothttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#Install_packages_with_yumhttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#install_epel_repohttps://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x#For_latest_changes_always_check -
7/27/2019 InstallOnCentOS 6
2/3
Start next time automatic on boot
chkconfig httpd onchkconfig mysqld onchkconfig zabbix-server onchkconfig zabbix-agent on
Start the mysql services now
service httpd startservice mysqld start
Make mysql secure
/usr/bin/mysql_secure_installation
Configure mysql with user zabbix and
database zabbix
mysql -uroot -pmysql> create database zabbix character set utf8; (create db with namezabbix)mysql> grant all privileges on zabbix.* to zabbix@localhost identified
by 'your_password'; (create user zabbix, set your own password)mysql> exit
Import zabbix templates
mysql -uzabbix -p zabbix < /usr/share/zabbix-mysql/schema.sqlmysql -uzabbix -p zabbix < /usr/share/zabbix-mysql/images.sqlmysql -uzabbix -p zabbix < /usr/share/zabbix-mysql/data.sql
Edit Zabbix_server configuration
vi /etc/zabbix/zabbix_server.conf (change dbname and user with yourown settings)DBHost=localhostDBName=zabbixDBUser=zabbixDBPassword=(your zabbix password)
Adjust php.ini configuration
vi /etc/php.ini
php_value max_execution_time 300php_value memory_limit 128M
-
7/27/2019 InstallOnCentOS 6
3/3
php_value post_max_size 16Mphp_value upload_max_filesize 2Mphp_value max_input_time 300php_value date.timezone Europe/Brussels
Adjust selinux so that the zabbix server can access port 10051
semanage port -a -t http_port_t -p tcp 10051
To allow fping to be used by zabbix u need to create your own selinux
rule
(u can only do this when u add some item with fping. Selinux needs to block it first )
grep fping /var/log/audit/audit.log | audit2allow -M zabbix_fpingsemodule -i zabbix_fping.pp
Start / restart the services
service httpd restartservice zabbix-server startservice zabbix-agent start
Your zabbix installation is ready
don't forget to open your firewall ports on client and serverside!!
10051 for trapper
10050 for client80 for httpd
This can be done easy by adding these lines in iptables
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
Don't forget to restart the firewall
service iptables restart
go tohttp://your_ip/zabbix
http://your_ip/zabbixhttp://your_ip/zabbixhttp://your_ip/zabbixhttp://your_ip/zabbix