Está en la página 1de 27

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)

Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

HNG DN S DNG CACTI 1. Ci t cacti:


1.1.
-

Update h thng

To file /etc/yum.repos.d/dag.repo:
# nano /etc/yum.repos.d/dag.repo

Paste ni dung sau v save li:


[dag] name=Dag RPM Repository for Red Hat Enterprise Linux baseurl=http://apt.sw.be/redhat/el5/en/i386/dag/ gpgcheck=1 enabled=0

Update h thng:
# yum -y update

1.2.
-

Ci t cc gi yu cu:

Cc phn mm yu cu trc khi ci cacti nh sau: o RRDTool 1.0.49 hoc 1.2.x hoc mi hn o MySQL 4.1.x hoc 5.x hoc mi hn o PHP 4.3.6 hoc mi hn o A Web Server e.g. Apache or IIS Ci cc thit:
# yum -y install php httpd mysql mysql-server php-mysql vim-enhanced net-snmp net-snmp-utils php-snmp initscripts

Ci RRDtool
# 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.3.9.tar.gz # tar -zxvf rrdtool-1.3.9.tar.gz # cd rrdtool-1.3.9 # export PKG_CONFIG_PATH=/usr/lib/pkgconfig/ # ./configure

Hng dn s dng Cacti

-1-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

Nu sau khi chy lnh trn gp li sau:


checking whether build environment is sane... configure: error: newly created file is older than distributed files! Check your system clock

L do l sai thi gian h thng. Ta fix bng cch ci ntp client v cho sync vi ntp server:
# yum -y install ntp # chkconfig ntpd on # ntpdate pool.ntp.org # /etc/init.d/ntpd start

Sau chy li lnh ./configure v lm tip nh sau:


# ./configure # make # make install # cd /usr/local/ # # # # mkdir rrdtool ln -s rrdtool-1.3.1/ rrdtool/ cd rrdtool ls -l

1.3.
-

Ci t cacti

Download v gii nn cacti:


# cd /usr/src/ # wget http://www.cacti.net/downloads/cacti-0.8.7e.tar.gz # tar xzvf cacti-0.8.7e.tar.gz # mv cacti-0.8.7e cacti # mv cacti /var/www/html/

To group v user cho cacti:


# /usr/sbin/groupadd cacti # /usr/sbin/useradd -g cacti cactiuser # passwd cactiuser

Thay i ownership ca /var/www/html/cacti/rra/


/var/www/html/cacti/log/

Hng dn s dng Cacti

-2-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

# cd /var/www/html/cacti # chown -R cactiuser rra/ log/

To mysql root password


# service mysqld start # /usr/bin/mysqladmin -u root password samplepass

To MySQL database cho cacti


# mysqladmin --user=root --password=samplepass create cacti # cd /var/www/html/cacti # mysql --user=root --password=samplepass cacti < cacti.sql

To MySQL user v password cho cacti


# mysql --user=root --password=samplepass mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'samplepass'; mysql> flush privileges; mysql> exit

Edit file /var/www/html/cacti/include/config.php


# nano /var/www/html/cacti/include/config.php

Sa user v password theo ni dung config phn trn


$database_type = "mysql"; $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cactiuser"; $database_password = "samplepassword"; $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

Edit file /etc/php.ini


# nano /etc/php.ini

Tm n dng memory_limit v thay i gi tr ca memory_limit thnh 128M

Hng dn s dng Cacti

-3-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

Khi ng apache server v MySQL server:


# service mysqld start # service httpd start

Truy cp vo cacti theo a ch: http://your.internal.IP.address/cacti

Click next

Chn new install v click next. S xut hin li nh sau

Hng dn s dng Cacti

-4-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

Thay i ng dn n rrdtool nh sau: /usr/local/rrdtool-1.3.9/bin/rrdtool v click finish

User v password mc nh cho ln ng nhp u tin l admin/admin Sau khi ng nhp ln u tin, h thng s bt thay i password admin:

Type password vo v click Save

hon thnh vic ci t cacti.

Hng dn s dng Cacti

-5-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

1.4.

Ci t cc Plugin cho cacti


1.4.1. PluginArchitectureCacti
# cd /usr/src/ # wget http://mirror.cactiusers.org/downloads/plugins/cacti-plugin0.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:


# nano /var/www/html/cacti/include/global.php

Tm n dng $config['url_path'] v sa thnh: $config['url_path']


'/cacti/';

Hng dn s dng Cacti

-6-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

1.4.2. Monitor Plugin


# 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:


# nano /var/www/html/cacti/include/global.php

Tm n dng $plugins

= array();

v thm

$plugins[] = 'monitor';

di

i vi cc plugin khc ci tng t. Trong trng hp mun tit kim thi gian v n gin ha vic ci t h thng, ta c th s dng cactiez. C th tm hiu link: http://cactiez.cactiusers.org/ hoc search google.

2. S dng th qun l mng v thit b:


2.1. Thm mt thit b: Trc khi thm mt th, chng ta cn thm mt thit b m chng ta mun to th. Thit b cn thm vo cn phi c cu hnh m dch v SNMP. Sau khi ng nhp vi ti khon Admin. Click vo Devices trong nhn Management:

Click Add:

Hng dn s dng Cacti

-7-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

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

Ping Method

Ping Port

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 . -8-

Hng dn s dng Cacti

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815
Ping Timeout Value

Ping Retry Count

SNMP Version

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:
-

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. 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.

SNMP Community SNMP Port SNMP Timeout

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

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. nhngha nhn c in pha cnh tri ca th. Thng thng l n v ca d liu trn th.

Vertical Label (-vertical-label)

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. Hng dn s dng Cacti -9-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

Bn c th s dng cu lnh snmpwalk trong ch debug. Lnh ny s a ra 1 bng cc interfaces ca thit b. Trc khi s dng snmpwalk, phi chc chn service snmpd ang chy v c cu hnh nghe yu cu t thit b khc. Snmpwalk v 2c c public 115.146.120.55 sysUpTimeInstance tm hiu r hn v snmpwalk bn c th tham kho theo link sau: http://www.net-snmp.org/docs/man/snmpwalk.html 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 hoc Associated Data Queries. Bn c th tham kho thm v tm thy cc template link sau: http://www.debianhelp.co.uk/cactitemplates.htm 2.2. To mt th cho thit b

Sau khi thm vo cc thit b cho h thng, ta s to cc th cho cc thit b . Click Newgraph di nhn Createtrong ch Console:

Hng dn s dng Cacti

-10-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

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 2.3. T chc 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: o Manual Ordering: Mi mt th hay thit b c thm vo c th c sp xp li theo mun trong cy hoc cc nhnh. o Alphabetic Ordering: th hay thit b s c sp xp theo th t abc o Numeric Ordering: th hay thit b c sp xp theo s o 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:

Hng dn s dng Cacti

-11-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

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:

Hng dn s dng Cacti

-12-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

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

Phn tip theo chng ta s tm hiu v cc Templates trong Cacti

3. To v s dng cc templates
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: o Graph template o Host template 3.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 anhng 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 . Hng dn s dng Cacti -13-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

3.1.1. To mt graph template

ng nhp vi ti khon admin. Click vo tab Console. Click vo Graph Templates di nhn Templates.

Danh sch cc graph template hin ra, click Add:

Hng dn s dng Cacti

-14-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

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. Use --alt-autoscale (accepting both limits, rrdtool default): Ty chn ny chp nhn c gii hn trn v gii hn di.

Logarithmic Scaling (--logarithmic)

Check vo ty chn ny nu bn mun chia trc y theo cc bc tng logarit c s 10 ( Trn tru c y bin h thng , 10 c ti p theo bi 20, 30, 40, v. v... Con trong thang logarit, 10 c ti p theo bi 100, 1. 000, 10. 000 v. v... i u nay lam cho thi loga dung r t thu n l i khi bi u din cc gi tr d liu khc nhau qu nhiu . Trong thi binh thng ba n r t kh biu din cho r cc lot d liu c tr s nh, nhng trong thi loga cc tr s nh c biu din r rng hn ) -15-

Hng dn s dng Cacti

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815
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)

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. nhngha nhn c in pha cnh tri ca th. Thng thng l n v ca d liu trn th.

Vertical Label (-vertical-label)

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 Itemv Graph Item Inputs hon thnh vic to graph template.
3.1.2. 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:

Hng dn s dng Cacti

-16-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

sau click Add ca phn Graph Template Item:

Danh sch v ngha cc bin c s dng to Graph Template Items: Tn bin Data Source ngha Ngun d liu s dng cho Item ny ca th. Chn ngun d liu ph hp trnh n tr xung. Nu khng c bt k ngun d liu no, hy chn None. Chn mu m bn mun s dng cho ngun d liu ny. N ch hin ln cho graph item kiu LINE1 LINE3, AREA,COMMENT, HRULE, VRULE, GPRINT v STACK Mt trong nhng vng kh quan trng. Ty chn ny s nh ngha cch hin th d liu ca Item trong th. C cc kiu sau: COMMENT, HRULE, VRULE, LINE1-3, Area, Stack, GPRINT, and LEGEND Bn phi thng nht hm m RRDTool s dng. Trong phn ln trng hp s dng ty chn AVERAGE. Bn cng c th s dng hm MAX, MIN hoc LAST cho cc GPRINT items. CDEF function cho php bn p dng cc hm ton hc vo tnh ton u ra ca d liu hin th trn th. tm hiu r hn v CDEF Function, bn c th tham kho link sau: -17-

Color

Graph Item Type

Consolidation Function

CDEF Function

Hng dn s dng Cacti

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

Value

GPRINT Type

Text Format

http://oss.oetiker.ch/rrdtool/tut/cdeftutorial.en.html hoc search google vi t kha:CDEF tutorial. Trng ny ch c s dng trong kiu HRULE v VRULTE ca Graph item types. Nhp bt k mt s nguyn hp l no v ng trong HRULE hoc nhp thi gian trong ngy theo nh dng HH:MM trong trng hp VRULE Nu kiu ca Graph item l GPRINT, bn c th chn kiu nh dng s m bn mun. Bn c th nhp vo vn bn m bn mun ch thch. N s c hin th vng ch thch ca th. Sau khi hon thnh cc mc trn, click Create to Graph Template Item.
3.1.3. Graph Item Inputs

thm mt graph template item, Click vo graph template c to ra:

sau click Add ca phn Graph Item Inputs:

Hng dn s dng Cacti

-18-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

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.2. Host template

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.
3.2.1. To Host template

ng nhp vi ti khon admin. Click vo tab Console. Click vo Host Templates di nhn Templates.

Hng dn s dng Cacti

-19-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

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

Nhp tn host vo, click Create:

Hng dn s dng Cacti

-20-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

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
3.2.2. 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.

4. Qun tr ngi dng:


Trong phn ny chng ta s ni v vic qun tr ngi dng. 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) 4.1. Giao din qun tr ngi dng:

vo giao din qun tr ngi dng, tab Console, click Usermanagement 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, con ngi dng guestch 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. 4.2. Thm ngi dng

Phn ny chng ta s thm ngi dng vo Cacti. Click Add phn User management trong giao din qun tr ngi dng, hin ra ca s sau:

Hng dn s dng Cacti

-21-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

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:

V chi tit chc nng ca tng phn trong vic phn quyn ny, ta s cp n phn tip theo y (phn sa ngi dng). Sau khi thit lp ht cc quyn cho ngi dng, Click Save hon thnh vic to ngi dng mi.

Hng dn s dng Cacti

-22-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

Lu : Cacti khng h tr to nhm ngi dng. V vy, nu mun to nhiu ngi dng c chc nng tng t nhau, ta cso th s dng chc nng Copy. Vic s dng chc nng ny s c cp phn di. 4.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

ngha y l tn c dng truy cp vo Cacti. Khng gii hn s lng k t trng ny. y l trng ty chn. Tn y ngi dng. N ch hin th trong giao din qun tr 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 Loginv Allow this User to Keep Custom Graph Settings.

Hng dn s dng Cacti

-23-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815
Graph Options

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

Login Options

Ch c ngi qun tr mi c php thay i thng tin ny v ngi dng C 3 ty chn ng nhp:
-

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.phpsau khi ng nhp.

Authentication Realm

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.

Tip theo chng ta s tm hiu v cc quyn c th c p dng cho ngi dng:


4.3.1. Realm Permissions

Phn ny quy nh nhng phn no ca Cacti m ngi dng c th c php truy cp. Ngi qun tr c th thit lp hay thay i cc quyn ny ca ngi dng:

Hng dn s dng Cacti

-24-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

4.3.2. Graph Permissions

Phn ny cho php iu chnh nhng th, thit b, cc templates hay cc cy m ngi dng c th xem. Cc quyn ny c iu khin bi 4 ty chn: Quyn i vi th Quyn i vi thit b Quyn i vi Graph templates Quyn i vi cy iu quan trng nht ca phn ny l nh cch sp xp cc chnh sch. u tin l l thit lp quyn ca ngi dng vi th, thit b, sau l thit lp quyn i vi Graph templates.

Hng dn s dng Cacti

-25-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

4.3.3. Graph Setting

Phn ny cho php ngi qun tr iu chnh cc ci t cch xem th cho ngi dng (ngi dng cng c th iu chnh c ty chn ny nu phn ty chn Allow this User to Keep Custom Graph Settingstrong khi to ngi dng c chn). 4.4. Cc ty chn qun tr ngi dng khc:

Trong phn ny chng ta s tm hiu cc ty chn qun tr ngi dng khc ca Cacti: o Delete o Copy o Enable o Disable o Batch Copy Nhng ty chn ny trong menu tr xung ca phn choose an actiontrong giao din qun tr ngi dng khi tick vo ngi dng (hay mt nhm ngi dng) m ta mun thc hin nhng thao tc .

4.4.1. Xa ngi dng

xa mt ngi dng hay mt vi ngi dng c nh trc, ta lm nh sau: Chn ngi dng mun xa giao din qun tr ngi dng. Sau chn Delete phn Choose an actionv click go. H thng s bt bn xc nhn li xem c ng l bn mun xa hay khng. Nu bn chn Yesth ngi dng cng vi nhng thit lp lin quan n ngi dng s b xa khi h thng

Hng dn s dng Cacti

-26-

Cng ty C Phn Dch v Vin Thng CMC (CMC TELECOM)


Tr s chnh : 273 i Cn H Ni ; Tel : 04-3722 6688; Fax: 04-3722 6868 ; Web: www.cmctelecom.vn CN ti TP.HCM: Lu 6, 65&65A ng 3/2 P.11-Q.10 TP.HCM ; Tel:08-3929 2816 ; Fax: 08-3929 2815

4.4.2. Enable v disable ngi dng

Tng t phn xa ngi dng. Khc phn Choose an actionbn chn Enable hoc chn Disable
4.4.3. Copy ngi dng

Nu bn to ra mt ngi dng vi mt lot cc ci t, ty chn v cc quyn phc tp. Bn mun to ra mt ngi dng khc vi cc quyn tng t th m khng mun lp li cc bc ci t , bn s dng chc nng sao chp ngi dng ny. Chn ngi dng mun sao chp giao din qun tr ngi dng. Sau chn Copy phn Choose an actionv click go. S hin ra hp thoi sau:

Nhp Username v Full name, chn New Realm v click yes. Ngi dng mi s c to vi quyn v cc ci t tng t ngi dng trc.
4.4.4. Copy ngi dng theo khi

hiu v chc nng ca phn ny trong Cacti, ta c v d sau: C mt ngi dng tn l NOC c quyn xem v chnh sa mt vi th trong Cacti. Ngi qun tr mun a cng cc quyn vo ngi dng A v B c trong h thng. Ta lm nh sau: Chn UserA v UserBt giao din qun tr ngi dng v chn Batch Copy phn Choose an action v click go. Cacti s a ra hp thoi :

Chn Template User( y l NOC) v click yes Hng dn s dng Cacti -27-