# Cacti 설치 메뉴얼

<table border="1" id="bkmrk-perplexity%EC%97%90%EC%84%9C-%EC%83%9D%EC%84%B1%ED%95%9C-ai%EC%9D%B4" style="border-collapse: collapse; width: 100%; height: 60.25px;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr style="height: 30.125px;"><td style="height: 30.125px;">[![image.png](http://wiki.igoni.kr/uploads/images/gallery/2026-02/scaled-1680-/F6Kimage.png)](http://wiki.igoni.kr/uploads/images/gallery/2026-02/F6Kimage.png)

</td></tr><tr style="height: 30.125px;"><td class="align-right" style="height: 30.125px;">perplexity에서 생성한 AI이미지</td></tr></tbody></table>

## 개요

1. snmp를 이용해 리소스 수집 후 rrdtool을 이용해 그래프화한 오픈소스 (license : GPLv2)
2. simple architecture ( <span class="wikiexternallink">[https://docs.cacti.net/manual:088:2\_basics.0\_principles\_of\_operation#basics](https://docs.cacti.net/manual:088:2_basics.0_principles_of_operation#basics)</span> )
3. Cacti버전 : 0.8.8h가 마지막 릴리즈(상용설치 버전), 2017년 1월부터 1.x 버전이 릴리즈 되고 있으며,  
    1.x버전 부터는 기능추가 및 UI 개선으로 요구하는 리소스 값이 매우 커짐 (ex. php max\_execution\_time = 60에서 max\_execution\_time = 3600)  
    커진 리소스 값만큼 활용도가 있을것으로 판단되지 않아 1.x은 당분간 구축계획 없음

## 제한사항

1. cacti spine을 이용하면 poller시 성능향상에 도움이 되나, 리소스 수집에 문제가 생길만큼 많은 정보를 수집하지 않아 작성하지 않았음
2. Mysql : 상용환경에서는 별도버전으로 내려받아 설치하나, 상용환경 DB설치 메뉴얼은 별도 문서로 작성되어 있기 때문에 포함하지 않음
3. Apache / Mysql : 어플리케이션별 보안설정이 필요하나 고객사별로 진단기준이 다르고, 설치절차에 영향받는게 아니라서 본문서에 포함하지 않음
4. Apache / php : 소스파일을 내려받아 컴파일 하는 절차는 본 문서에서 다루지 않고, 패키지 형태로 내려받아 설치하였음
5. OS는 Centos 7버전을 기준으로 작성하였고, Centos6버전에서 실행할 경우 "Cen6 =" 으로 추가 코멘트 작성하였음
6. Cacti 구성은 이중화를 고려하지 않았음

## 경로정보

1. Apache : /usr/bin
2. Apache Config : /etc/httpd/conf/
3. Cacti webapp : /svc/cacti/public\_html/

## 작업절차

1. 어플리케이션 설치 ```shell
    $> yum install rrdtool httpd net-snmp net-snmp-utils net-snmp-devel php-gd php php-snmp gd-devel php-mysql php-pdo php-mysqli  mariadb-server mariadb-libs -y
    ```

- Cen6 = mariadb가 아닌 mysql로 변경하여 실행하면 됨}}}

1. DB구성 (database 생성 / 계정생성) ```shell
    # mysql_install_db --force --user=mysql
    Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
    
    # systemctl start mariadb
    * Cen6 = /etc/init.d/mysql start 으로 실행
    ```
    
    ```SQL
    # mysql -u root
    MariaDB [(none)]> create database cacti;
    Query OK, 1 row affected (0.001 sec)
    MariaDB [(none)]> grant all privileges on cacti.* to 'cacti'@'localhost' identified by '{cacti패스워드}';
    Query OK, 0 rows affected (0.000 sec)
    MariaDB [(none)]> flush privileges;
    Query OK, 0 rows affected (0.000 sec)
    ```
2. DB접근 테스트 ```shell
    mysql -u cacti -p
    Enter password: {cacti패스워드 입력}
    ```
    
    ```SQL
    MariaDB [(none)]> use cacti;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Database changed
    MariaDB [cacti]>
    ```
3. Cacti용 웹서버 구성(파일 생성하면 됨) ```shell
    # cat /etc/httpd/conf.d/cacti.conf
    Listen 8800
    <Virtualhost *:8800>
     Documentroot "/svc/cacti/public_html"
     Customlog "logs/cacti-access.log" combined
     errorlog "logs/cacti-error.log"
    </Virtualhost>
    ```
4. Apache 접근 허용 ```shell
    # vi /etc/httpd/conf/httpd.conf
    ...
    <Directory ></Directory>
        AllowOverride none
        Require all denied <-- 주석처리 혹은 삭제하면 됨
    </Directory>
    ...
    * Cen6 = Deny from all 으로 대체 표기
    ```
5. apache name설정 (Option) ```shell
    # vi /etc/httpd/conf/httpd.conf
    ...
    ServerName localhost
    ...
    ```
6. php 설정 ```shell
    #vi /etc/php.ini
    ...
    ;date.timezone = --> timezone= Asia/Seoul 로 변경
    ```
7. Cacti webapp 다운로드 후 설치 ```shell
    # mkdir /svc/cacti/
    # wget 'https://www.cacti.net/downloads/cacti-0.8.8h.tar.gz'
    # tar -zxvf cacti-0.8.8h.tar.gz
    # mv cacti-0.8.8h /svc/cacti/public_html
    # cd /svc/cacti/public_html
    ```
8. Cacti DB 입력 ```shell
    # mysql -u cacti -p cacti < cacti.sql
    Enter password: {cacti패스워드 입력}}}}
    * Cacti DB 데이터 입력 중 2211번줄 rows 테이블 에러발생시 조치방법 (2217번에 명시된 rows 테이블이름 변경 필요)
    ```
    
    <div><div class="box"><div class="code">  
    rows int(12) NOT NULL default '600', --&gt; ₩rows₩ int(12) NOT NULL default '600', 으로 변경</div></div></div>
9. DB 설정 (아래 내용으로 설정되면 됨) ```shell
    $> vi /svc/cacti/public_html/include/config.php
    ...
    database_default=데이터베이스이름
    database_hostname=DB서버IP
    database_username = 데이터베이스 접근 사용자이름
    database_password = 접근 사용자 패스워드
    database_port = DB포트정보
    database_ssl = DB접속시 SSL 사용여부
    url_path = 브라우져 접속 경로 (http://127.0.0.1/cacti/으로 접속해야 하는 경우 "/cacti/" 로 설정해두면 됨
    ```
10. Apache 설정값 이상여부 확인 후 서비스 실행 ```shell
    #apachectl configtest
    OK
    # systemctl start httpd;systemctl enable httpd
    Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
    * Cent6 = /etc/init.d/httpd start;chkconfig httpd on 으로 사용
    ```
11. 프로세스 및 포트 정보 실행여부 확인 ```shell
    $> ps -ef | grep http
    root     32439     1  0 17:54 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
    apache   32441 32439  0 17:54 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
    apache   32442 32439  0 17:54 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
    apache   32443 32439  0 17:54 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
    apache   32444 32439  0 17:54 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
    apache   32445 32439  0 17:54 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
    root     32512 20163  0 17:55 pts/0    00:00:00 grep --color=auto http
    
    $> netstat -antp | grep httpd
    tcp6       0      0 :::8800                 :::*                    LISTEN      32677/httpd
    ```
12. 웹브라우저에서 접속 URL : http://{{서버IP}}:8800
13. select type of install 에 new install 선택 후 Next
14. 경로정보중 오류있는 설정값 있는지 확인 후 없으면 Finish
15. 최초 로그인 정보는 user : admin / password : admin
16. 패스워드 변경 진행
17. Poller 실행 및 적용 ```shell
    $> /bin/php /svc/cacti/public_html/poller.php
    ...
    $> echo "* * * * * /bin/php /svc/cacti/public_html/poller.php > /dev/null" >> /var/spool/cron/root
    ```