모니터링

2022.02.14 14:23

cacti (시스템 및 네트워크 모니터링) 설치하기

  • 비아웹 오래 전 2022.02.14 14:23 인기
  • 4,854
    0

1. 설치 환경

OS : CentOS Linux release 7.9.2009 (Core)

SELINUX : disabled

apache : 2.4.6

php : 7.2.34

MariaDB : 10.1.48

 

2. 설치하기

[root@viaweb ~]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
[root@viaweb ~]# yum -y install cacti

3. DB 설정하기

위와 같이 DB를 만들어준다.
*DB 설정
MariaDB [(none)]> create database cacti;
MariaDB [(none)]> show databases;// 확인
MariaDB [(none)]> grant all on cacti.* to master@localhost identfied by '패스워드';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;

4. 생성한 DB에 cacti data 넣어주기

[root@viaweb ~]# rpm -ql cacti | grep -i cacti.sql
/usr/share/doc/cacti-1.2.15/cacti.sql // cacti.sql 파일이 있는 경로를 나타 내준다.
 
[root@viaweb ~]# mysql -u master -p cacti </usr/share/doc/cacti-1.2.15/cacti.sql
* 확인하기
 
MariaDB [(none)]> show databases;
+---------------------------------+
│ Database │
+----------------------------------
│ cacti │
│ information_schema │
│ performance_chema │
│ test │
+---------------------------------+
 
MariaDB [(none)]> use cacti;
...............
Database changed
 
MariaDB [(cacti)]> show tables;
+---------------------------------+
│ Tables_in_cacti │
+----------------------------------
│ aggregate_graph_templates │
│ aggregate_graph_templates_graph │
│ 생략..........................
│ │
+---------------------------------+

cacti data 값 입력 후

5. 설치 파일 수정하기(db.php, cacti.conf)

* 아래의 두군데만 바꾸어 주고 저장 해준다.
[root@viaweb ~]# vi /etc/cacti/db.php
$database_usernmae ='master';
$database_password ='설정한 패스워드';
[root@viaweb ~]# vi /etc/httpd/conf.d/cacti.conf
Alias /cacti /usr/share/cacti
<Directory /usr/share/cacti/>
<IfModule mod_authz_core.c>
# httpd 2.4
Require all granted // apache 버전에 맞추어서 수정해주면 된다.
</IfModule>
<IfModule !mod_authz_core.c>
# httpd 2.2
Order deny,allow
Deny from all
Allow from localhost

6. 실행하기

http://주소/cacti 로 접속하면 다음과 같은 화면이 출력되며 기본 계정과 패스워드는 admin / admin 입니다.

기본 계정 로그인 후 패스워드 변경하고 넘어오면 다음과 같이 에러가 발생한 화면이 나온다. -에러화면1

 

에러화면 2

7. 에러 해결하기

*timezone 해결하기
[root@viaweb ~]# mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p
mysql Enter password:
Warning: Unable to load '/usr/share/zoneinfo/leapseconds'as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi'as time zone. Skipping it.
 
mariadb 로그인
MariaDB [(none)]> grant select on mysql.time_zone_name to master@localhost IDENTIFIEDBY'password';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit
 
[root@viaweb ~]# vi /etc/php.ini date.timezone = Asia/Seoul // 맨 아래에 추가해준다.
 
*DB 설정값 수정하기 // 해당 값은 테스트 서버에 적용되어 있으므로 차이가 있을 수 있습니다.
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
[mysqld]
default-time-zone='+9:00'
skip-host-cache
skip-name-resolve
lower_case_table_names=1
character-set-client-handshake=FALSE
init_connect="SET collation_connection = utf_unicode_ci"
init_connect="SET NAMES utf8mb4"
character-set-server = utf8mb4
collation-server = utf8mb4_
unicode_ci tmp_table_size =64M
join_buffer_size=64M
innodb_doublewrite =ON
innodb_flush_log_at_timeout =3
innodb_read_io_threads =32
innodb_write_io_threads =16
max_heap_table_size =200M
max_allowed_packet =16777216
innodb_buffer_pool_size =930M
innodb_additional_mem_pool_size =85M
innodb_file_format_max = Barracuda
innodb_file_format = Barracuda
innodb_large_prefix =ON
innodb_io_capacity =5000
innodb_io_capacity_max =10000
 
설정이 끝나면 MariaDB , apache 재실행 해준다.
 

디버깅 완료 후

8. 인스톨 및 인스톨 완료

디버깅 완료 후 기본값으로 설치하면 인스톨 진행중인 화면을 볼 수 있다.

 

인스톨이 끝나면 나타는 화면이며 이후 관리하고 싶은 시스템 등록 후 사용하면 된다.

 

시스템 등록후 일정시간이 지나면 그래프가 생성된 모습을 볼 수 있다.

감사합니다

서버호스팅 비아웹


  • 공유링크 복사