Está en la página 1de 31

TRNG I HC BCH KHOA H NI VIN CNG NGH THNG TIN & TRUYN THNG

BO CO
ti: S dng phn mm Cacti gim st, qun tr mt h thng mng.
Ging vin hng dn : ThS Bnh Qunh Mai. Sinh vin thc hin : o Tt Lun - 20071831
Nguyn L Hi - 20071010

Lp : Truyn thng v mng my tnh-K52.

H ni 5/2011
Trang 1

MC LC

CHNG 1: TNG QUAN V GIAO THC SNMP ............................................................................ 3 1.1/ Gim st thit b mng. ................................................................................................................. 3 1.2/ Hai phng thc gim st Poll v Alert. ........................................................................................ 5 1.2.1. Phng thc Poll.................................................................................................................... 5 1.2.2. Phng thc Alert. ................................................................................................................. 6 1.2.3. So snh 2 phng thc Poll v Alert ....................................................................................... 6 1.3/ Gii thiu giao thc SNMP. .......................................................................................................... 8 1.3.1. Cc phin bn ca SNMP. ...................................................................................................... 8 1.3.2. Thnh phn ca h thng s dng SNMP. .............................................................................. 9 1.3.3. Cc phng thc ca SNMP ................................................................................................ 14 CHNG 2: GII THIU V CACTI ................................................................................................. 16 2.1. Gii thiu RRDtool ..................................................................................................................... 16 2.2. Gii thiu v Cacti ...................................................................................................................... 17 2.2.1. Hot ng ca Cacti. ............................................................................................................ 17 2.2.2. Ci t Cacti (trn Ubuntu)................................................................................................... 18 2.2.3 S dng Cacti qun l mt s thit b ................................................................................ 26 CHNG 3: DANH MC TI LIU THAM KHO .......................................................................... 31

Trang 2

CHNG 1: TNG QUAN V GIAO THC SNMP


1.1/ Gim st thit b mng.
M u, em s cp n 3 bi ton thuc hng ph bin nht trong cc ng dng ca SNMP.

Bi ton th nht : Gim st ti nguyn my ch


+ Gi s bn c hng ngn my ch chy cc h iu hnh (HH) khc nhau. Lm th no c th gim st ti nguyn ca tt c my ch hng ngy, hng gi kp thi pht hin cc my ch sp b qu ti ? Gim st ti nguyn my ch ngha l theo di t l chim dng CPU, dung lng cn li ca cng, t l s dng b nh RAM, . + Bn khng th kt ni vo tng my xem v s lng my nhiu v v cc HH khc nhau c cch thc kim tra khc nhau. + gii quyt vn ny bn c th dng mt ng dng SNMP gim st c my ch, n s ly c thng tin t nhiu HH khc nhau. ng dng ny c th trng ging nh hnh di y :

Bi ton th hai : Gim st lu lng trn cc port ca switch, router


+ Bn c hng ngn thit b mng (network devices) ca nhiu hng khc nhau, mi thit b c nhiu port. Lm th no gim st lu lng ang truyn qua tt c cc port ca cc thit b sut 24/24, kp thi pht hin cc port sp qu ti ? + Bn cng khng th kt ni vo tng thit b g lnh ly thng tin v thit b ca cc hng khc nhau c lnh khc nhau. Trang 3

+ gii quyt vn ny bn c th dng mt ng dng SNMP gim st lu lng, n s ly c thng tin lu lng ang truyn qua cc thit b ca nhiu hng khc nhau. ng dng ny c th trng ging nh hnh di y :

Bi ton th ba : H thng t ng cnh bo s c tc thi


+ Bn c hng ngn thit b mng v chng c th gp nhiu vn trong qu trnh hot ng nh : mt port no b mt tn hiu (port down), c ai c kt ni (login) vo thit b nhng nhp sai username v password, thit b va mi b khi ng li (restart), Lm th no ngi qun tr bit c s kin khi n va mi xy ra ? + Vn ny khc vi hai vn trn. trn l lm th no cp nht lin tc mt s thng tin no (bit trc s ly ci g), cn y l lm th no bit c ci g xy ra (cha bit ci g s n). + gii quyt bi ton ny bn c th dng ng dng thu thp s kin (event) v cnh bo (warning) bng SNMP, n s nhn cnh bo t tt c cc thit b v hin n ln mn hnh hoc gi email cho ngi qun tr. ng dng ny c th trng ging nh hnh di y:

Trang 4

1.2/ Hai phng thc gim st Poll v Alert.


Trc khi tm hiu SNMP, em mun trnh by hai phng thc gim st Poll v Alert. y l 2 phng thc c bn ca cc k thut gim st h thng, nhiu phn mm v giao thc c xy dng da trn 2 phng thc ny, trong c SNMP. Vic hiu r hot ng ca Poll & Alert v u nhc im ca chng s gip bn d dng tm hiu nguyn tc hot ng ca cc giao thc hay phn mm gim st khc. 1.2.1. Phng thc Poll Nguyn tc hot ng : Trung tm gim st (manager) s thng xuyn hi thng tin ca thit b cn gim st (device). Nu Manager khng hi th Device khng tr li, nu Manager hi th Device phi tr li. Bng cch hi thng xuyn, Manager s lun cp nht c thng tin mi nht t Device. V d: Ngi qun l cn theo di khi no th lm xong vic. Anh ta c thng xuyn hi ngi th Anh lm xong cha ?, v ngi th s tr li Xong hoc Cha.

Hnh minh ha c ch Poll

Trang 5

1.2.2. Phng thc Alert. Nguyn tc hot ng : Mi khi trong Device xy ra mt s kin (event) no th Device s t ng gi thng bo cho Manager, gi l Alert. Manager khng hi thng tin nh k t Device. V d: Ngi qun l cn theo di tnh hnh lm vic ca th, anh ta yu cu ngi th thng bo cho mnh khi c vn g xy ra. Ngi th s thng bo cc s kin i loi nh Tin hon thnh 50%, Mt in lc 10h, C in li lc 11h, Mi c tai nn xy ra. Device ch gi nhng thng bo mang tnh s kin ch khng gi nhng thng tin thng xuyn thay i, n cng s khng gi Alert nu chng c s kin g xy ra. Chng hn khi mt port down/up th Device s gi cnh bo, cn tng s byte truyn qua port s khng c Device gi i v l thng tin thng xuyn thay i. Mun ly nhng thng tin thng xuyn thay i th Manager phi ch ng i hi Device, tc l phi thc hin phng thc Poll. 1.2.3. So snh 2 phng thc Poll v Alert Hai phng thc Poll v Alert l hon ton khc nhau v c ch. Mt ng dng gim st c th s dng Poll hoc Alert, hoc c hai, ty vo yu cu c th trong thc t. Bng sau so snh nhng im khc bit ca 2 phng thc : Poll C th ch ng ly nhng thng tin cn thit t cc i tng mnh quan tm, khng cn ly nhng thng tin khng cn thit t nhng ngun khng quan tm. C th lp bng trng thi tt c cc thng tin ca Device sau khi poll qua mt lt cc thng tin .V d Device c mt port down v Manager c khi ng sau , th Manager s bit c port ang down sau khi poll qua mt lt tt c cc port. Trong trng hp ng truyn gia Manager v Device xy ra gin on v Device c s thay i, th Manager s khng th cp nht. Tuy nhin khi ng truyn thng sut tr Alert Tt c nhng event xy ra u c gi v Manager. Manager phi c c ch lc nhng event cn thit, hoc Device phi thit lp c c ch ch gi nhng event cn thit. Nu khng c event g xy ra th Manager khng bit c trng thi ca Device.V d Device c mt port down v Manager c khi ng sau ,th Manager s khng th bit c port ang down. Khi ng truyn gin on v Device c s thay i th n vn gi Alert cho Manager, nhng Alert ny s khng th n c Manager. Sau mc d ng truyn c thng Trang 6

li th Manager s cp nht c thng tin mi nht do n lun lun poll nh k. Ch cn ci t ti Manager tr n tt c cc Device. C th d dng thay i mt Manager khc. Nu tn sut poll thp, thi gian ch gia 2 chu k poll (polling interval) di s lm Manager chm cp nht cc thay i ca Device. Ngha l nu thng tin Device thay i nhng vn cha n lt poll k tip th Manager vn gi nhng thng tin c. C th b st cc s kin : khi Device c thay i, sau thay i tr li nh ban u trc khi n lt poll k tip th Manager s khng pht hin c.

sut tr li th Manager vn khng th bit c nhng g xy ra. Phi ci t ti tng Device tr n Manager. Khi thay i Manager th phi ci t li trn tt c Device tr v Manager mi. Ngay khi c s kin xy ra th Device s gi Alert n Manager, do Manager lun lun c thng tin mi nht tc thi.

Manager s c thng bo mi khi c s kin xy ra Device, do Manager khng b st bt k s kin no.

Poll hay Alert ? Hai phng thc Poll v Alert c im thun li v bt li ngc nhau, do nhiu trng hp ta nn s dng kt hp c Poll ln Alert t c hiu qu kt hp ca c hai. Cc v d ng dng c ch Poll & Alert : + Giao thc Syslog : mi khi c s kin xy ra th thit b s gi bn tin syslog n Syslog Server. + Phn mm NetworkView, gim st tnh trng cc server bng cch ping lin tc. + Giao thc STP, pht hin loop trong mng bng cch gi nhn cc gi BPDU v gi bn tin Topology change mi khi pht hin thay i. + Trong qun l ngi ta lun thc hin song song ch kim tra v bo co, thng xuyn kim tra pht hin vn v bo co ngay khi xy ra vn .

Trang 7

1.3/ Gii thiu giao thc SNMP.


SNMP (Simple Network Management Protocol) l mt tp hp cc giao thc khng ch cho php kim tra nhm m bo cc thit b mng nh router, switch hay server ang vn hnh m cn vn hnh mt cch ti u, ngoi ra SNMP cn cho php qun l cc thit b mng t xa. V d chng ta c th dng SNMP tt mt interface no trn router ca mnh, theo di hot ng ca card Ethernet, hoc kim sot nhit trn switch v cnh bo khi nhit qu cao. SNMP thng tch hp vo trong router, nhng khc vi SGMP( Simple Gateway Management Protocol) c dng ch yu cho cc router Internet, SNMP c th dng qun l cc h thng Unix, Window, my in, ngun in Ni chung, tt c cc thit b c th chy cc phn mm cho php ly c thng tin SNMP u c th qun l c. Khng ch cc thit b vt l mi qun l c m c nhng phn mm nh web server, database. 1.3.1. Cc phin bn ca SNMP. + SNMP version 1: chun ca giao thc SNMP c nh ngha trong RFC 1157 v l mt chun y ca IETF. Vn bo mt ca SNMP v1 da trn nguyn tc cng ng, khng c nhiu password, chui vn bn thun v cho php bt k mt ng dng no da trn SNMP c th hiu cc hiu cc chui ny c th truy cp vo cc thit b qun l. C 3 tiu chun trong: read-only, read-write v trap. + SNMP version 2: phin bn ny da trn cc chui community. Do phin bn ny c gi l SNMPv2c, c nh ngha trong RFC 1905, 1906, 1907, v y ch l bn th nghim ca IETF. Mc d ch l th nghim nhng nhiu nh sn xut a n vo thc nghim. + SNMP version 3: l phin bn tip theo c IETF a ra bn y . N c khuyn ngh lm bn chun, c nh ngha trong RFC 1905, RFC 1906, RFC 1907, RFC 2571, RFC 2572, RFC 2573, RFC 2574 v RFC 2575. N h tr cc loi truyn thng ring t v c xc nhn gia cc thc th. Hin ti SNMPv1 l ph bin nht do c nhiu thit b tng thch nht v c nhiu phn mm h tr nht. Trong khi ch c mt s thit b v phn mm h tr SNMPv3.

Trang 8

1.3.2. Thnh phn ca h thng s dng SNMP. Theo RFC1157, kin trc ca SNMP bao gm 2 thnh phn : cc trm qun l mng (network management station) v cc thnh t mng (network element) Network management station: thng l mt my tnh chy phn mm qun l SNMP (SNMP Manag ement application), dng gim st v iu khin tp trung cc network element.

H thng s dng SNMP Network element: l cc thit b, my tnh, hoc phn mm tng thch SNMP v c qun l bi network management station. Nh vy element bao gm device, host v application. Mt management station c th qun l nhiu element, mt element cng c th c qun l bi nhiu management station. Vy nu mt element c qun l bi 2 station th iu g s xy ra ? Nu station ly thng tin t element th c 2 station s c thng tin ging nhau. Nu 2 station tc ng n cng mt element th element s p ng c 2 tc ng theo th t ci no n trc. Ngoi ra cn c khi nim SNMP agent. SNMP agent l mt tin trnh (process) chy trn network element, c nhim v cung cp thng tin ca element cho station, nh station c th qun l c element. Chnh xc hn l application chy trn station v agent chy trn element mi l 2 tin trnh SNMP trc tip lin h vi nhau. Cc v d minh ha sau y s lm r hn cc khi nim ny : + dng mt my ch (= station) qun l cc my con (= element) chy HH Windows thng qua SNMP th bn phi: ci t mt phn mm qun l SNMP (= application) trn my ch, bt SNMP service (= agent) trn my con.

Trang 9

+ dng mt my ch (= station) gim st lu lng ca mt router (= element) th bn phi: ci phn mm qun l SNMP (= application) trn my ch, bt tnh nng SNMP (= agent) trn router.

a/ Object ID Mt thit b h tr SNMP c th cung cp nhiu thng tin khc nhau, mi thng tin gi l mt object.V d : + My tnh c th cung cp cc thng tin: tng s cng, tng s port ni mng, tng s byte truyn/nhn, tn my tnh, tn cc process ang chy, . + Router c th cung cp cc thng tin: tng s card, tng s port, tng s byte truyn/nhn, tn router, tnh trng cc port ca router, . Mi object c mt tn gi v mt m s nhn dng object , m s gi l Object ID (OID). VD : + Tn thit b c gi l sysName, OID l 1.3.6.1.2.1.1.5 + Tng s port giao tip (interface) c gi l ifNumber, OID l 1.3.6.1.2.1.2.1. + a ch Mac Address ca mt port c gi l ifPhysAddress, OID l 1.3.6.1.2.1.2.2.1.6. + S byte nhn trn mt port c gi l ifInOctets, OID l 1.3.6.1.2.1.2.2.1.10. Mt object ch c mt OID, chng hn tn ca thit b l mt object. Tuy nhin nu mt thit b li c nhiu tn th lm th no phn bit ? Lc ny ngi ta dng thm 1 ch s gi l scalar instance index (cng c th gi l sub-id) t ngay sau OID. V d : Trang 10

+ Tn thit b c gi l sysName, OID l 1.3.6.1.2.1.1.5; nu thit b c 2 tn th chng s c gi l sysName.0 & sysName.1 v c OID ln lt l 1.3.6.1.2.1.1.5.0 & 1.3.6.1.2.1.1.5.1. + a ch Mac address c gi l ifPhysAddress, OID l 1.3.6.1.2.1.2.2.1.6; nu thit b c 2 mac address th chng s c gi l ifPhysAddress.0 & ifPhysAddress.1 v c OID ln lt l 1.3.6.1.2.1.2.2.1.6.0 & 1.3.6.1.2.1.2.2.1.6.1. + Tng s port c gi l ifNumber, gi tr ny ch c 1 (duy nht) nn OID ca n khng c phn cp con v vn l 1.3.6.1.2.1.2.1. Sub-id khng nht thit phi lin tc hay bt u t 0. V d mt thit b c 2 mac address th c th chng c gi l ifPhysAddress.23 v ifPhysAddress.125645. OID ca cc object ph bin c th c chun ha, OID ca cc object do bn to ra th bn phi t m t chng. ly mt thng tin c OID chun ha th SNMP application phi gi mt bn tin SNMP c cha OID ca object cho SNMP agent, SNMP agent khi nhn c th n phi tr li bng thng tin ng vi OID . V d : Mun ly tn ca mt PC chy Windows, tn ca mt PC chy Linux hoc tn ca mt router th SNMP application ch cn gi bn tin c cha OID l 1.3.6.1.2.1.1.5.0. Khi SNMP agent chy trn PC Windows, PC Linux hay router nhn c bn tin c cha OID 1.3.6.1.2.1.1.5.0, agent lp tc hiu rng y l bn tin hi sysName.0, v agent s tr li bng tn ca h thng. Nu SNMP agent nhn c mt OID m n khng hiu (khng h tr) th n s khng tr li.

Trang 11

Mt trong cc u im ca SNMP l n c thit k chy c lp vi cc thit b khc nhau. Chnh nh vic chun ha OID m ta c th dng mt SNMP application ly thng tin cc loi device ca cc hng khc nhau. b/ Object access Mi object c quyn truy cp l READ_ONLY hoc READ_WRITE. Mi object u c th c c nhng ch nhng object c quyn READ_WRITE mi c th thay i c gi tr. V d: Tn ca mt thit b (sysName) l READ_WRITE, ta c th thay i tn ca thit b thng qua giao thc SNMP. Tng s port ca thit b (ifNumber) l READ_ONLY, d nhin ta khng th thay i s port ca n. c/ Management Information Base MIB (c s thng tin qun l) l mt cu trc d liu gm cc i tng c qun l (managed object), c dng cho vic qun l cc thit b chy trn nn TCP/IP. MIB l kin trc chung m cc giao thc qun l trn TCP/IP nn tun theo, trong c SNMP. MIB c th hin thnh 1 file (MIB file), v c th biu din thnh 1 cy (MIB tree). MIB c th c chun ha hoc t to.

Hnh minh ha MIB tree Trang 12

Mt node trong cy l mt object, c th c gi bng tn hoc id. V d : + Node iso.org.dod.internet.mgmt.mib-2.system c OID l 1.3.6.1.2.1.1, cha tt c cc object lien quan n thng tin ca mt h thng nh tn ca thit b (iso.org.dod.internet.mgmt.mib-2.system.sysName hay 1.3.6.1.2.1.1.5). + Cc OID ca cc hng t thit k nm di iso.org.dod.internet.private.enterprise. V d : Cisco nm di iso.org.dod.internet.private.enterprise.cisco hay 1.3.6.1.4.1.9, Microsoft nm di iso.org.dod.internet.private.enterprise.microsoft hay 1.3.6.1.4.1.311. S 9 (Cisco) hay 311 (Microsoft) l s dnh ring cho cc cng ty do IANA cp 5. Nu Cisco hay Microsoft ch to ra mt thit b no , th thit b ny c th h tr cc MIB chun c nh ngha sn (nh mib-2) hay h tr MIB c thit k ring. Cc MIB c cng ty no thit k ring th phi nm bn di OID ca cng ty . Cc objectID trong MIB c sp xp th t nhng khng phi l lin tc, khi bit mt OID th khng chc chn c th xc nh c OID tip theo trong MIB. V d trong chun mib-2 th object ifSpecific v object atIfIndex nm k nhau nhng OID ln lt l 1.3.6.1.2.1.2.2.1.22 v 1.3.6.1.2.1.3.1.1.1. Mun hiu c mt OID no th bn cn c file MIB m t OID . Mt MIB file khng nht thit phi cha ton b cy trn m c th ch cha m t cho mt nhnh con. Bt c nhnh con no v tt c l ca n u c th gi l mt mib. Mt manager c th qun l c mt device ch khi ng dng SNMP manager v ng dng SNMP agent cng h tr mt MIB. Cc ng dng ny cng c th h tr cng lc nhiu MIB.

Trang 13

1.3.3. Cc phng thc ca SNMP Giao thc SNMPv1 c 5 phng thc hot ng, tng ng vi 5 loi bn tin nh sau :

Mi bn tin u c cha OID cho bit object mang trong n l g. OID trong GetRequest cho bit n mun ly thng tin ca object no. OID trong GetResponse cho bit n mang gi tr ca object no. OID trong SetRequest ch ra n mun thit lp gi tr cho object no. OID trong Trap ch ra n bo s kin xy ra i vi object no.

Trang 14

a/ GetRequest Bn tin GetRequest c manager gi n agent ly mt thng tin no . Trong GetRequest c cha OID ca object mun ly. VD : Mun ly thng tin tn ca Device 1 th manager gi bn tin GetRequest OID=1.3.6.1.2.1.1.5 n Device1, tin trnh SNMP agent trn Device1 s nhn c bn tin v to bn tin tr li. Trong mt bn tin GetRequest c th cha nhiu OID, ngha l dng mt GetRequest c th ly v cng lc nhiu thng tin. b/ GetNextRequest Bn tin GetNextRequest cng dng ly thng tin v cng c cha OID, tuy nhin n dng ly thng tin ca object nm k tip object c ch ra trong bn tin. Ti sao phi c phng thc GetNextRequest ? Nh bn bit khi c qua nhng phn trn : mt MIB bao gm nhiu OID c sp xp th t nhng khng lin tc, nu bit mt OID th khng xc nh c OID k tip. Do ta cn GetNextRequest ly v gi tr ca OID k tip. Nu thc hin GetNextRequest lin tc th ta s ly c ton b thng tin ca agent. c/ SetRequest Bn tin SetRequest c manager gi cho agent thit lp gi tr cho mt object no . V d : + C th t li tn ca mt my tnh hay router bng phn mm SNMP manager, bng cch gi bn tin SetRequest c OID l 1.3.6.1.2.1.1.5.0 (sysName.0) v c gi tr l tn mi cn t. + C th shutdown mt port trn switch bng phn mm SNMP manager, bng cch gi bn tin c OID l 1.3.6.1.2.1.2.2.1.7 (ifAdminStatus) v c gi tr l 2 Ch nhng object c quyn READ_WRITE mi c th thay i c gi tr. d/ GetResponse Mi khi SNMP agent nhn c cc bn tin GetRequest, GetNextRequest hay SetRequest th n s gi li bn tin GetResponse tr li. Trong bn tin GetResponse c cha OID ca object c request v gi tr ca object .

Trang 15

e/ Trap Bn tin Trap c agent t ng gi cho manager mi khi c s kin xy ra bn trong agent, cc s kin ny khng phi l cc hot ng thng xuyn ca agent m l cc s kin mang tnh bin c. V d: Khi c mt port down, khi c mt ngi dng login khng thnh cng, hoc khi thit b khi ng li, agent s gi trap cho manager. Tuy nhin khng phi mi bin c u c agent gi trap, cng khng phi mi agent u gi trap khi xy ra cng mt bin c. Vic agent gi hay khng gi trap cho bin c no l do hng sn xut device/agent quy nh. Phng thc trap l c lp vi cc phng thc request/response. SNMP request/response dng qun l cn SNMP trap dng cnh bo. Ngun gi trap gi l Trap Sender v ni nhn trap gi l Trap Receiver. Mt trap sender c th c cu hnh gi trap n nhiu trap receiver cng lc. i vi cc phng thc Get/Set/Response th SNMP Agent lng nghe port UDP 161, cn phng thc trap th SNMP Trap Receiver lng nghe port UDP 162.

CHNG 2: GII THIU V CACTI


2.1. Gii thiu RRDtool
RRDtool (round-robin database tool) l mt h thng ghi v v d liu hiu nng cao, c thit kt x l d liu theo chui thi gian, nh l bng thng, nhit phng, CPU load, server load, v gim st cc thit b nh l router, UPS, vv. l mt gii php m ngun m. N cho php ngi qun tr ghi v phn tch d liu thu thp c t tt c cc ngun d liu.Vic phn tch d liu ca RRDtool ph thuc vo kh nng to ra cc th hin th cc gi tr thu thp c trong mt khong thi gian nh k. RRDtool c vit bi ngn ng C v lu tr d liu ca n trong file .rrd. S lng bn ghi trong mt file .rrd n khng bao gi tng, ngha l cc bn ghi c s thng xuyn c loi b. Cc bc trong qu trnh hot ng ca RRDTool:

Trang 16

+ Thu thp d liu : D liu thu thp c trong mt khong thi gian c inh s c lu trong mt c s d liu vng. + Hp nht d liu: Vic qun l d liu ca nhiu thit trong mt khong thi gian ln (v d mt thng) s gy kh khn cho ngi qun tr. RRDTool cung cp cho ngi qun tr mt s hm chc nng : xc nh max, min, average ca d liu. + Lu tr vng d liu hp nht. + D liu cha bit : Khi d liu khng tn ti do thit b hng hoc nguyn nhn khc, RRDTool s lu tr file rrd vi gi tr d liu *UNKNOWN*. + V th : Cho php ngi qun tr to ra cc bo co dng th da trn d liu c lu tr trong c s d liu.

2.2. Gii thiu v Cacti


Cacti l mt cng c m ngun m, gim st mng v to biu c vit bng php/mysql. N s dng RRDTook engine lu tr d liu,to th, v thu thp cc d liu nh k thng qua NET-SNMP (Mt b phn mm s dng v thc thi giao thc SNMP). 2.2.1. Hot ng ca Cacti.

Hot ng ca Cacti gm 3 tc v : + Truy hi d liu (data retrieval ) : Cacti truy hi d liu thng qua poller v s dng SNMP truy hi d liu cc thit b t xa (Cc thit b ny phi h tr SNMP). + Lu tr d liu (data storage) : s dng RRDTool lu tr d liu + Hin th d liu (data presentation) : Cacti s s dng chc nng to th thc thi bo co da trn d liu chui thi gian thu thp c t cc thit b xa.

Trang 17

2.2.2. Ci t Cacti (trn Ubuntu) Ta cn ci t mt s gi sau trc khi ci t Cacti: + RRDTool1.0.49 or higher. + NET-SNMP. + MySQL4.1.x or higher. + PHP 4.3.6 or higher. + Apache/IIS or any other web server.

Apache $ apt-get install apache2

PHP $ apt-get install php5 libapache2-mod-php5

Trang 18

Vo th mc /var/www to file info.php ( kim tra cc gi trn ci thnh cng hay cha) nh sau: <?php phpinfo(); ?> MySQL $ apt-get install mysql-server-5.0 php5-mysql

Sau to passwork mi cho ti khon root (mc nh ban u l trng) :

Trang 19

Net-SNMP $ apt-get install snmp php5-snmp $ apt-get install snmpd php5-snmp RRDTool $ apt-get intall rrdtool Sau khi ng li Apache2 Server bng lnh: $/etc/init.d/apache2 restart. Sau khi ci t cc gi yu cu nh trn kim tra vic ci t thnh cng hay cha ta g vo thanh URL a ch sau: http://localhost/info.php Kt qu:

Trang 20

Tin hnh ci t Cacti sau khi ci thnh cng cc gi trn: $ apt-get install cacti

Trang 21

in passwork cho databases administrative user:

La chn Webserver l Apache2:

Trang 22

G a ch sau vo thanh URL hon tt vic ci t Cacti: http://localhost/cacti Kt qu:

Trang 23

n Finish hon thnh vic ci t.

Trang 24

Mn hnh ng nhp:

Sau khi ng nhp thnh cng giao din chng trnh s nh sau:

Nh vy vic ci t thnh cng!

Trang 25

2.2.3 S dng Cacti qun l mt s thit b a/ Topo qun tr:

Trong : + localhost c ci t Cacti (phn mm qun l SNMP). + cc thit b cn li c bt SNMP service v c qun l bi localhost b/ Add Devices trong Cacti:

Trang 26

c/ Ci t cc Plugin trong Cacti:

d/ th: Cc thng tin v b nh, CPU, ngi dng ng nhp, lu lng vo ra trn cc cng ca Routerc biu din di dng cc th nh sau:

Trang 27

C th xem trc tip cc thng tin cn x l trn cc devices thng qua Realtime:

Trang 28

e/ Gi cnh bo ti Mail: *)Postfix v mailutils cu hnh mail cnh bo v hm th ca admin trn server. +)Ci t Postfix v mailutils: $apt-get install postfix (Trong qu trnh ci t n s hi server name, ta t l localhost) $apt-get install mailutils +)Sau khi ci t xong 2 gi, ta vo giao din cacti, vo phn setting chnh Mail/DNS: cng gi l SMTP 25, server localhost, ngi gi l system@localhost, ngi nhn l luandt@localhost.

Trang 29

+)Chnh Email ca admin cc cnh bo ca thold v nectar gi ti , y admin email l luandt@localhost, chnh trong admin ca user management:

*)Cc thng tin th c gi nh k ti Mail qun tr hng ngy thng qua Nectar:

Khi c mt s kin bt thng xy ra (thit b up/down , ngi dung ng nhp sai, CPU, b nh s dng qu ngng cho php.)trn cc devices n cng s gi cnh bo n Mail qun tr qua thold: Trang 30

CHNG 3: DANH MC TI LIU THAM KHO


1/ http://www.cacti.net 2/ Cacti 0.8 Learn Cacti and design a robust Network Operations Centre_Thomas Urban_3/2011 3/ Cacti 0.8 Network Monitoring_Dinangkur Kundu & S.M.Ibrahim Lavlu_8/2009

Trang 31