Está en la página 1de 45

Xy dng h thng gim st mng cho cc doanh nghip Vit Nam

IH thng gim st 1- Gim st mng l g? 2- Ti sao DN cn xy dng 1 h thng gim st 3- Cc yu t cn thit khi trin khai 1 h thng gim st Cc gii php xy dng h thng gim st 1- nh hng trin khai s dng cho DN Vit Nam - Gii php xy dng h thng gim st trn HDH Win Server (PRTG, SCOM) - Gii php xy dng h thng gim st trn HDH m ngun m (Cacti, natigos) - Gii php xy dng h thng gim st i km thit b Server (Hp openview, Cisco Work) 2- So snh cc gii php Trin khai gii php gim st mng trong DN bng phn mm Cacti da vo nn HDH m ngun m. 1- Gii thiu v Cacti a. Gii php Cacti b. u im c. C ch hot ng 2- Cc chc nng chnh ca Cacti a. Qun l thit b b. Gim st Traffic mng c. Discovery d. Cnh bo qua email

II-

III-

e. Cc chc nng khc 3- Trin khai thc nghim Cacti M hnh thc nghim 3.1- Ci t Cacti a. Update h thng b. Ci t cc gi cn thit, ci RRDtool c. Ci t cacti d. Ci t cc plugin, template 3.2- Nng cp Cacti 3.3- Ci t thit b client cn theo di (Win, Linux, thit b mng, DT, My tnh bng) 3.4- Hng dn dng th theo di mng v thit b 3.5- Hng dn s dng cc templates 3.6- Thit lp qun tr ngi dng trong Cacti 3.7- Trin khai theo di thit b Cisco, HDH Win v Linux 3.8- nh gi qu trnh thc nghim 4- Kt lun a. Kt qu b. u v nhc ca gii php

I- H Thng Gim St
1- Gim st mng l g? Gim st mng l cc hot ng gim st h thng, thit b ca mt mng my tnh thng qua cc cng c phn mm qun l chuyn dng. H thng gim st mng thng c xy dng cc cng ty c quy m va v ln khi c nhu cu kim tra qun l h thng ca h. 2- Ti sao DN VN cn xy dng h thng gim st: Vic qun l tnh trng hot ng ca cc thit b mng, server, qun l bng thng kt ni, trng thi ca cc dch v trong h thng l 1 khi lng cng vic khng l v kh khn vi bt c ngi qun tr no. Nu khng c xy dng mt h thng gim st v cnh bo ngi qun tr s th ng trong vic phng nga, sa cha cc li ca h thng mng t gy ra nhng tn tht nh hng n qu trnh kinh doanh v hot ng ca DN. Mt h thng gim st mng khi c trin khai cho DN s m bo h thng mng ca h lun c tnh sn sng v m bo hiu sut hoat ng. N cung cp kh nng - Pht hin cc s c, kt ni tht bi ca h thng, dch v hay thit b mng 24/7 ng thi gi ngay cnh bo n ngi qun tr. - Xc nhn 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 qu vic b ly cp thng tin. - Tr gip xc nh nng sut ca nhn vin. - Thay th thit b qu ti trc khi n c th nh hng xung mng li. - Xc nh lin kt mng din rng yu v tht c chai. - o tr, hoc chuyn giao d liu b chm tr.

- Tm bt thng trong mng ni b c th cho bit mt mi e da an ninh. V d sau khi trin khai h thng theo di nu thit b trong server, thit b mng c du hiu hng hc nh nhit ln cao qu mc cho php, hiu sut hot ng chm bt thng ngi qun tr c th ch ng lng trc v chun on ngay c nguyn do gy ra ng thi s tin hnh thay th sa cha nhanh gn li pht snh m khng nh hng n hot ng chung ca ton h thng. 3- H thng gim st c th gim st nhng g : Qun l topo gm nhiu kt ni, nhiu thit b trn ton b mng Gim st bng thng Uplink/Downlink cc kt ni theo thi gian thc. Gim st trng thi cc dch v (MAIL, WEB, DNS, VPN) Cc khu vc thng c kim tra gim st l bng thng s dng, hiu sut ca ng dng v hiu sut ca my ch. Gim st lu lng l nhim v c bn. N thng tp chung vo cc vn h tr ngi dng ni b. V vy h thng gim st mng c pht trin gim st cc loi thit b nh: - BlackBerrys. - Cell phones. - Servers, desktops and laptops. - 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...), Physical location . Nhn chung h thng gim st c th gim st cc loi mng thng thng nh sau: - Wireless or wired. - Lan, Wan, VPN.

II- Cc gii php xy dng h thng gim st mng


1- Cc kiu h thng gim st Hin nay c rt nhiu cng c h tr cho vic gim st mng, mi cng c iu c nhng u im ring ty vo nhu cu gim st v quy m ca DN m ngi qun tr c th la cho mnh mt cng c thch hp nht. C th phn loi h thng gim st ra cc loi nh sau: Cc cng c giao din dng lnh CLI (Command Line Interface). V d nh ping . Cc cng c giao din web bao gm chi tit v cc tnh nng biu c sn. Nhng cng c ny c th d dng ci t v s dng. vd : Spicework, PRTG Cc cng c gim st xy dng trn m ngun m c trin khai rt nhiu, chng thng sng to, c sc v tt hn tt c l hu nh min ph v 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 : Cc cng c s dng SNMP (Simple network management protocol) nh OpenNMS, Nagios, Cacti, MRTG, Net-snmp .v.v.; Cc cng c s dng RRD tool (Round-robin database tool ) nh OpenNMS , Cacti, BigSister , WeatherMap4RRD , MailGraph .v.v. Cc thit b h tr gim st mng : C nhng ng dng gip qun l lu lng n cc thit b v ng dng, cc thit b cung cp ng dng cn bng ti trn cc mng con khc nhau. iu ny gip ng b h thng mng. Cc cng ty cung cp dch v gim st, qun l, phn tch h thng mng. Cc cng ty c tnh chuyn nghip v tin cy cao.

2- So snh mt vi gii php: Name IP Agen SNM SLA t P Report Yes No Yes Yes No Yes Syslog Plugins WebAp Data Storage p Method Full Control Full Control Yes Full Control Full Control Yes RRDtool MySQL Postgre SQL Orcale Database Flat file SQL Proprietary SQL Mysql Oracle Database License Map Access Control yes Yes

Cacti Hp Network Node nagios

Yes

Yes

GPL

Yes

PRTG Network Solarwin Yes ds Tivoli Possibl No e via Config uration

Via plugin Yes

Supp orted Supp ort Yes

Via Yes Integrat ion Via Via Yes plugin Plugin Yes Yes Yes Yes Yes Yes Yes Yes Yes

Commercial Yes

GPL

Yes

Yes Yes Yes Yes

Freeware Yes Commercial Commercial Yes Commercial Yes

3- nh hng trin khai cho cc DN Vit Nam: Ty vo chnh sch v trang thit b h tng thc t ca tng cng ty m ngi qun tr quyt nh xy dng loi h thng gim st no. C th trin khai da trn vi gi sau:

i vi DN xy dng nn tng h tng Winserver chy qun l Active Directory th vic s dng cng c System Center Operation Manages kt hp thm mt s cng c nh Wireshark, performance l gii php kh tt trong vic qun l ton din h thng. i vi cc DN trang b h tng vi phn nhiu l thit b Cisco c th xy dng h thng gim st h tng bng Cisco Works. Cc cng c i km vi cc my ch Server nh : IBM Samrt Cloud Monitoring, HP Open View, Dell EquaLogic MPs Cc cng c ni bt trong vic gim st mng nh: Solawinds, Tivoli, PRTG Cc cng c c xy dng trn m ngun m nh : Cacti, Nagios, Zabixx.. a s cc cng c qun l gim st mng iu c kh nng p ng nhng nhu cu m DN mong mun nh qun l thit b, lp s h thng c kh nng cnh bo v s l s c. i vi cc DN ln trin khai h thng vi hng ngn Node th Tivoli, SCOM, Cisco Work, Hp OpenView l gii php u tin trong vic gim st, nhng chi ph u t v phn mm v thit b cng nh chi ph h tr, ph nng cp phn mm thng rt tn km. i vi cc DN va v nh Vit Nam c th s dng gii php m ngun m nh Cacti, Nagios vi kh nng gim st mnh m khng km cc sn phn thng mi khc li va c th ty bin cao vi nhu cu s dng.

III- Trin khai gii php gim st mng trong DN bng phn mm Cacti da vo nn HDH m ngun m.
1- Gii thiu v Cacti a. Gii php Cacti: Cacti l phn mm m ngun m, gim st mng v cng c ha vit trn PHP/ MySQL. Cacti s dng RRDTool (Round-robin database tool) mc ch l lu tr d liu v to ha. Cacti thu thp d liu nh k thng qua Net-SNMP (mt b phn mm dng thc hin SNMP-Simple Network Management Protocol). b. u im Cacti: Trc ht, Cacti l cng c s dng m ngun m. Thng dng nht, Cacti c th v bng thng mng vi SNMP. C nhiu l do quan trong m nh qun tr h thng nn chn Cacti nh l cng c gim st mng: Cacti c giao din tin dng c xy dng vi PHP/MySQL. Cacti c din n dng h tr v cp nht. Bn c th thm plugins tch hp sn cc cng c min ph. Qun l tp trung log, t a ra nhng cnh bo sm (bng email hoc tin nhn) gi cho qun tr mng khi c s c xy ra (nh t ng truyn, cht dch v, hng cng, hng card mng, qu ti RAM, qu ti CPU, vv) D dng m rng v qun l n hng vi ngn thit b Min ph, ch mt chi ph trin khai trn my tnh Chy trn linux nn hiu nng rt cao. C sn nhiu mu Template c vit sn cho cc loi thit b mng, my ch v cc h iu hnh khc nhau. D dng to cc Templates cho cc thit b

Cho php b sung nhiu chng trnh plugin tin ch, cho php trin khai nhanh chng h thng qun l ti nguyn mng vi chi ph hp l. c. C ch hot ng ca Cacti: C ch hot ng ca Cacti c chia lm 3 nhim v khc nhau: - Ly d liu - Lu tr d liu - Biu din d liu

Hnh 1 : C ch hot ng ca cacti Ly d liu Cacti ly d liu thng qua poller. N l ng dng thc thi ti mt khong thi gian c nh nh l dch v lp lch di cc h iu hnh khc nhau. N c lp lch trong h iu hnh. Trong Unix, n c thit lp theo crontab. Hin nay, c s h tng mng cha rt nhiu thit b nh routers, switches, servers, UPS, cc my tnh v thit b mng khc nhau. ly d liu t dch v kt ni t xa, Cacti s dng SNMP. Cc thit b c s dng SNMP c th c theo di bi CacTi. Lu tr d liu

Cacti s dng RRDTool lu tr d liu. RRD l h thng lu tr v cho bit chui thi gian d liu c thu gom t cc thit b cha SNMP. N hp nht d liu trc bng cc hm nh AVERAGE, MINIMUM, MAXIMUM, v nh th vic lu tr s nh . l l do ti sao n li nhanh, to ha d dng v nhng bo co t tp tin RRD. Biu din d liu Chc nng quan trng nht ca RRDTool l tch hp chc nng ha. Cacti s dng chc nng ny trin khai ty chnh cc bo co ha da vo thi gian thu thp t cc thit b cha SNMP khc. C th c 1 hoc nhiu thng tin trong biu , cng c th thm cc c im tiu biu khc nh maximum, average, minimum, .v.v. 2- Cc chc nng chnh ca Cacti: a. Qun l thit b: Cacti gim st v cho bit trng thi ca cc thit b trong mng theo thi giam thc. ng Cacti cn c th thng k hiu qu hot ng ca cc thit b. b. Gim st Traffic mng: Cacti gim st hot ng traffic trong h thng mng, gim st traffic trn tng cng ca thit b. c. Discovery: Cacti c kh nng pht hin cc thit b mi kt ni vo h thng, kim tra xem thit b mi c h tr SNMP hay khng, to iu kin kt ni gim st thit b. d. Chc nng cnh bo m thanh: Khi s dng plugin monitor, h thng s pht ra m thanh cnh bo khi c thit b mt kt ni. e. Chc nng cnh bo qua email Thold: Thold l mt plugin cho php thit lp cc hng ngch gim st,v cnh bo qua email. Thold thit lp cc gii hn cao thp ca cc ch s ca thit b nh CPU,traffic, nu cc ch s vt gii hn th thold s gi email cnh bo.

f. Chc nng router config: Routerconfigs l plugin cho php lu li thng tin cu hnh ca router, nh c th backup li router khi cn thit. g. Chc nng weathermap: Weathermap l plugin cho php m phng li h thng mng bng biu c km theo cc thng s theo di. y l chc nng rt trc quan v hu ch. h. Chc nng plugin NPC: NPC l plugin gip tch hp Nagios vo Cacti, nh Cacti c thm kh nng gim st mng ca Nagios nh : gim st cc dch v mng (pop3,smtp,ftp,http),gim st thit b mng, v biu 3- Trin khai thc nghim Cacti: M hnh thc nghim: Trin khai thc nghim h thng gim st Cacti trn Centos 6.2 trong m hnh mng Lan, vi cc thit b cn c theo di : my trm s dng h thng win Xp, win 7, v smart phone. Yu cu gim st : Theo di bng thng truy xut ra mng Theo di nhit ca HDD, CPU, Switch Thc hin cc chc nng cnh bo Thc hin chc nng router config Xy dng bn hin th theo di Thc hin chc nng template v hng dn s dng Thc hin chc nng Flugin v hng dn s dng Kt hp vi flugin nagios nh gi tng quan v kt lun

Hnh: S thc nghim 3.1- Ci t Cacti: Ti Server Centos thc hin cc bc sau: a. Update h thng: - Lnh Update h thng: # yum y update

b. Ci t cc gi cn thit : RRDTool 1.0.49 hoc 1.2.x hoc mi hn MySQL 4.1.x hoc 5.x hoc mi hn PHP 4.3.6 hoc mi hn A Web Server e.g. Apache or IIS Ci cc gi cn thit : # yum -y install mysql-server mysql php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-snmp php-pear-Net-SMTP php-mysql httpd Ci RRDtools: # yum -y install gcc gcc-c++ cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel # cd /usr/src/ # wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.7.tar.gz # tar -zxvf rrdtool-1.4.7.tar.gz # cd rrdtool-1.4.7 # export PKG_CONFIG_PATH=/usr/lib/pkgconfig/ # ./configure

Ci t v cu hnh Snmpd # yum -y install net-snmp-utils php-snmp net-snmp-libs Configure snmpd # vi /etc/snmp/snmpd.conf Thm vo on sau: com2sec local localhost public group MyRWGroup v1 local group MyRWGroup v2c local group MyRWGroup usm local view all included .1 80 access MyRWGroup "" any noauth exact all all none syslocation Unknown (edit /etc/snmp/snmpd.conf) syscontact Root (configure /etc/snmp/snmp.local.conf) pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat Save v ng file. Thit lp service snmp lun chy khi khi ng my # Service snmpd start # chkconfig snmpd on

Cu hnh Mysql: Khi ng services mysql: # services mysqld start # chkconfig mysqld on Cu hnh Mysql Server : # mysqladmin -u root password 123456 To database tn Cacti # mysql -u root -p -e 'create database cacti' To ngi dng vi tn l cacti password t y l 123456 v gn quyn cho user Thm Group v user cho Cacti # /usr/sbin/groupadd cacti # /usr/sbin/useradd -g cacti cacti # passwd 123456 # mysql -u root -p

mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY '123456'; mysql> FLUSH privileges; mysql> \q

c. Ci t Cacti: #wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz #tar -zvxf cacti-0.8.8a.tar.gz -C /var/www/html/ #cd /var/www/html/ #mv cacti-0.8.8a cacti Cu hnh cacti vo file config.php thm vo on sau: #vi /var/www/html/cacti/include/config.php $database_type = "mysql"; $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cacti"; $database_password = "123456"; $database_port = "3306"; Thm dng sau vo file /etc/crontab

*/5 * * * * cactiuser /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1 Ci t c s d liu cho Cacti # mysql -u cacti -p cacti < /var/www/html/cacti/cacti.sql Thay i ownership ca /var/www/html/cacti/rra/ v /var/www/html/cacti/log/ # cd /var/www/html/cacti # chown -R cacti rra/ log/ Khi ng li 2 service http v mysql # service mysqld start # service httpd start Truy cp vo a ch : localhost/cacti 1 bng ci t s hin ra => Install => Next s dn ti bng Cacti installation guide ti y thay ng dn RRDtool Brinary Path nh sau: /usr/local/rrdtool-1.4.7/bin/rrdtool => Finish.

Bng login hin ra mc nh user v pass l : admin bn c th thay i password ty theo mnh mun => Next => hon thnh xong phn ci t cacti.

d. Ci t cc flugin cho Cacti: Plugin Architecture Cacti: # cd /usr/src/ # wget http://mirror.cactiusers.org/downloads/plugins/cacti-plugin-0.8.7e-PA-v2.5.zip # unzip cacti-plugin-0.8.7e-PA-v2.5.zip # cd files-0.8.7e/ # cp R * /var/www/html/cacti/ # cd /var/www/html/cacti/ # patch -p1 -N < /usr/src/cacti-plugin-0.8.7e-PA-v2.5.diff Config file /var/www/html/cacti/include/global.php # vi /var/www/html/cacti/include/global.php Tm n dng $config['url_path'] v sa thnh: $config['url_path'] = '/cacti/'; Plugin Monitor: # cd /usr/src # wget http://cactiusers.org/downloads/monitor.zip # unzip monitor.zip # cp -R monitor/ /var/www/html/cacti/plugins/

Config file /var/www/html/cacti/include/global.php: # vi /var/www/html/cacti/include/global.php Tm n dng $plugins = array(); v thm $plugins[] = 'monitor'; di i vi cc flugin khc c th lm tng t 3.2- Nng cp cacti: a. Sao lu c s d liu Cacti trc khi nng cp # Cp /var/www/html/cacti /usr/saoluu # mysqldump -u root -p -1 --add-drop-table cacti >cacti_mysql_backup b. Nng cp Cacti # yum upgrade cacti Sau khi s dng yum upgrade thnh cng, truy cp localhost/cacti/install => Next => Chn upgrade cacti => Finish hon thnh qu trnh updrage

3.3- Ci t thit b Client cn theo di: 3.3.1 Cu hnh dch v SNMP trn Client Tt c cc client cn ci t dch v SNMP cung cp thng tin cho Cacti a. Cu hnh SNMP trn my trm WinXp, win7, winserver 2k3, 2k8: Ci t v kch hot cc dch v SNMP: Trong WinXP or win 2k3 Vo hp thoi Add or Remove Programs, chn Add / Remove Windows Components m Windows Components wizard. Trong Windows 7 or Win 2k8 vo Control Panel. Nhp vo Programs v sau kch vo Turn Windows features on or off. Trong thnh phn ca Windows XP v 2003, nhp vo Management and Monitoring Tools (nh du hoc b nh du hp kim ca n thay i cc la chn hin c), v sau nhp vo Details. Trong Windows Features of Vista,chn SNMP feature. Chn v nh du vo hp kim tra ca Simple Network Management Protocol or SNMP feature. Nhp OK. Cng nhn Next nu bn ang trong Windows XP hoc 2003. Dch v SNMP s c ci t trn h thng. H thng c th yu cu a CD /DVD ci t Windows vo a. SNMP s t khi ng sau khi ci t. Cu hnh SNMP service (Add public community string): Vo CMD g service.msc Xc nh v tr v kch chut phi vo SNMP Service, sau chn Properties. Trong ca s SNMP Service Properties, bm vo tab Traps.

In the Community name text box, enter public or any other case -sensitive SNMP community name to which this computer will send trap messages. Trong h p vn bn Community name, nhp public hoc tn SNMP community m my s gi tin nhn. Bm vo nt Add to list. b. Cu hnh SNMP trn h thng Linux VD ci t trn ubuntu, debian: Thc hin ci t snmp : $apt-get install snmp snmpd. Hiu chnh file /etc/snmp/snmpd.conf vi tn ca cng ng ca chng ta. #mv /etc/snmp/snmpd.conf /etc/snmp/old.snmpd.conf #echo "rocommunity community_name" > /etc/snmp/snmpd.conf community_name l tn ca cng ng ban u c s dng vi Cacti Hiu chnh file /etc/default/snmpd , tm dng bt u vi SNMPDOPTS v loi b cc tham chiu n 127.0.0.1 cui. Dng ny by gi trng ging nh hnh di y: SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid' Cui cng, khi ng li trnh nn SNMP cp nht nhng thay i thc hin cho nhng tp tin ny. c. Cu hnh SNMP trn thit b Cisco: ng nhp Router,Switch cisco mode config v nhp lnh sau : #snmp-server host IP_address community_name #snmp-server community community_name

3.3.2 Thm thit b qun l: Click vo Devices trong nhn Management:

Click Add:

Mi mt thit b c cc thuc tnh v gi tr khc nhau. Bng sau y s gip bn hiu hn v cc thuc tnh
Tn bin Description
Hostname

Host Template

Disable Host

Down Host Message Downed Device Detection

ngha Nhp vo gii ngha cho thit b . Gii ngha ny s c hin ln trong ct u tin ca thit b trong phn danh sch cc thit b. Ch r hostname hoc IP ca thit b. Nu l hostname c chn, nh: cacti.cmctelecom.vn, DNS s gii ngha hostname ra IP. Host template s nh ngha cc kiu ca d liu cn tp hp li ca mt kiu host. Check vo box ny v hiu tt c nhng vic kim tra cho thit b ny. C ngha l khng kim sot cc thit b ny. Nhp vo on vn bn m bn mun hin th khi thit b down La chn phng thc m Cacti dng pht hin thit b c down hay khng. C 5 ty chn: None, Ping and SNMP, Ping or SNPM, SNMP, Ping. Khuyn ngh l phng thc SNMP lun c chn. La chn phng thc gi gi Ping. C 3 ty chn: ICMP Ping, TCP Ping, UDP Ping. La chn ny ch c khi phng thc Ping chn l TCP Ping hay UDP Ping. Xc nh port number. Bn phi chc chn firewall khng block port . Gi tr ny c tnh theo n v milliseconds. Xc nh khong thi gian m sau khong thi gian th Ping test fail. Xc nh s ln Cacti s th Ping thit b trc khi khng nh thit b fail. La chn phin bn SNMP. C 4 ty chn:
-

Ping Method

Ping Port

Ping Timeout Value Ping Retry Count SNMP Version

Not in use: Khng s dng SNMP Version 1: c h tr bi phn ln cc thit b, nhng khng h tr nhng thit b 64 bit.

SNMP Community SNMP Port SNMP Timeout

Notes Unit Grid Value (-unit/--y-grid) Unit Exponent Value (--unitsexponent) Vertical Label

Version 2: c bit n vi phin bn SNMPv2c. H tr phn ln cc thit b - Version 3: SNMP Version 3 h tr xc thc v m ha. Chui dng giao tip vi thit b. UDP port number c s dng cho SNMP (Mc nh l port 161) Gi tr ln nht c tnh theo milliseconds m Cacti s i phn hi SNMP t thit b Thm phn gii ngha cho thit b. Xc nh n v ca cc gi tr ca trc y.
-

Gi tr ca ty chn ny nm trong khong gii hn t -18 n 18. V d, gi tr l 3 nu bn mun biu din mi th vi n v l k (kilo) v l -6 nu mun biu din mi th vi n v l micro.

nh ngha nhn c in pha cnh tri ca th. Thng thng l n v ca d liu trn th.

Sau khi nhp vo cc trng trn, n Create to thit b. Nu thnh cng s hin ra nh sau:

Nu bn nhn thy c cnh bo SNMP error, tc l c vn v SNMP gia thit b chy Cacti v thit b m bn mun thm vo.

pha di ca hnh sau khi to thnh cng thit b, chng ta s thy nh sau:

C 2 ty chn: o Associated Graph Templates o Associated Data Queries Nu bn chn host template, s c vi items trong c 2 phn trn. Nu bn khng chn host template, s khng c items no. Trong trng hp mun to th qun l thit b, s yu cu c t nht 1 item cho Associated Graph Templates ho c Associated Data Queries. Bn c th tham kho thm v tm thy cc template link sau: http://www.debianhelp.co.uk/cactitemplates.htm

3.4- Hng dn dng th theo di mng v thit b : a. To mt th: Sau khi thm vo cc thit b cho h thng, ta s to cc th cho cc thit b . Click Newgraph di nhn Create trong ch Console:

La chn thit b cn qun l phn Host, Kiu th trong Graph Types. La chn cc Graph template trong phn Create ca Graph Templates. Sau click Create b. T chc mt th: Trong Cacti, cc th dc t chc theo cu trc hnh cy theo bc. Bn c th qun l cy th bng cch click Graph Trees trong nhn Management:

Danh sch cc cy to hin ra. Click Add to 1 cy mi hoc click vo cy to to cc nhnh bn trong cy .

Trong trng hp to cy mi: Click Add:

Nhp tn ca cy vo Name v chn kiu sp xp ca cy menu. C 4 kiu sp xp sau: Manual Ordering: Mi mt th hay thit b c thm vo c th c sp xp li theo mun trong cy hoc cc nhnh. Alphabetic Ordering: th hay thit b s c sp xp theo th t abc Numeric Ordering: th hay thit b c sp xp theo s Natural Ordering: Sp xp theo ch ci c tnh n s tng ca s. Sau khi nhp y v click Create, hin ra bng sau:

Click Add nu bn mun thm vo cc nhnh ca cy :

y c mt ty chn l Tree Item Type, bn c th chn kiu ca item trong cy. C 3 kiu: Header, Graph v Host. Chn Header trong trng hp to nhnh ca cy. Chn Graph trong trng hp mun to ra 1 th trong cy. Chn Host trong trng hp mun to ra 1 thit b trong cy. C th thm cc nhnh con trong nhng nhnh to ra. Hnh sau l v d 1 cy c to:

Sau khi to xong cy v cc chi nhnh ca cy. Ta thm vo cc Graph hay cc thit b tng ng trong nhnh . VD y ta thm vo thit b trong Network Monitor. Click vo Add ng vi nhnh network monitor:

Kiu ca Item chn l Host, chn n host mun thm vo trong ty chn Host. Sau Click Create:

Click Save. Sau khi to xong, ta vo trong tab Graphs kim tra:

3.5- Hng dn ci t v s dng template: Cacti lu tr tt c thng tin thu c thng qua cng c gi l RRDTool lu vo trong file *.rra. RRDtool yu cu mt vi tham s to ra c file *.rra. Bt c khi no ta mun thm mt thit b mi hay to mt graph mi , ta phi nhp vo nhng tham s ny. Vic nhp bng tay cc tham s ny lun phc tp v tim n li. Bng cch s dng template, chng ta c th gii quyt c nhng vn trn. C 2 loi template ca Cacti:

Graph template Host template 3.5.1- Graph template: Mt graph template cung cp mt b khung cho th thc t. Khi bn c nhiu hn mt h thng hay thit b, mt th mu ny s gip bn tit kim rt nhiu thi gian v hn ch ti a nhng li c th xy ra trong qu trnh nhp liu.Bt k tham s c nh ngha trong mt graph template s c copy ti tt c cc graph c to bi graph template . a. To 1 graph template : Click vo tab Console. Click vo Graph Templates di nhn Templates.

Danh sch cc graph template hin ra, click Add:

Danh sch v ngha cc bin c s dng to graph template:

Tn bin Name
Title (--title)

ngha Tn ca graph template y l tiu s hin ln pha trn ca graph. V vy, bn cn cn thn khi intiu ny. Phn ln s dng nh dng tiu nh sau: |host_description| - your graph name. Trong , |host_description| l t kha ca Cacti. Khi tao mt graph t graph template ny, Cacti s thay th t kha ny bng hostname. Kiu ca file nh s c to ra. Mc nh l file PNG. C 2 la chn khc l file SVG v file GIF. Chiu cao ca th. Gi tr mc nh l 120 pixels Chiu di ca th. Gi tr mc nh l 500 pixels. Ty chn ny cho php lm mn th dng ng cong dc ln xung ch khng phi dng ng gp khc kiu cu thang. Ty chn ny cho php t ng chia t l ca th Nu Auto Scale c chn th bn phi chn mt trong 4 ty chn sau:
-

Image Format (-imgformat) Height (--height) Width (--width) Slope Mode (--slopemode) Auto Scale Auto Scale Options

Use --alt-autoscale (ignoring given limits) : Ty chn ny cho php RRDTool b qua tt c cc gii hn. Use --alt-autoscale-max (accepting a lower limit): Ty chn ny s chp nhn nhng gii hn thp, nhng gi tr ti a s c to ra t ng ty thuc vo gi tr c lu tr. Use --alt-autoscale-min (accepting an upper limit, requires rrdtool 1.2.x): Ty chn ny s chp nhn nhng gii hn cao, nhng gi tr ti thiu s c to ra t ng ty thuc vo gi tr c lu tr. Ty chn ny ch c trong rrdtool ver 1.2.x hoc cao hn.

Logarithmic Scaling (--logarithmic)

SI Units for Logarithmic Scaling (--units=si) Rigid Boundaries Mode (--rigid)

Allow Graph Export

Upper Limit (-upper-limit) Lower Limit (-lower-limit) Base Value (--base)

Unit Grid Value (-unit/--y-grid) Unit Exponent Value (--units-exponent)

Use --alt-autoscale (accepting both limits, rrdtool default): Ty chn ny chp nhn c gii hn trn v gii hn di. Check vo ty chn ny nu bn mun chia trc y theo cc bc tng logarit c s 10 ( Trn trc y bnh thng, 10 c tip theo bi 20, 30, 40, v. v... C n trong thang logarit, 10 c tip theo bi 100, 1. 000, 10. 000 v. v... iu ny lm cho th loga dng rt thun li khi biu din cc gi tr d liu khc nhau qu nhiu. Trong th bnh thng bn rt kh biu din cho r cc lot d liu c tr s nh, nhng trong th loga cc tr s nh c biu din r rng hn) S dng h o lng chun quc t cho vic biu din th loga. iu ny ch c ngha khi ty chn Logarithmic Scaling (--logarithmic) c chn. Thng thng, rrdgraph s t ng m rng gii hn thp v cao ca th nu th bao gm nhng gi tr ngoi gii hn a. Ty chn ny cho php chng ta v hiu ha vic m rng . Check vo ty chn ny nu bn mun cho php trch xut (export) graph template . Gi tr ln nht c biu din trn trc y. Gi tr ny s b b qua nu ty chn auto-scaling c chn. Gi tr nh nht c biu din trn trc y. Gi tr ny s b b qua nu ty chn auto-scaling c chn. Ty chn ny thng c t gi tr l 1024 nu graph dng biu th b nh v gi tr l 1000 trong php o lu lng mng. Xc nh n v ca cc gi tr ca trc y.
-

Gi tr ca ty chn ny nm trong khong gii hn t -18 n 18. V d, gi tr l 3 nu bn mun biu din mi th vi n v l k (kilo) v l -6 nu mun biu din mi th vi n v l micro.

Vertical Label (-vertical-label)

nhngha nhn c in pha cnh tri ca th. Thng thng l n v ca d liu trn th.

Trong mi tham s trn, c ty chn Use Per-Graph Value (Ignore this Value). Ty chn ny c hiu l s l i gi tr ny trong template v ngi dng c th nhp gi tr trong qu trnh to th s dng graph template . Sau khi in cc vng , click Create button to graph template. Cng vic by gi l cn add cc Graph Template Item v Graph Item Inputs hon thnh vic to graph template. b- Graph Template Item Graph Template Item l cc mc (Item) c hin th trn th. thm mt graph template item, Click vo graph template c to ra:

sau click Add ca phn Graph Template Item:

Sau khi hon thnh cc mc trn, click Create to Graph Template Item. c- Graph Item Inputs : thm mt graph template item, Click vo graph template c to ra:

sau click Add ca phn Graph Item Inputs:

Danh sch v ngha cc bin c s dng to Graph Item Inputs:


Tn bin
Name

Description

Field Type Associated Graph Items

ngha Tn xc nh cho graph item input trong graph template v graph edit page Gi ngha ny c hin ra trong trang sa i ca graph (graph edit page). La chn nhng kiu d liu no c hin th trn th Chn graph item m bn mun ngi dng nhp vo

Sau khi hon thnh cc mc trn, click Create to Graph Item Input. 3.5.2- Host Tempalte: Host template khc mt cht so vi data template hay graph template. Mt host template l tp hp ca cc graph templates lin quan v cc truy vn d liu m bn mun lin kt vi mt kiu host c bit no .

Nh ta thy hnh trn l m t cc thnh phn ca mt host template. Tn host template l Cisco - 6500. N bao gm 5 graph template v 2 truy vn d liu lin quan. Khi bn thm mt thit b mi, nu bn chn host template l Cisco 6500, th tt c nhng biu v cc truy vn d liu lin quan s c thm vo thieestbij . Host template thc s hu dng i vi mt mng ln c nhiu thit b cng kiu. a. To Host Template : Click vo Host Templates di nhn Templates.

Danh sch cc host template c hin ra. Click vo Add:

Nhp tn host vo, click Create:

Chn cc graph template v cc truy vn d liu lin quan n host . Click add. Sau khi chn graph templates v cc truy vn d liu, click save b. S dng Host Template Khi bn thm mt thit b mi, bn phi chn host template cho thit b . T menu tr xung ca host template, chn host template ph hp vi thit b mun thm vo.

3.6- Thit lp qun tr ngi dng trong Cacti: Cacti a ra nhng chc nng qun l ngi dng nh thm, sa v xa nhng ngi dng. Ngi dng c th to v xem th hoc truy cp vo cc phn khc ca Cacti. Trong Cacti, chia lm 2 nhm quyn cho ngi dng c php truy cp vo l: Quyn theo vng (Realm Permissions) v quyn theo th (Graph Permissions) 3.6.1- Giao din qun tr ngi dng: vo giao din qun tr ngi dng, tab Console, click User management di nhn Utilities:

Mc nh, Cacti to ra 2 user: admin v guest. Ngi dng admin c th truy cp su vo h thng ca Cacti, c n ngi dng guest ch c th xem v truy cp vo nhng vng mc nh nh l mt ngi dng cha c xc thc. Ngi dng cha c xc thc ch c php truy cp vo graph_view.php v xem ch khng c php thay i.

3.6.2- Thm ngi dng: Click Add phn User management trong giao din qun tr ngi dng, hin ra ca s sau:

Sau khi nhp username v password cho user, chng ta xt cc quyn cho ngi dng . Quyn theo vng (Realm Permission) nh hnh trn v quyn theo th (Graph Permissions ) nh hnh sau:

3.6.3- Sa ngi dng: Sau khi to c ngi dng nh trn, chng ta cn sa nhng thuc tnh ca ngi dng . Sau khi vo giao din ngi dng s lit k 1 danh sch cc user c to. Ta click vo user mun sa i:

ngha ca cc trng trong phn ny nh bng sau:

Tn bin User Name


Full Name Password Enable Account Options

Graph Options

ngha y l tn c dng truy cp vo Cacti. Khng gii hn s lng k t trng ny. Tn y ngi dng. Nhp mt khu ca ngi dng dng ng nhp vo h thng Tuy chn ny cho php bn v hiu ha hay kch hot ngi dng C 2 ty chn cho trng ny: User Must Change Password at Next Login v Allow this User to Keep Custom Graph Settings. C 3 ty chn xc nh ngi dng c php xem theo cch no: User Has Rights to Tree View - User Has Rights to List View - User Has Rights to Preview View Ch c ngi qun tr mi c php thay i thng tin ny v ngi dng C 3 ty chn ng nhp:
-

Login Options

Authentication Realm

Show the page that user pointed their browser to: Ty chn ny cho php ngi dng ng nhp li trang c xem trc khi ngi dng ng nhp li sau khi phin ca ngi dng ht hn. - Show the default console screen: Ty chn ny s lun a ngi dng n trang mc nh index.php khi ngi dng ng nhp vo. - Show the default graph screen: Ty chn ny s lun a ngi dng n trang graph_view.php sau khi ng nhp. Trong mt mng ln, c nhiu ngi dng khc nhau. Ty chn ny cho php nhiu ngi dng khc nhau c th truy cp vo Cacti. C 3 ty chn cho phn ny: Local, Web Basic v LDAP.
-

3.6.4- Cc ty chn qun tr ngi dng khc: Cacti h tr thm cc ty chn ngi dng sau: Delete Copy Enable Disable Batch Copy Nhng ty chn ny trong menu tr xung ca phn choose an action trong giao din qun tr ngi dng khi tick vo ngi dng (hay mt nhm ngi dng) m ta mun thc hin nhng thao tc .