Está en la página 1de 35

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

Chuyn H iu hnh Linux


Bo co n l thuyt
Ln 1

Tm hiu v trin khai Zabbix


GIO VIN HNG DN: L NGC SN

Nhm 7:
1012143 - Nguyn Vn Hin
1012147 - Trn Cng Hoan
1012150 - L Vn Hong
1012152 - Nguyn Cng Hong

November 8, 2013

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

Mc lc
I.

H THNG GIM ST MNG ............................................................................................................ 4


1.

Gim st mng l g? ........................................................................................................................... 4

2.

Gim st mng quan trng nh th no?.............................................................................................. 4

3.

Gim st mng c th gim st g? ...................................................................................................... 5

4.

H thng gim st mng c th gim st nhng loi mng no? ......................................................... 5

5.

H thng gim st mng c th lm nhim v chin lc g? ............................................................. 6

6.

Gim st mng c th tr li nhng cu hi g? .................................................................................. 6

7.

Gim st mng c th lm g cho chng ta? ........................................................................................ 6

8.

H thng gim st mng c nhng cng c g? ................................................................................... 7

9.

Nhng loi h thng gim st mng c gi tr? ................................................................................... 7

10.

Chi ph cho chng l g? ...................................................................................................................... 8

II.

TM HIU PHN MM ZABBIX ......................................................................................................... 9


1.

Gii thiu v Zabbix ............................................................................................................................ 9

2.

u im ca Zabbix ............................................................................................................................ 9

3.

Ti sao s dng Zabbix ........................................................................................................................ 9

4.

i tng s dng Zabbix: ................................................................................................................ 10

III.

CI T V CU HNH .................................................................................................................... 10

1.

Thnh phn ca h thng gim st mng Zabbix .............................................................................. 10


a.

Zabbix Server:................................................................................................................................ 10

b.

Zabbix Proxy: ................................................................................................................................ 10

c.

Zabbix Agent ................................................................................................................................. 10

d.

Web interface ................................................................................................................................. 10

2.

Cu trc th mc ca Zabbix ............................................................................................................. 10

3.

Ci t zabbix .................................................................................................................................... 11
a.

Ci t cc packed cn thit:.......................................................................................................... 11

b.

Download Zabbix source: .............................................................................................................. 14

c.

Bin dch v ci t Zabbix-Server:............................................................................................... 16

d.

Bin dch v ci t Zabbix-agent: ............................................................................................... 17

e.

Cu hnh Zabbix server: ................................................................................................................. 18


2

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix


f.

Cu hnh Zabbix Web interface ..................................................................................................... 20

g.

Khi ng cc dch v ................................................................................................................... 21

h.

Ci t zabbix web interface:......................................................................................................... 22

IV.

CI T AGENT TRN MY LINUX MUN C GIM ST ................................................ 26

V.

GII THIU GIAO DIN WEB ZABBIX ........................................................................................... 30


1.

Dashboard .......................................................................................................................................... 30

2.

Latest Data: ........................................................................................................................................ 31

3.

Triggers: ............................................................................................................................................. 32

4.

Events: ............................................................................................................................................... 33

5.

Graphs: ............................................................................................................................................... 34

6.

Media types:....................................................................................................................................... 35

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

I.

H THNG GIM ST MNG

1. Gim st mng l g?
Gim st mng cho mng ca mt cng ty l mt chc nng quan trng, n c th tit kim
tin thng qua vic lm tng hiu qu ca mng li, nng sut nhn vin v chi ph c s h
tng. Mt h thng gim st mng gim st cho nhiu vn . N c th tm v gip gii
quyt vic ti trang web snail-paced, mt mt email, hot ng ca ngi truy vn v truyn ti
file, nguyn nhn do qu ti, s c server, kt ni mng delay hoc cc thit b khc.
Cc h thng gim st mng (NMSs) th khc vi cc h thng pht hin xm nhp (IDSs)
hoc cc h thng phng chng xm nhp (IPSs). Nhng h thng khc pht hin break-ins v
ngn chn ngi dng tri php. Tp chung ca NMS khng phi do vn an ninh cho mi ln
ng nhp.
Gim st mng c th t c bng cch s dng phn mm khc nhau hoc kt hp gia
cc plug v play, thit b phn cng v gii php phn mm. Hu ht bt k loi mng no cng
c th c gim st. N khng quan trng l c dy hay khng dy, mt mng LAN cng ty,
VPN hoc dch v cung cp WAN. Bn c th gim st thit b trn cc h iu hnh khc nhau
vi v s chc nng, t BlackBerrys v in thoi i ng, ti server, touters v switches.
Nhng h thng ny c th gip bn xc nh cc hot ng c th v s liu xut, a ra kt
qu cho php doanh nghip gii quyt yu cu khc nhau, a ra cc mi e da an ninh ni b
v cung cp nhiu hin th hot ng hn.
Vic quyt nh dng ci g gim st mng rt quan trng. Bn phi chc rng cu trc s
mng ca cng ty bn lun cp nht, l bn chnh xc a ra cc loi mng khc
nhau nhm p ng vic gim st, server ang chy trn h iu hnh no, c bao nhiu my
tnh bn v c bao nhiu thit b t xa c th truy cp cho mi mng. Tr li cho cc cu hi
trn s lm cho vic la chn cng c gim st tr nn n gin hn.
2. Gim st mng quan trng nh th no?
Bn c th ngh rng nu mng a ra v chy, khng c l do g gy ri vi n. Ti sao
bn li quan tm v vic thm mt d n cho cc nh qun l mng ca bn. L do khng
nh vic gim st mng l nhm duy tr sc khe ca mng li, m bo sn sng v ci thin
hiu sut. NMS cng c th gip bn xy dng c s d liu thng tin quan trng m bn c th
dng ln k hoch trong s pht trin trong tng lai.
Gim st mng cng nh s ving thm ca chuyn gia tim mch. Nu bc s ca bn ang
theo di du hiu nguy him nh chy mu qua cc mch, van v bung ca tim, th h thng
gim st mng ca bn ang theo di d liu chuyn qua dy cp thng qua sercer, switches, cc
kt ni v routers.

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

D nhin, gim st mng cng ty khng gii quyt cho nh chp nhanh hng nm ca hiu
nng h thng. H khng ch theo di sau khi xut hin cc triu chng ng lo ngi. H gim
st mng ca h 24 gi mt ngy v mi ngy.
3. Gim st mng c th gim st g?
Ngi ta dng h thng gim st mng thng kim tra bng thng s dng, kim tra hiu
sut ca ng dng v hiu sut ca my ch.
Gim st lu lng l nhim v c bn, mt trong nhng vic xy dng h thng mng v
duy tr cc nhim v c bn. N thng tp trung vo cc vn h tr ngi dng ni b. V
vy h thng gim st mng tin ho gim st cc loi thit b:
- BlackBerrys
- Cell phones
- Server ad desktops
- Routers
- Switches
Mt s h thng mng i km vi vic pht hin t ng, kh nng ghi li thit b lin tc khi
chng c thm vo, g b hoc tri qua nhng thay i cu hnh. Nhng cng c ny tch
ring cc thit b t ng:
- IP address
- Service
- Type (switch, router, etc)
- Physical location
Ngoi nhng li th hin nhin ca vic bit chnh xc v thc t nhng g bn khai trin,
h thng gim st mng cn c th t ng pht hin v phn loi cng on gip bn c k
hoch pht trin.
4. H thng gim st mng c th gim st nhng loi mng no?
H thng gim st mng c th gim st cc mng c kch thc ln, nh, trung bnh. Mt s
mng nh:
- Wireless or wired
- Lan
- VPN
- WAN
Th trng kinh doanh lun i hi cc chc nng trang web mi s dng ni b v bn
ngoi. Hiu sut cc chc nng nhy cm bao gm ting ni qua IP, Internet Protocol v video
yu cu. Gim st cho php cc nh qun l phn b ngun lc duy tr tnh ton vn ca h
thng.

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

5. H thng gim st mng c th lm nhim v chin lc g?


H thng gim st s gip nh hng trong mi trng phc tp, a ra cc bo co, ngi
qun l c th ss dng cc bo co ny :
- Xc nh vic tun th quy nh v chnh sch
- Tit kim chi ph tim lc bng cch tm ngun d liu d tha
- Gii quyt hiu q vic ly cp thng tin
- Tr gip xc nh nng sut ca nhn vin
- Spot qua ti thit b trc khi n c th mang xung mt mng li
- Do tr hoc do chuyn ti d liu b tr
- Tm bt thng trong mng ni b c th cho bit mt mo e do an ninh
- Nhng mt s NMS khng phi l h thng pht hin hoc h thng phng chng. Mt NMS
c th pht hin cc hnh ng kh chu, nhng khng phi nhim v ca n.
6. Gim st mng c th tr li nhng cu hi g?
Mt bo co gim st s gip bn tr li nhng cu hi kh khn:
Gip cc nh thit k lm n gin ho v ng nht h thng vi chi ph thp, gip
a ra quyt nh thay th cc phn on mng vi chi ph chp nhn c?
H iu hnh no chy trn server v chng cn thit?
Ngi s dng i din cho ai v ci g c h gi?
Lm th no gn vi cng sut ca my ch?
Thit b t xa g c s dng v chng s dng g?
Ai v nhng ngun g ang qun l h thng?
D nhin, b qua thng tin ny v bo co tnh trng tt, nh th c th kt lun rng
khng c vn g, c ngha l khng c l do thay i mi th. thng l kt lun
sai v doanh nghip khng tn ti mt trng thi n nh.
7. Gim st mng c th lm g cho chng ta?
Gim st cn thn cho php gim c iu hnh tt c thng tin h cn chng minh vic
nng cp mng v m rng mng l cn thit h tr doanh nghip thnh cng trong tng lai.
Service-level agreements kh thc thi bn b phn khch hng v n a ra nhng iu
khon rt kht khe.
H thng gim st mng l vic hiu qu s khng cho nh qun l bit thit b, dch v
hoc ng dng c php hot ng mc no.

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

8. H thng gim st mng c nhng cng c g?


Bn thn nhng h thng gim st mng l phn mm hoc firmware, n gin hay phc tp.
Mt trong nhng cng c n gin nht l gi tn hiu n thit b v xem thi gian tr v l
bao lu. Thch hp hn vi hu ht cc nh qun l l cc cng c lin quan n cc kim tra
thng tin thng, cc kch bn theo di v c th a ra nhiu bo co a dng vi cc ha,
vi iu kin tng kt t thit b c th trong mng li rng khp.
Cc cng c m ngun m c tnh m rng cao, khng tn, chng lm vic vi hu ht cc
cng c v ph hp vi hu ht cc nn tng.
Khng c vn g ng lo khi bn chn cng c, mc d tch cc tm hiu xem chng lm
tt nh th no trong mi trng ca bn, c bit vi cc h iu hnh trn mng ca bn.
Nu nh mng ca bn tr nn qu phc tp v bn khng th kim sot c nhng g amg
xy ra, bn c th theo di outsource. Outsource to ra cc mc ca dch v v cc gi chc nng
bao qut nhiu mi trng mng, ngn sch.
Sn phm gim st mng c th min ph hon ton (vi ng dng m ngun m) hoc chng
c th v cng tn km.
9. Nhng loi h thng gim st mng c gi tr?
Cng c mng gim st n tt c cc kha cnh v cc mc phc tp. rt nhiu cng c
giao din command c gi tr. Mt trong nhng ci c gi tr l ping, mt cng c kh tin cy
trong hot ng l thuyt KISS. Ping kim tra mt my ch c th c th truy cp mng qua
I, n lm vic bng cch gi gi ICMP echo yu cu ti my ch mc tiu ch echo phn hi.
Ping c lng thi gian kh hi trong mili giy, h s bt k gi tin mt mt v in ra mt bng
tm tt khi hon tt.
R rng l rt tin li cho nhng ngi khng chuyn, h thng gim st mng vi nhng
biu cc vn quan h cng c CLI. Mt s phong ph ca gii php giao din web gm chi
tit v cc tnh nng biu c sn. nhng cng c ny c th d dng ci t v s dng. Nhiu
ngi n vi cu hnh trc kch bn. Plus, cc bn chng a ra th rt quan trng khi t
cng vi b gim st i din cho mt nt mng quan trng.
Cng c m ngun m lun c a chung trong gii IT, c rt nhiu nhu cu gim st
mng. Chng linh ng v tt hn, tt c hu nh l min ph hoc r. Ngoi ra cng c m
ngun m th tng thch vi hu ht cc cng c hoc nn tng. D liu cho nhng cng c m
ngun m hu ht l XML. V d: mt cng c min ph theo GNU GLP bt u nh kch bn
kh din t ti vic s dng ha ca mt trng i hc kt ni vi internet. Sau , c s
dng nh mt cng c v ha cho cc ngun d liu khc nhau nh tc , in p, nhit
v s lng bn in. Sau cng dn mng bt u dng phn mm thm d mng, ly li
MIB v SNMP, v dng kch bn Perl a ra kt qu bng th trn trang web. Cng c
nhanh chng c s dng khng ch cng dn mng m ngun m gii php ring ca h vi
7

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

nhau m cn bi cc nh cung cp c quyn ln, nhng ngi vay mn mt s kh nng ca


cng c lm phong ph thm cc gii php ca ring h.
Nu bn ang ni bun bn thit b mi, cc hng sn xut thit b mng cung cp rt chi
tit thng tin thit b ca h, cng thm tr gi mua. Vic ca bn l phi kim tra tnh tng
thch ca cng c, c bit l vi h iu hnh trn mng ca bn, xc nh r hu ch ca
cng c cho k hoch tng th ca bn. Cui cng l gi c. V d: bn khng mun thy bn
trong hon cnh, ni bn mua server mi vi cng c gim st cho mt khu vc v cng c gim
st khng chy tt vi server ca bn, khng h tr h iu hnh.
Nu bn c nhiu thit b khc nhau, vi kh nng lm vic khng ng u v mt ng
cong hc hi rng ln. C nhng ng dng gim st trn th trng c th kt hp li v lm n
gin vic qun l gim st mng. H lm c iu ny bng cch qun l lu lng n cc
cng c ring, cho d chng l thit b hay ng dng. Cc thit b cung cp ng dng cn bng
ti trn cc mng con khc nhau. Theo l thuyt, quy trnh ny lm linh hot hn v gim bt
nghn tc mng gy ra bi gim st, lm chm ng truyn kim tra n. ng cong hc tp
cng gim i.
Mng tr nn phc tp, v th phi dng h thng gim st. Hi t, hoc triple play mng,
kt hp voice, video v truyn d liu tc cao qua mt ng duy nht. Nhng iu ny cn
qun l v gim st hiu qu. Nhng loi mng ny cn h thng kho st rung ng ca mi
gi, tr v mt gi tin, l dnh cho ngi mi bt u. Cch qun l mng truyn thng s
dng SNMP agents thm d cc thit b mi ln cch nhau 5 giy xc nh liu mng li c
vn . C nhiu gii php c gi tr gii quyt nhim v nh hot ng khng an ton trong
khi mt ngun, cung cp h tr cho switch ports v VLANs, chnh xc ging nh mt mn hnh
LCD khc phc s c.
Nu mng ca bn tr nn qu phc tp v khng th kim sot nhng g ang xy ra, nhng
ngi khc c th lm cho bn. C nhng cng ty m bn c th thu gim st, qun l, phn
tch. V d, mt dch v cung cp Chu u cung cp cc module khc nhau ti khch hng
mng v cc cng ty s dng c ba mng. Mt module ca dch v bao gm thng tin ca khch
hng trong mt khong thi gian xc nh v a ra bo co hiu sut giao thng v ng dng.
Mt module khc ly cc thng tin v a ra khuyn ngh ci thin mng hiu qu. Module
th 3 theo di lin tc, bo co v hiu sut bo co.
10.

Chi ph cho chng l g?

Gii php gim st mng c th hon ton min ph hoc rt tn km. Hu ht cc cng c m
ngun m l min ph, nh nhng cng c c th c mua km vi c s h tng, ng dng,
phn mm gii php v cc dch v chia, dao ng trong khong t 50 n hng ngn la.
Vi cc nh cung cp dch v, bn c th ty chn trong danh mc cc dch v gim st; c
th tit kim thng qua ly cc thit b pht sinh ph thuc vo mng. C nhng trao i khc
nhau. Mua dch v c th cung cp cho bn tip cn vi cng ngh gim st mi nht; tng
phn, ly c thit b cung cp nhiu chc nng hn.
Mt trong nhng iu chc chn khi ni n gim st mng l chi ph m bn phi b ra nu
khng s dng nhng cng ngh ny c th ln hn bn ngh rt nhiu, nu bn khng nhn
8

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

c hiu sut v tnh sn sng. Bn buc lng phi chu tn km chc rng mng ca bn
khe mnh v an ton. Gi tr ca n l cng vic ca bn.

II.

TM HIU PHN MM ZABBIX

1. Gii thiu v Zabbix


Zabbix l g?
Zabbix c sng lp bi Alexei Vladishev, hin ti c h tr v pht trin bi Zabbix
SIA.
Zabbix l cng c m ngun m gii quyt vn gim st. Zabbix l phn mm cc tham s
ca mt mng , tnh trng v tnh ton vn ca server. Zabbix s dng mt c ch thng bo linh
hot cho php ngi dng cu hnh email cnh bo cho s kin bt k. iu ny cho php gii
quyt nhanh cc vn server. Zabbix cung cp bo co v d liu chnh xc da trn c s d
liu. iu ny lm cho Zabbix tr nn l tng hn.
Tt c cc bo co, thng k cng nh cc thng s cu hnh ca Zabbix c truy cp thng
qua giap din web. Giao din gip ta theo di c tnh trng h mng v server. Cu hnh ng,
Zabbix ng mt vai tr quan trng trong vic theo di c s h tng cng ngh thng tin. iu
ny ph hp cho cc t chc nh c mt server v cc cng ty ln vi nhiu server.
2. u im ca Zabbix
T ng pht hin server v thit b mng
c phn phi theo di bi admin
H tr my ch Linux, Solaris, HP-UX, AIX, Free BDS, Open BSD, OS X
H tr my trm Linux, Solaris, HP-UX, AIX, Free BDS, Open BSD, OS X,
True64/OSF1, Windows NT4.0, Windows 2000, Windows XP, Windows Vista.
ng tin cy trong vic chng thc ngi dng
Linh hot trong vic phn quyn ngi dng
Giao din web
C th thng bo s c qua email
C xem bo co, biu qua giao din web
Kim tra theo di vic ng nhp.

3. Ti sao s dng Zabbix

M ngun m
Hiu qu cao i vi Unix v Win32
Chi ph thp
Cu hnh n gin
Tt c cc thng tin c lu trong c s d liu
Ci t d dng
H tr SNMP
9

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

Giao din trc quan

4. i tng s dng Zabbix:


Tt c cc t chc ln nh trn th gii c nhu cu s dng Zabbix cho cng vic gim st.

III.

CI T V CU HNH

1. Thnh phn ca h thng gim st mng Zabbix


Gm 4 thnh phn c bn
a. Zabbix Server:

y l thnh phn trung tm ca zabbix. Server c th kim tra cc dch v mng t xa (web
server v mail server ). Agent s bo co ton b thng tin v s lng thng k cho server.
Server s lu tr tt c cu hnh v d liu thng k.
b. Zabbix Proxy:

Proxy l phn ty chn ca zabbix. Proxy s thu nhn d liu, lu trong b nh m v c


chuyn n zabbix server.
Zabbix Proxy l mt gii php l tng cho mt gim st mng tp trung ca a im t xa,
chi nhnh, mng li khng c cc qun tr vin a phng.
Zabbix proxy cng c th c s dng phn phi ti ca mt n Zabbix Server
c. Zabbix Agent

gim ch ng gim st cc thit b cc b v cc ng dng ( cng, b nh, b x l s


liu thng k,) trn h thng mng, cc h thng phi chy Zabbix Agent. Agent s thu thp
thng tin hot ng t h thng m n ang chy v bo co d liu ny n Zabbix Server x
l tip. Trong trng hp li ( cng y hoc dch v ca mt qu trnh cht), Zabbix Server
bo cc cho qun tr vin s c ny.
d. Web interface

d dng truy cp d liu theo di v sau cu hnh Zabbix t bt c giao din web cung
cp. Giao din l mt phn ca Zabbix Server , v thng chy trn cc my vt l ging nh
ang chy mt trong cc Zabbix Server.
2. Cu trc th mc ca Zabbix

Docs : Th mc cha file hng dn pdf


Src: Th mc cha tt c source cho cc tin trnh Zabbix
Src/zabbix_server: Th mc cha file to v source cho Zabbix Server
Src/zabbix_agent: Th mc cha file to cho Zabbix_Agent v Zabbix_Agentd
Src/zabbix_get: Th mc cha file to v source cho zabbix_get.
Src/zabbix_sender: Th mc cha file to v source cho zabbix_sender
Incude: Th mc cha cc th vin Zabbix
10

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

Misc/init.d: Th mc cha cc tp lnh khi ng trn cc nn khc nhau.


Frontends/php: Th mc cha cc file PHP
Create: Th mc cha d liu cho vic to c s d liu ban u.
Upgrades: Th mc cha cc th tc nng cp cho phin bn khc nhau ca Zabbix

3. Ci t zabbix
a. Ci t cc packed cn thit:

Zlib-delel
Mysql-server
Mysql-devel
Php-mysql, php-gd, php-bcmath
Glibc-devel, curl-devel, libidn-devel
Open ssl-devel
Net-snmp-devel
Libssh-devel

yum Groupinstall Develoment Tools


yum install -y zlib-devel glibc-devel curl-devel gcc automake libidn-devel
openssl-devel net-snmp-devel rpm-devel OpenIPMI-devel httpd

11

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

yum install mysql*

12

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix


yum install php php-mysql php-gd php-bcmath php-mbstring php-xml

Start mysql:
/etc/init.d/mysqld start

13

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix


t password cho mysql :
/usr/bin/mysqladmin -u root password 123456

b. Download Zabbix source:


wget http://pkgs.repoforge.org/iksemel/iksemel-1.4-1.el5.rf.i386.rpm
wget http://pkgs.repoforge.org/iksemel/iksemel-devel-1.4-1.el5.rf.i386.rpm
wget http://prdownloads.sourceforge.net/zabbix/zabbix-1.8.6.tar.gz?download

rpm -ihv iksemel-1.4-1.el5.rf.i386.rpm


rpm -ihv

iksemel-devel-1.4-1.el5.rf.i386.rpm

tar -xzvf zabbix-1.8.6.tar.gz

14

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

To database zabbix v thit lp mt khu cho zabbix localhost


mysql -u root p
// Nhp mt khu t bc trn (123456)
mysql> create database zabbix;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by
123456;
mysql> exit

Import cc file c s d liu ca Zabbix vo MySQL Server:


cd zabix-1.8.6/create/schema
cat mysql.sql | mysql -u root -p zabbix
cd ../data
cat data.sql | mysql -u root -p zabbix
cat images_mysql.sql | mysql -u root -p zabbix

15

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

c. Bin dch v ci t Zabbix-Server:


./configure -enable-server -prefix=/usr/local/zabbix -with-mysql -with-net-snmp -with-jabber -with-libcurl

16

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix


make install

d.

Bin dch v ci t Zabbix-agent:

./configure -enable-agent -prefix=/usr/local/zabbix -enable-static

make install

17

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

Add cc port ca zabbix_server v Zabbix_Agent vo /etc/services :


echo

zabbix_agent 10050/tcp

echo

zabbix_trap 10051/tcp

>> /etc/services
>> /etc/services

Copy cc file cu hnh vo /etc/zabbix:


mkdir /etc/zabbix
cp misc/conf/{zabbix_server.conf,zabbix_agentd.conf} /etc/zabbix/

e. Cu hnh Zabbix server:


vim /etc/zabbix/zabbix_server.conf

Sa cc dng nh sau: (# s dng)


DBUser=zabbix

#102

BPassword=123456

#110

DBSocket=/var/lib/mysql/mysql.sock

#117

FpingLocation=/usr/sbin/fping

#363

18

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

Phn quyn file cu hnh Zabbix server


chmod 755 /etc/zabbix/zabbix_server.conf
chown zabbix /etc/zabbix/zabbix_server.conf

To user zabbix, password:123456)


vim /etc/zabbix/zabbix_agentd.conf

Sa li 2 dng nh sau:
Server=127.0.0.1

#line 81

Hostname=Zabbix server

#line 92

19

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

cp misc/init.d/redhat/zabbix_agentd_ctl /etc/init.d/zabbix_agentd
cp misc/init.d/redhat/zabbix_server_ctl /etc/init.d/zabbix_server
vim /etc/init.d/zabbix_agentd

Thm dng sau vo:


BASEDIR=/usr/local/zabbix #36

vim /etc/init.d/zabbix_server

Thm dng sau vo:


BASEDIR=/usr/local/zabbix #36

f.

Cu hnh Zabbix Web interface


cp -r frontends/php /var/www/html/zabbix
vim /etc/php.ini

Thay i cc thng s php.ini nh hnh di:


dng 312 313 314

dng 477

20

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

dng 582

dng 639

chmod 777 /var/www/html/zabbix/conf

g. Khi ng cc dch v
hi ng d ch v

b ng

/etc/init d/zabbix_server start

hi ng d ch v

b ng

/etc/init d/zabbix_agentd start

chkconfig mysqld on
chkconfig httpd on

Reboot

li h thng: init 6

21

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix


h. Ci t zabbix web interface:

M trnh duyt g vo : http://127.0.0.1/zabbix


Xut hin giao din ci t, nhn Next.

Check Agree

22

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

Kim tra cc thng s ci t

Cu hnh Database ( nhp password : 123456 -> test connection OK)

23

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

Nhp tn server : Zabbixserver

Kim tra cc thng s cu hnh

Next -> Next -> Finish

24

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

Giao din ng nhp

User mc nh : admin
Pass mc nh : zabbix

25

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

IV.

CI T AGENT TRN MY LINUX MUN C GIM ST


Add my Linux (Centos)

- Trn my mun c gim st phi install Zabbix Agent


- Kch hot lnh yum ti cc gi t Remi v Epel:
Ch : y mnh xi bn linux 5.x nn s ti remi v epel tng ng. Nu cc bn s dng
phin bn khc th c th tham kho link di y ti remi v epel thch hp:

http://help.digipower.vn/questions/116/B%E1%BB%95+sung+REMI+v%C3%A0+EP
EL+Repository+trong+CENTOS

wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
yum repolist

26

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

- Tin hnh ci zabbix-agent:


yum --enablerepo=epel -y install zabbix-agent

- Start zabbix-agent:
/etc/init.d/zabbix-agent restart
chkconfig zabbix-agent on

- Kim tra port zabbix agent :


netstat -ano | grep 1005

27

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

Add My centos (zabbix agent) vo Zabbix server:

Cc bc sau thc hin trn my Zabbix server:


Confiruration > host > create host

28

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

Sau ta c th vo cc mc graphs hoc Screens add thm cc biu monitor.


Ta c biu sau khi add ca my centos zabbix Agent

29

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

V.

GII THIU GIAO DIN WEB ZABBIX


1. Dashboard

Bng iu khin cung cp cho c nhn chi tit v gim st mi trng.


y l phn trung tm ca Zabbix

30

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

2. Latest Data:
Chng ta c th kim tra d liu u vo tab Monitoring | Latest Data.Item ny cho chng ta
thy tng thi gian ca tt c cc CPU chy trn my tnh, v vy hy xem
Tab Monitoring | Latest data, chng ta c th thy d liu c trc tip t h thng.

31

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

3. Triggers:
kim tra trigger mi thm vo, m tab Monitoring | Triggers. Nu c cp nht th ct
Status c ch OK mu xanh. S c 4 pht bn kch hot Trigger tnh t lc mi thm Trigger .
Sau 4 pht nu cha kch hot s c 3 pht bo ng mu ct Status

32

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

4. Events:
C th kim tra danh sch cc s kin tab Monitoring | Events

33

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

5. Graphs:
Thng tin c biu din di dng biu

34

Nhm 7 - ti 9 - Tm hiu v trin khai Zabbix

6. Media types:
C 3 loi gip cnh bo vi ngi qun tr:
Gi Email
Nhn tin SMS n in thoi di ng
Jabber

35