Anda di halaman 1dari 5

I. Ci t trn Unbuntu 14.0.

0 tr ln:
(Nu khng c cc gi cn thit th tin hnh update, chnh sa source list v ci t cc gi epel-
release v remi-release)
1. Lamp server:
to nn mt mi trng my ch Web c kh nng cha v phn phi trang Web. Apache
c s dng hin th cc biu mng c to ra bi PHP v RRDtool.
apt-get -y install apache2 mysql-server php5 libapache2-mod-php5 dbconfig-
common libphp-adodb

/etc/init.d/apache2 start # Khi ng apache2 v mysql


/etc/init.d/mysql start

chkconfig mysql on

chkconfig apache2 on

2. RRDtools:
Mt cng c hu ch ngun m lu tr v truy xut d liu chui thi gian.
apt-get install rrdtool librrds-perl y

3. SNMP v SNMPd
theo di localhost.
apt-get -y install snmp snmpd

/etc/init.d/snmpd start # Khi ng SNMP


chkconfig snmpd on

4. Ci t database trn Mysql:


Mysql u root p

# To Database TMS;
> CREATE DATABASE tms CHARACTER SET utf8 COLLATE utf8_unicode_ci;

# To v cp quyn cho user TMS truy cp vao database TMS;


>GRANT ALL ON tms.* TO tms@localhost IDENTIFIED BY 'Password';

# Cp quyn cho user TMS truy cp vo database Mysql;


>GRANT ALL PRIVILEGES ON mysql.* TO 'tms'@'localhost' WITH GRANT OPTION;
# Sau np li gi tr phn quyn cp nht thay i;
> FLUSH PRIVILEGES;

>exit

5. Tin hnh ci t Cacti:


cd /var/www/ # Ni cha th mc Cacti
wget http://www.cacti.net/downloads/cacti-XX.tar.gz # Ti file Cacti v
tar zxvf cacti-XX.tar.gz
mv /var/www/cacti-XX/ /var/www/tms # Chuyn Cacti sang tn TMS
chmod R 777 /var/www/tms/log # Cp quyn chnh sa cho cc tp tin
chmod R 777 /var/www/tms/rra
chmod R 777 /var/www/tms/plugins
mysql -u root -p tms < /var/www/tms/cacti.sql # y file cacti.sql vo
database tms trn Mysql, nhp Password ca
Database Root.
/etc/init.d/mysql restart

Vo Apache2 thit lp a Cacti ra ngoi Web :


To file tms.conf trong th mc /etc/apache2/conf-available, sau in ni dung sau:
Alias /tms /var/www/tms/

<Directory /var/www/tms/>

Options +FollowSymLinks

AllowOverride None

Order allow, deny

Allow from all

</Directory>

6. Thit lp Crontab:
Crontab s gip d liu snmp nhn c trn Cacti y ln web ch hnh nh trong mi
khong thi gian.
To tp tin: /etc/cron.d/tms
*/1 * * * * root php /var/www/tms/poller.php 2>&1 >/dev/null >>
/var/www/tms/log/poller.log
y, */1 ch thi gian mi 1 pht PHP s xy dng Graphs da trn poller thu thp c,
2>&1 trng thi log khi xy dng s c lu trn file poller.log, nhng phn t khng
thuc h thng s b loi b, khng ghi trn n nh lnh >/dev/null
7. ng nhp :
M trnh duyt v g http://ip-address/cacti
ng nhp username v password l admin/admin.

II. Ci t trn RebHat-CentOS 6.4 tr ln:


1. Ci t Lamp server:
yum install httpd httpd-devel mysql mysql-server php-mysql php-pear php-
common php-gd php-devel php php-mbstring php-cli php-mysql php-snmp -y

2. Ci t Net-snmp
yum install net-snmp-utils net-snmp-libs php-pear-Net-SMTP y

3. Ci t RRDtool:
yum install rrdtool -y

Sau khi ci t tt c cc phn mm trn, cn phi khi ng tt c cc dch v nh:


/etc/init.d/httpd start

/etc/init.d/mysqld start

/etc/init.d/snmpd start

chkconfig httpd on

chkconfig mysqld on

chkconfig snmpd on

4. Ci t Database Mysql v Cacti ging nh trn Ubuntu


Cu hnh Apache server

To tp tin /etc/httpd/conf.d/tms.conf sau thm cc dng sau vo:


Alias /tms /var/www/tms/

<Directory /var/www/tms/>

<IfModule mod_authz_core.c>

# httpd 2.4

Require host localhost

</IfModule>

<IfModule !mod_authz_core.c>
# httpd 2.2

Order deny,allow

Deny from all

Allow from 192.168.1.0/24

</IfModule>

</Directory>

Sau khi ng li dch v Apache


/etc/init.d/httpd restart

5. Thit lp Crontab:
Vo tp tin /etc/crontab thm dng sau :
*/1 * * * * php /var/www/tms/poller.php 2>&1 >/dev/null >>
/var/www/tms/log/poller.log

6. ng nhp:
M trnh duyt v g http://ip-address/cacti
ng nhp username v password l admin/admin.

Ch : Khi to ti khon trn Database Mysql phi trng khp ti khon trong cc tp
tin config.php v global.php ca Cacti :
#===================================

$database_type = "mysql";

$database_default = "tms";

$database_hostname = "localhost";

$database_username = "tms";

$database_password = "Password of UserTMS";

$database_port = "3306";

$database_ssl = false;

#===================================

M Port HTTP v DNS trn Firewall ca cc h iu hnh nu ng nhp bn ngoi my


ch.
cc my Client cn gim st, cn ci t gi SNMP v thit lp rocommunity hay
rwcommunity giao tip vi Server

Anda mungkin juga menyukai