You are on page 1of 6

INSTALL ZABBIX-1.8.2 Ci webserver , mysql-server: cn thit cho install zabbix.

Webserver : #yum y install httpd #service httpd start Mysql-server : #yum y install mysql-server // -y khng cn hi y/n ? #sercvice mysqld start #mysql > create database zabbix; > GRANT ALL ON zabbix.* TO zabbix@localhost IDENTIFIED BY 123abc!!!';
> FLUSH privileges; >\q

Chuyn tp tin t my ny qua my khc : qua my 192.168.2.17 ti th mc zabbix #scp /etc/zabbix/zabbix_agentd.conf root@192.168.2.17:/etc/zabbix/ Tt firewall : # /etc/init.d/iptables stop Lnh tt my: #shutdown r now QU TRNH INSTALL MONITOR ZABBIX(SERVER,AGENT) TRN 1 PC I. ci zabbix_server v zabbix_agentd trn cng mt my(server cho my gim st, agent cho my b gim st)

bc 1: to user v group zabbix.


# groupadd -g 130 zabbix # useradd -u 130 -g zabbix -c 'Zabbix monitoring' zabbix

bc 2: ci cc gi ph thuc dng lnh yum


# yum install zlib-devel mysql-devel glibc-devel curl-devel gcc automake mysql libidndevel openssl-devel net-snmp-devel rpm-devel OpenIPMI-devel Ch cc phin bn ca centos : Centos phin bn no th ci epel phin bn

#wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
# rpm -ivh epel-release-6-5.noarch.rpm

Phin bn 5 :
# wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm # rpm -ivh epel-release-5-4.noarch.rpm

# yum --enablerepo=epel install iksemel iksemel-devel

bc 3: download gi zabbix tar.

# wget http://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest %20Stable/1.8.1/zabbix-1.8.1.tar.gz?use_mirror=freefr

bc 4: gii nn v bin dch


# gunzip zabbix-1.8.1.tar.gz && tar -xvf zabbix-1.8.1.tar # cd zabbix-1.8.1 # ./configure --enable-server --with-mysql --with-net-snmp --with-jabber --withlibcurl --with-openipmi --enable-agent Cc gi cn c: Enable server: With database: WEB Monitoring via: Native Jabber: SNMP: IPMI: Enable agent: //bin dch phn mm #make #make install yes MySQL cURL yes net-snmp openipmi yes

bc 5: to database

# # # # #

service mysqld status service mysqld start mysqladmin -u root password 'new-password-here' mysql_secure_installation mysql -u root p

//LNH KIM TRA DATABASE CI HAY CHA Mysql>show databases; mysql> create database zabbix character set utf8; mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'set-password-here'; mysql> quit; # cd create/schema # cat mysql.sql | mysql -u zabbix -p zabbix # cd ../data # cat data.sql | mysql -u zabbix -p zabbix # cat images_mysql.sql | mysql -u zabbix -p zabbix

mysql> use zabbix; mysql> show tables; mysql> quit;

bc 6: cu hnh zabbix
# mkdir /etc/zabbix # cd zabbix-1.8.1 #cd misc #cd conf #cp zabbix_agentd.conf /etc/zabbix/ # cp misc/conf/{zabbix_server.conf,zabbix_agentd.conf} /etc/zabbix/

# vi /etc/zabbix/zabbix_server.conf DBName=zabbix DBUser=zabbix DBPassword=123abc!!!

bc 7:phn quyn v chy zabbix server


# chmod 400 /etc/zabbix/zabbix_server.conf # chown zabbix /etc/zabbix/zabbix_server.conf

Start/stop
# /usr/local/sbin/zabbix_agentd // start zabbix_agent ln i vi my cn gim st # /usr/local/sbin/zabbix_server // start zabbix_server ln

bc 8: to script khi ng
#echo zabbix_agent 10050/tcp >> /etc/services #echo zabbix_trap 10051/tcp >> /etc/services # cd zabbix-1.8.1 # cp misc/init.d/redhat/8.0/zabbix_* /etc/init.d/ # vi /etc/init.d/zabbix_server //Chnh sa trong zabbix server Progdir=/usr/local/sbin # chkconfig --add zabbix_server # chkconfig --add zabbix_agentd # chkconfig --level 35 zabbix_server on # chkconfig --level 35 zabbix_agentd on # chkconfig --list # chkconfig --list | grep zabbix # chmod 755 /etc/init.d/zabbix_server # chmod 755 /etc/init.d/zabbix_agentd // cd /sbin Lnh start/ stop/restart li zabbix. # service zabbix_server {start|stop|restart|condrestart}

bc 9: ci web frondtend
# yum install php-mysql php-gd php-bcmath php-mbstring php-xml # cp -r frontends/php/ /var/www/html/ Khi cp khong qua th mc /html th: #cd zabbix-1.8.1 #cd fontends

# mv /var/www/html/php/ /var/www/html/zabbix Bc 10 : zabbix chy ok.

#yum install php php-mwsql #service httpd restart.

Truy cp giao din web: http://localhost/zabbix chnh sa file php.ini : seach : /tenfile cn tm.
# vi /etc/php.ini max_execution_time = 600 memory_limit = 256M post_max_size = 32M date.timezone = Europe/Zurich mbstring.func_overload = 2

Down file config v : copy - paste vo : #vi /var/www/html/zabbix/conf/zabbix.conf.php :wq ok # service httpd restart // khoi dong apache

II.

ci zabbix_agent ln my cn c gim st bc 1: ging trn bc 2: ging trn bc 3: ging trn bc 4: ch :

# ./configure --enable-agent

bc 5: ko cn bc 6: ging trn nhng ch chnh sa zabbix_agent vim /etc/zabbix/zabbix_agentd.conf server=<ip ca zabbix server> //dng co tnh nng discovery bn zabbix_server bc 7, bc 8: ging trn

tham kho: http://www.zabbix.com/wiki/howto/install/centos/centosinstall; http://kenhgiaiphap.vn/Detail/1192/Xay-dung-he-thong-giam-sat--tren-Centos-56-Phan2-Zabbix.html

You might also like