Académique Documents
Professionnel Documents
Culture Documents
Ci MySQL Trch dn: #yum -y install mysql-server mysql Cu hnh MySQL database cho Cacti ci t password cho mysql root user Trch dn: #mysqladmin -u root password NEWPASSWORD to database cho Cacti Trch dn: # mysql -u root -p -e 'create database cacti' To v cp quyn cho user cacti trn database cacti vi password l 123456 Trch dn:
# mysql -u root -p mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY '123456'; mysql> FLUSH privileges; mysql> exit Ci t SNMP Trch dn: #yum install net-snmp-utils php-snmp net-snmp-libs Cu hnh snmp Trch dn: #vi /etc/snmp/snmpd.conf Bn thay i v thm ni dung sau vo SNMP (xem snmpd.conf bit thm chi tit) Trch dn: rocommunity 123456 syslocation "Asterisk Vietnam" proc mountd proc ntalkd 4 disk / 10000 load 12 14 14 Bn lu file snmpd.conf v ng li, sau start snmpd v bt snmpd service: Trch dn: #/etc/init.d/snmpd start #chkconfig snmpd on Ci t rrdtool Trch dn: #wget http://packages.sw.be/rrdtool/rrdtool-1 ... f.i386.rpm #wget http://packages.sw.be/rrdtool/perl-rrdt ... f.i386.rpm #wget http://packages.sw.be/rrdtool/rrdtool-d ... f.i386.rpm rpm -ivh rrdtool-1.2.18-1.el5.rf.i386.rpm perl-rrdtool-1.2.18-1.el5.rf.i386.rpm rrdtool-devel-1.2.181.el5.rf.i386.rpm Ci t CACTI Trch dn: #wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz #tar -zvxf cacti-0.8.7g.tar.gz -C /var/www/html/ #cd /var/www/html/ #mv cacti-0.8.7g cacti Hoc bn c th ci bng yum Trch dn:
www.asterisk.vn | Hng dn ci t cu hnh gim st h thng mng bng Cacti 3
yum -y install cacti To MySQL database cho cacti vi database name l cacti Trch dn: #mysqladmin --user=root --password=password create cacti Import cacti database mc nh t cacti.sql trong th mc cacti Trch dn: #mysql --user=root --password=password cacti < cacti.sql Edit li ni dung file include/config.php cho ng vi username v database ca h thng ca bn. Trch dn: #cd /var/www/html/cacti/include #vi config.php Thay i ni dung trong file config.php : Trch dn: $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cacti"; $database_password = "123456"; Bn add thm dng sau y vo /etc/crontab Trch dn: #vi /etc/crontab thm ni dung nh sau : */5 * * * * /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1
Sau khi ng nhp thnh cng web cacti s c nh sau , v theo hng dn bn ln lt thc hin cc bc: + Create devices for network + create graphs for your new devices + view your new graphs
Bc 1 - create devices for network Bn chn menu Devices v bm chn nt add thm 1 thit b cn gim st vo d liu Cacti
- bn phi cu hnh snmp trn windows xp : + Start -> Run -> services.msc enter -> chn properties cho snmp service.
- trn web cacti Add New device l mt my trm Windows XP + Description : name m bn cn th hin ca host + Hostname : ip hoc hostname ca my trm + Host template : c th chn None hoc template c sn v d y l windows xp. www.asterisk.vn | Hng dn ci t cu hnh gim st h thng mng bng Cacti 6
+ Downed Device Detection : phng php c cacti s dng ly thng tin l SNMP + SNMP version : version 1 + SNMP Community : 123456 ( c setup trn SNMP Service ca host) Sau khi hon tt cc bc trn bn chn Save hon tt vic Add thm device mi.
- Bn chn nhng data m bn cn monitor v add vo danh sch, sau bm chn Save hon tt qu trnh add new devices.
- Sau khi to xong New Device chng ta bm chn *Create Graphs for this Host to graphic cho nhng www.asterisk.vn | Hng dn ci t cu hnh gim st h thng mng bng Cacti 7
data thu thp c ca device ny, chng ta ch nn chn nhng d liu thng s thit b no m chng ta cn quan tm to Graph cho n m thi.
Chng ta va hon thnh qu trnh add my trm windows xp vo danh sch thit b thu thp ca Cacti.
Add thm mt thit b Switch Cisco 2950 + cu hnh snmp trn Cisco 2950 Trch dn: cisco#configure terminal s dng cu lnh sau enable Read-only vi community string l public cisco(config)#snmp-server community public RO + download template ca cisco 2950 :
www.asterisk.vn | Hng dn ci t cu hnh gim st h thng mng bng Cacti 8
Sau khi c cc devices ca h thng mng ca bn, bn cn xy dng s hnh tree th hin tt c cc d liu thu thp h thng li cho d qun l - Trong ca s web Console chng ta chn mc Graphic Trees xy dng s hnh cy cho cc d liu Graph h thng ca chng ta. + tu theo tnh nng v cch thit k h thng ca bn m bn quyt nh xy dng s Trees cho h thng ca bn nh th no, y CMT ch v d demon mt h thng bao gm cc my trm Windows, cc my ch linux, cc thit b mng, c xy dng s hnh tree nh sau:
Do Cacti monitor c rt nhiu h thng thng qua SNMP, chng ta s ch nu 1 s Script v Template tham kho cho cc h thng thng dng : Apache stats Template
Host Template XML for cacti 087b and upCorrects a Problem with Thread Graph Cacti 0.87b Host Template Webserver Apache gzipped perl script to be placed at <path_cacti>/scripts/**** ws apachestats
10
The Webserber Host Template XML Import this one at least using Version cacti 0.8.6g Cacti host template webserver apache BIND 9 Statistics Template Bind 9.7 template Ci t: 1) Unzip 2) Import XML file to cacti 3) add in snmpd.conf on bind server this: extend .1.3.6.1.4.1.18689.0.1 dnscache-stats /root/bin/runstats.sh 4) copy runstats.sh and **** to /root/bin on bind server, make them executable and make sure named.stats is in /var/cache/bind (this one I changed to other directory, editing runstats.sh) 5) copy bind-stats.sh to <path_cacti>/scripts/
IIS - WWW Graph templates Connection Graph template + dependencies cacti graph template iis connection statistics Session Graph template + dependencies cacti graph template iis attemps statistics Network Graph template + dependencies cacti graph template iis network statistics Request Graph template + dependencies cacti graph template iis request statistics
11
12
Download
13