목요일, 5월 15, 2025
HomeLinuxubuntu Cacti install

ubuntu Cacti install

ubuntu install Cacti 0.8.8c

1.- Download Cacti from official site

Last version: Cacti 0.8.8c
WEB http://www.cacti.net/
Package: cacti-0.8.8c.tar.gz

Remeber to pre-install necessary software (snmp/rrdtool binaries)

ubuntu SNMP 설치 및 설정

apt-get install snmp snmpd rrdtool

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  fontconfig fonts-dejavu fonts-dejavu-extra libcairo2 libdatrie1 libdbi1
  libgraphite2-3 libharfbuzz0b libmysqlclient18 libpango-1.0-0
  libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 librrd4 libsensors4
  libsnmp-base libsnmp30 libthai-data libthai0 libxcb-render0 libxcb-shm0
  libxrender1 mysql-common ttf-dejavu ttf-dejavu-core ttf-dejavu-extra
Suggested packages:
  ttf-baekmuk ttf-arphic-gbsn00lp ttf-arphic-bsmi00lp ttf-arphic-gkai00mp
  ttf-arphic-bkai00mp lm-sensors snmp-mibs-downloader librrds-perl
The following NEW packages will be installed:
  fontconfig fonts-dejavu fonts-dejavu-extra libcairo2 libdatrie1 libdbi1
  libgraphite2-3 libharfbuzz0b libmysqlclient18 libpango-1.0-0
  libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 librrd4 libsensors4
  libsnmp-base libsnmp30 libthai-data libthai0 libxcb-render0 libxcb-shm0
  libxrender1 mysql-common rrdtool snmp snmpd ttf-dejavu ttf-dejavu-core
  ttf-dejavu-extra
0 upgraded, 29 newly installed, 0 to remove and 95 not upgraded.
Need to get 5,612 kB of archives.
After this operation, 22.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y

2.- Structuring Cacti

wget http://www.cacti.net/downloads/cacti-0.8.8c.tar.gz
tar -xzvf cacti-0.8.8c.tar.gz 
move cacti-0.8.8c cacti
chown -R www-data:www-data cacti/
cd cacti/

3.- Structuring DataBase

mysqladmin -u root -p create cacti
Enter password: 

Then you have to import cacti.sql (included in cacti downloaded package)

mysql -u root -p cacti <> cacti/cacti.sql
Enter password: 

4.- adduser cactiuser

adduser cactiuser

Adding user `cactiuser' ...
Adding new group `cactiuser' (1002) ...
Adding new user `cactiuser' (1001) with group `cactiuser' ...
Creating home directory `/home/cactiuser' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for cactiuser
Enter the new value, or press ENTER for the default
        Full Name []: 
        Room Number []: 
        Work Phone []: 
        Home Phone []: 
        Other []: 
Is the information correct? [Y/n]

5.- And now we have to setup permissions in mysql

mysql -uroot -p

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 50
Server version: 5.0.51a-3ubuntu5.4 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactipassword';
Query OK, 0 rows affected (0.04 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit

4.- Setup Cacti config files
Edit include/config.php with data

cd include/
vi config.php 

Edit include/config.php as follow:
$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactipassword";
$database_port = "3306";

5.- Setup CRONTAB
Edit /etc/crontab
vi /etc/crontab

Add folowing line (According to my configuration) 
*/5 * * * * cactiuser php /var/www/cacti/poller.php > /dev/null 2>&1

6.- Go to Web
Go to:
http://localhost/cacti/

You will be redirected to:
http://localhost/cacti/install/

7. cacti web UI login
cacti_login

cacti_step1

cacti_setting_paths

cacti_setting_spine

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular