[monitoring] Cacti 를 이용한 Server 모니터링

FreeBSD Cacti 설치

APM 설치가 진행 되어 있어야 합니다.

apm 설치의 경우 (freebsd_apm설치) 를 참고 하시면 됩니다.

(가상화 환경에서 설치 한다고 하면 2Core Cpu 에 메모리 4G 정도 추가 하여 설치 하시기 바랍니다. 1Core / 메모리 1G 시 3시간 이상 걸립니다.)

pkg install cacti 로 설치 하여도 됩니다.

ports 설치시 cacti 에 필요한 패키지를 한번에 설치 할수 있는 장점이 있지만 설치시간이 오래 걸리는 단점도 있습니다.

 

Cacti 설치

root@bsd11:~ # whereis cacti
cacti: /usr/ports/net-mgmt/cacti
root@bsd11:~ # cd /usr/ports/net-mgmt/cacti && make install clean
===>  License GPLv2 accepted by the user
===>   cacti-1.1.27 depends on file: /usr/local/sbin/pkg - found
=> cacti-1.1.27.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://www.cacti.net/downloads/cacti-1.1.27.tar.gz
cacti-1.1.27.tar.gz                            32% of 8737 kB   24 kBps 03m49s

패키지 다운로드후 별도의 체크 없이 OK 를 눌러 설치를 진행 합니다.

(추가적으로 같이 설치될 패키가 있을경우 체크 하여 설치 하여도 됩니다.)

 

설치완료후 메세지

Cacti is now installed. If you install it for the first time,
you may have to follow this steps to make it work correctly:

1. Create the MySQL database, a cacti user, and initialize:
   a) CREATE DATABASE `cacti`;
   b) Create a mysql user/password for cacti:
      CREATE USER 'cacti'@'localhost' IDENTIFIED BY 'password';
      FLUSH PRIVILEGES;
   c) Add GRANTS:
      GRANT ALL ON `cacti`.* TO 'cacti'@'localhost';
      GRANT SELECT ON `mysql`.`time_zone_name` TO 'cacti'@'localhost';
      FLUSH PRIVILEGES;
   d) Import the default cacti database:
      mysql --database=cacti -ucacti -p < /usr/local/share/cacti/cacti.sql

   If you haven't already imported your MySQL timezone data, you need to do this:
      mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

 NOTE:
   * Cacti does not LOCK TABLES.

2. Edit /usr/local/share/cacti/include/config.php from the template
   config.php.orig.

   PHP requires the time zone to be explicitly set rather that rely on
   the system time zone, otherwise poller complains. I added the
   following line to my config.php:

   date_default_timezone_set('America/Los_Angeles');

3. Add the following line to cron for cacti:
*/5 * * * * /usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null 2>&1

4. Example Apache 2.4 configuration:
   (This assumes that you have installed a working PHP Apache install, e.g. with mod_php)


   <FilesMatch "\.php$">
       SetHandler application/x-httpd-php
   </FilesMatch>
   <FilesMatch "\.phps$">
       SetHandler application/x-httpd-php-source
   </FilesMatch>

   DirectoryIndex index.php

   DocumentRoot "/usr/local/share/cacti"

   Alias /cacti "/usr/local/share/cacti/"
   Alias /Cacti "/usr/local/share/cacti/"

   <Directory "/usr/local/share/cacti">
      Require all granted
      AllowOverride None
      Order Allow,deny
      Allow from all
   </Directory>

5. Open a Cacti login page in your web browser and follow the install instructions.


If you update cacti, open a login page and an updating process will
start automatically.

NOTEs as of 10Aug2014:

1) Cacti now better supports hier(7)

   a) Cacti log files are now found under /var/log/cacti where you can
      manage them using newsyslog.
   b) Cacti RRD files are now found under /var/db/cacti/rra.

   If you have an existing Cacti installation these paths are also
   found in Cacti's SQL database and MUST be updated. These two SQL
   commands should do the trick:

   UPDATE settings SET value='/var/log/cacti/log' \
     WHERE name='path_cactilog';

   UPDATE poller_item SET rrd_path=\
     REPLACE(rrd_path,'/usr/local/share/cacti/rra','/var/db/cacti/rra') \
     WHERE rrd_path REGEXP '^/usr/local/share/cacti/rra';

2) The PERL paths in the Cacti PERL scripts have been updated to
   /usr/local/bin.

Other Erratas:
   1) Mount linprocfs in /compat/linux/proc will allow most scripts to work.
   2) This package does not install a MySQL server in case you wish to use an
      external MySQL server.  Install a package such as mysql57-server if you
      require a local server.
=======================================================================

===>  Cleaning for rrdtool-1.7.0_1
===>  Cleaning for intltool-0.51.0_1
===>  Cleaning for p5-XML-Parser-2.44
===>  Cleaning for freetype2-2.8_1
===>  Cleaning for png-1.6.34
===>  Cleaning for cairo-1.14.8_1,2
===>  Cleaning for xcb-util-renderutil-0.3.9_1
===>  Cleaning for xorg-macros-1.19.1
===>  Cleaning for libxcb-1.12_2
===>  Cleaning for check-0.12.0
===>  Cleaning for xcb-proto-1.12
===>  Cleaning for libpthread-stubs-0.4
===>  Cleaning for libxslt-1.1.29_1
===>  Cleaning for libgcrypt-1.8.1
===>  Cleaning for libgpg-error-1.27
===>  Cleaning for libXau-1.0.8_3
===>  Cleaning for xproto-7.0.31
===>  Cleaning for libXdmcp-1.1.2
===>  Cleaning for xcb-util-0.4.0_2,1
===>  Cleaning for mesa-libs-17.2.4
===>  Cleaning for llvm40-4.0.1_3
===>  Cleaning for binutils-2.28,1
===>  Cleaning for gmp-6.1.2
===>  Cleaning for mpfr-3.1.6
===>  Cleaning for swig30-3.0.12
===>  Cleaning for lua52-5.2.4
===>  Cleaning for py27-enum34-1.1.6
===>  Cleaning for ninja-1.8.2,2
===>  Cleaning for dri2proto-2.8
===>  Cleaning for dri3proto-1.0
===>  Cleaning for glproto-1.4.17
===>  Cleaning for presentproto-1.1
===>  Cleaning for libX11-1.6.5,1
===>  Cleaning for bigreqsproto-1.1.2
===>  Cleaning for xcmiscproto-1.2.2
===>  Cleaning for xextproto-7.3.0
===>  Cleaning for xtrans-1.3.5
===>  Cleaning for kbproto-1.0.7
===>  Cleaning for inputproto-2.3.2
===>  Cleaning for xf86bigfontproto-1.2.0
===>  Cleaning for libXdamage-1.1.4_3
===>  Cleaning for damageproto-1.2.1
===>  Cleaning for fixesproto-5.0
===>  Cleaning for libXfixes-5.0.3
===>  Cleaning for libXext-1.3.3_1,1
===>  Cleaning for libxshmfence-1.2_2
===>  Cleaning for libXxf86vm-1.1.4_1
===>  Cleaning for xf86vidmodeproto-2.3.1
===>  Cleaning for libdrm-2.4.88,1
===>  Cleaning for libpciaccess-0.13.5
===>  Cleaning for pciids-20171011
===>  Cleaning for libunwind-20170113_1
===>  Cleaning for pixman-0.34.0
===>  Cleaning for libXrender-0.9.10
===>  Cleaning for renderproto-0.11.1
===>  Cleaning for fontconfig-2.12.1,1
===>  Cleaning for glib-2.50.2_7,1
===>  Cleaning for pango-1.40.6
===>  Cleaning for gobject-introspection-1.50.0,1
===>  Cleaning for libXft-2.3.2_1
===>  Cleaning for harfbuzz-1.5.1_1
===>  Cleaning for graphite2-1.3.10
===>  Cleaning for xorg-fonts-truetype-7.7_1
===>  Cleaning for font-bh-ttf-1.0.3_3
===>  Cleaning for mkfontdir-1.0.7
===>  Cleaning for mkfontscale-1.1.2
===>  Cleaning for libfontenc-1.1.3_1
===>  Cleaning for bdftopcf-1.0.5
===>  Cleaning for libXfont-1.5.2,2
===>  Cleaning for fontsproto-2.1.3,1
===>  Cleaning for font-misc-meltho-1.0.3_3
===>  Cleaning for font-misc-ethiopic-1.0.3_3
===>  Cleaning for encodings-1.0.4_3,1
===>  Cleaning for font-util-1.3.1
===>  Cleaning for dejavu-2.37
===>  Cleaning for php71-ctype-7.1.11
===>  Cleaning for php71-filter-7.1.11
===>  Cleaning for php71-gd-7.1.11
===>  Cleaning for libXpm-3.5.12
===>  Cleaning for libXt-1.1.5,1
===>  Cleaning for libSM-1.2.2_3,1
===>  Cleaning for libICE-1.0.9_1,1
===>  Cleaning for jpeg-turbo-1.5.2
===>  Cleaning for nasm-2.13.01,1
===>  Cleaning for php71-gettext-7.1.11
===>  Cleaning for php71-gmp-7.1.11
===>  Cleaning for php71-hash-7.1.11
===>  Cleaning for php71-json-7.1.11
===>  Cleaning for php71-ldap-7.1.11
===>  Cleaning for openldap-client-2.4.45
===>  Cleaning for php71-mbstring-7.1.11
===>  Cleaning for oniguruma6-6.6.1
===>  Cleaning for php71-openssl-7.1.11
===>  Cleaning for php71-pdo-7.1.11
===>  Cleaning for php71-pdo_mysql-7.1.11
===>  Cleaning for php71-posix-7.1.11
===>  Cleaning for php71-session-7.1.11
===>  Cleaning for php71-simplexml-7.1.11
===>  Cleaning for php71-sockets-7.1.11
===>  Cleaning for php71-snmp-7.1.11
===>  Cleaning for net-snmp-5.7.3_17
===>  Cleaning for php71-xml-7.1.11
===>  Cleaning for php71-zlib-7.1.11
===>  Cleaning for cacti-1.1.27
root@bsd11:/usr/ports/net-mgmt/cacti #

 

db 생성

root@bsd11:~ #
root@bsd11:~ # mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.2.10-MariaDB-log FreeBSD Ports

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database cacti;
Query OK, 1 row affected (0.01 sec)

MariaDB [(none)]> use mysql;
Database changed
MariaDB [mysql]> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.01 sec)

MariaDB [mysql]> FLUSH privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> quit
Bye
root@bsd11:~ #

GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY ‘password’; <– password 부분은 별도의 패스워드로 수정합니다. 

 

cacti.sql 파일을 import 합니다.

root@bsd11:~ # mysql -u root -p cacti < /usr/local/share/cacti/cacti.sql
Enter password:
root@bsd11:~ #

 

php timezone 수정 

root@bsd11:~ # vi /usr/local/etc/php.ini
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Asia/Seoul

 

cacti 설정파일 카피 및 수정 

root@bsd11:~ # cp /usr/local/share/cacti/include/config.php.sample /usr/local/share/cacti/include/config.php
root@bsd11:~ # vi /usr/local/share/cacti/include/config.php

/* make sure these values reflect your actual database/host/user/password */

$database_type     = 'mysql';
$database_default  = 'cacti';
$database_hostname = 'localhost';
$database_username = 'cacti';
$database_password = 'password';
$database_port     = '3306';
$database_ssl      = false;

(설정 내용은 cactiuser 에서 mariadb 에서 생성한 cacti 로 변경 password 의 경우 설정한 password 로 변경 하시면 됩니다.)

 

/etc/rc.conf 파일수정

root@bsd11:~ # vi /etc/rc.conf
linux_enable="YES"
snmpd_enable="YES"
snmptrapd_enable="YES"

(linux_enable 의 경우 rc.conf 에 추가후 리부팅이 필요 합니다. cacti 의 경우 snmpd 를 사용합니다.)

 

/usr/local/share/snmp/snmpd.conf 설정

root@bsd11:~ # cp /usr/local/share/snmp/snmpd.conf.example /usr/local/share/snmp/snmpd.conf
root@bsd11:~ # vi /usr/local/share/snmp/snmpd.conf
#trap2sink    localhost public    <-- 주석 제거
#rocommunity public  localhost    <-- 주석 제거

(snmpd 보안설정의 경우에는 차후 설명하도록 하겠습니다.)

 

/etc/crontab 설정

root@bsd11:~ # vi /etc/crontab
# Adjust the time zone if the CMOS clock keeps local time, as opposed to
# UTC time.  See adjkerntz(8) for details.
1,31    0-5     *       *       *       root    adjkerntz -a
*/5 * * * * cacti /usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null 2>&1

 

/usr/local/etc/apache24/httpd.conf 설정

root@bsd11:~ # vi /usr/local/etc/apache24/httpd.conf

#<Directory />
#    AllowOverride none
#    Require all denied
#</Directory>

<Directory />
    AllowOverride none
    Order deny,allow
    Deny from all
</Directory>

Alias /cacti /usr/local/share/cacti
<Directory "/usr/local/share/cacti">
AllowOverride None
Order Allow,deny
Allow from all
</Directory>

(기존 Directory 라인은 주석처리 하며 아래 내용으로 붙여넣기를 합니다.)

 

/usr/local/etc/my.cnf 설정

root@bsd11:~ # vi /usr/local/etc/my.cnf
### 아래 내용 추가 ###
max_heap_table_size             = 99M
tmp_table_size                  = 64M
join_buffer_size                = 64M
innodb_doublewrite              = OFF
innodb_flush_log_at_timeout     = 3
innodb_read_io_threads          = 32
innodb_write_io_threads         = 16


(버전에 따라 일부 내용은 수정을 해야 할수도 있습니다. 테스트 머신의 경우 Mariadb102 Version 입니다.)

 

System Rebooting 

root@bsd11:~ # init 6

(설정내용 적용및 linux emulator 설치를 위하여 시스템 리부팅을 진행 합니다.)

 

linux 호환 모듈 확인

root@bsd11:~ # kldstat
Id Refs Address            Size     Name
 1   16 0xffffffff80200000 1f67a88  kernel
 2    1 0xffffffff82219000 2986     uhid.ko
 3    1 0xffffffff8221c000 42864    linux.ko
 4    2 0xffffffff8225f000 7b0f     linux_common.ko
 5    1 0xffffffff82267000 3c93f    linux64.ko
root@bsd11:~ #

 

linux emulator 설치

root@bsd11:~ # whereis linux_base-c7
linux_base-c7: /usr/ports/emulators/linux_base-c7
root@bsd11:~ # cd /usr/ports/emulators/linux_base-c7 && make install clean

Ok 를 선택하여 설치를 진행 합니다.

 

설치완료후 메세지

Installing linux_base-c7-7.4.1708_2...
Some programs need linprocfs mounted on /compat/linux/proc.  Add the
following line to /etc/fstab:

linprocfs   /compat/linux/proc  linprocfs       rw      0       0

Then run "mount /compat/linux/proc".

Some programs need linsysfs mounted on /compat/linux/sys.  Add the
following line to /etc/fstab:

linsysfs    /compat/linux/sys   linsysfs        rw      0       0

Then run "mount /compat/linux/sys".

Some programs need tmpfs mounted on /compat/linux/dev/shm.  Add the
following line to /etc/fstab:

tmpfs    /compat/linux/dev/shm  tmpfs   rw,mode=1777    0       0

Then run "mount /compat/linux/dev/shm".

===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/compat/linux/usr/lib64/libgio-2.0.so.0.5000.3
/compat/linux/usr/lib64/libdb-4.7.so
/compat/linux/usr/lib64/libdb_cxx-4.7.so
/compat/linux/usr/lib/libresolv-2.17.so
/compat/linux/usr/lib/libgssrpc.so.4.2
/compat/linux/usr/lib/libdb-5.3.so
/compat/linux/usr/lib/libdb-4.7.so
/compat/linux/usr/lib64/libselinux.so.1
/compat/linux/usr/libexec/gam_server
/compat/linux/usr/lib64/libgssrpc.so.4.2
/compat/linux/usr/lib/libselinux.so.1
/compat/linux/usr/lib/libgio-2.0.so.0.5000.3
/compat/linux/usr/lib64/libresolv-2.17.so
/compat/linux/usr/lib/libdb_cxx-4.7.so
/compat/linux/usr/lib64/libdb-5.3.so

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.
===>  Cleaning for linux_base-c7-7.4.1708_2
root@bsd11:/usr/ports/emulators/linux_base-c7 #

 

/etc/fstab 수정

root@bsd11:~ #
root@bsd11:~ # vi /etc/fstab


linprocfs   /compat/linux/proc  linprocfs       rw      0       0
linsysfs    /compat/linux/sys   linsysfs        rw      0       0
tmpfs    /compat/linux/dev/shm  tmpfs   rw,mode=1777    0       0

root@bsd11:~ # mount -a
root@bsd11:~ # df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/da0s1a     18G    6.7G     10G    40%    /
devfs          1.0K    1.0K      0B   100%    /dev
linprocfs      4.0K    4.0K      0B   100%    /compat/linux/proc
linsysfs       4.0K    4.0K      0B   100%    /compat/linux/sys
tmpfs          4.2G    4.0K    4.2G     0%    /compat/linux/dev/shm
root@bsd11:~ #

fstab 수정후 mount 를 진행 합니다.

df -h 명령어로 정상적으로 마운트가 되었는지 확인 합니다.

 

cacti 디렉토리 권한 설정

root@bsd11:~ # chown -R www:www /usr/local/share/cacti/resource/
root@bsd11:~ # chown -R www:www /usr/local/share/cacti/scripts/
root@bsd11:~ # chown -R www:www /usr/local/share/cacti/cache/boost/
root@bsd11:~ # chown -R www:www /usr/local/share/cacti/cache/mibcache/
root@bsd11:~ # chown -R www:www /usr/local/share/cacti/cache/realtime/
root@bsd11:~ # chown -R www:www /usr/local/share/cacti/cache/spikekill/
root@bsd11:~ # mkdir /usr/local/share/cacti/log
root@bsd11:~ # chown -R www:www /usr/local/share/cacti/log/

 

Cacti 사용을 위한 설치 및 설정 작업을 모두 완료 하였습니다.

웹브라우저로 접속후 설정을 진행 합니다.

ex) http://192.168.0.100/cacti

Accept GPL License Agrement 를 체크 하고 Next 를 눌러 설정을 진행 합니다.

 

ERROR 구문및 권장 설정값을 확인 합니다.

 

 

 

확인내용

ERROR: Your Cacti database login account does not have access to the MySQL TimeZone database. Please provide the Cacti database account “select” access to the “time_zone_name” table in the “mysql” database, and populate MySQL’s TimeZone information before proceeding.ERROR: Your Cacti database login account does not have access to the MySQL TimeZone database. Please provide the Cacti database account “select” access to the “time_zone_name” table in the “mysql” database, and populate MySQL’s TimeZone information before proceeding.

Cacti 데이터베이스 로그인 계정의 MySQL TimeZone 데이터베이스 액세스 문제

 

root@bsd11:~ # mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
Enter password:
root@bsd11:~ # cd /usr/local/share/cacti/cli/
root@bsd11:/usr/local/share/cacti/cli # php repair_database.php --force
Repairing All Cacti Database Tables
Repairing Table -> 'aggregate_graph_templates' Successful
Repairing Table -> 'aggregate_graph_templates_graph' Successful
Repairing Table -> 'aggregate_graph_templates_item' Successful
Repairing Table -> 'aggregate_graphs' Successful
Repairing Table -> 'aggregate_graphs_graph_item' Successful
Repairing Table -> 'aggregate_graphs_items' Successful
Repairing Table -> 'automation_devices' Successful
Repairing Table -> 'automation_graph_rule_items' Successful
Repairing Table -> 'automation_graph_rules' Successful
Repairing Table -> 'automation_ips' Successful
Repairing Table -> 'automation_match_rule_items' Successful
Repairing Table -> 'automation_networks' Successful
Repairing Table -> 'automation_processes' Successful
Repairing Table -> 'automation_snmp' Successful
Repairing Table -> 'automation_snmp_items' Successful
Repairing Table -> 'automation_templates' Successful
Repairing Table -> 'automation_tree_rule_items' Successful
Repairing Table -> 'automation_tree_rules' Successful
Repairing Table -> 'cdef' Successful
Repairing Table -> 'cdef_items' Successful
Repairing Table -> 'color_template_items' Successful
Repairing Table -> 'color_templates' Successful
Repairing Table -> 'colors' Successful
Repairing Table -> 'data_input' Successful
Repairing Table -> 'data_input_data' Successful
Repairing Table -> 'data_input_fields' Successful
Repairing Table -> 'data_local' Successful
Repairing Table -> 'data_source_profiles' Successful
Repairing Table -> 'data_source_profiles_cf' Successful
Repairing Table -> 'data_source_profiles_rra' Successful
Repairing Table -> 'data_source_purge_action' Successful
Repairing Table -> 'data_source_purge_temp' Successful
Repairing Table -> 'data_source_stats_daily' Successful
Repairing Table -> 'data_source_stats_hourly' Successful
Repairing Table -> 'data_source_stats_hourly_cache' Successful
Repairing Table -> 'data_source_stats_hourly_last' Successful
Repairing Table -> 'data_source_stats_monthly' Successful
Repairing Table -> 'data_source_stats_weekly' Successful
Repairing Table -> 'data_source_stats_yearly' Successful
Repairing Table -> 'data_template' Successful
Repairing Table -> 'data_template_data' Successful
Repairing Table -> 'data_template_rrd' Successful
Repairing Table -> 'external_links' Successful
Repairing Table -> 'graph_local' Successful
Repairing Table -> 'graph_template_input' Successful
Repairing Table -> 'graph_template_input_defs' Successful
Repairing Table -> 'graph_templates' Successful
Repairing Table -> 'graph_templates_gprint' Successful
Repairing Table -> 'graph_templates_graph' Successful
Repairing Table -> 'graph_templates_item' Successful
Repairing Table -> 'graph_tree' Successful
Repairing Table -> 'graph_tree_items' Successful
Repairing Table -> 'host' Successful
Repairing Table -> 'host_graph' Successful
Repairing Table -> 'host_snmp_cache' Successful
Repairing Table -> 'host_snmp_query' Successful
Repairing Table -> 'host_template' Successful
Repairing Table -> 'host_template_graph' Successful
Repairing Table -> 'host_template_snmp_query' Successful
Repairing Table -> 'plugin_config' Successful
Repairing Table -> 'plugin_db_changes' Successful
Repairing Table -> 'plugin_hooks' Successful
Repairing Table -> 'plugin_realms' Successful
Repairing Table -> 'poller' Successful
Repairing Table -> 'poller_command' Successful
Repairing Table -> 'poller_data_template_field_mappings' Successful
Repairing Table -> 'poller_item' Successful
Repairing Table -> 'poller_output' Successful
Repairing Table -> 'poller_output_boost' Successful
Repairing Table -> 'poller_output_boost_processes' Successful
Repairing Table -> 'poller_output_realtime' Successful
Repairing Table -> 'poller_reindex' Successful
Repairing Table -> 'poller_resource_cache' Successful
Repairing Table -> 'poller_time' Successful
Repairing Table -> 'reports' Successful
Repairing Table -> 'reports_items' Successful
Repairing Table -> 'sessions' Successful
Repairing Table -> 'settings' Successful
Repairing Table -> 'settings_tree' Successful
Repairing Table -> 'settings_user' Successful
Repairing Table -> 'settings_user_group' Successful
Repairing Table -> 'sites' Successful
Repairing Table -> 'snmp_query' Successful
Repairing Table -> 'snmp_query_graph' Successful
Repairing Table -> 'snmp_query_graph_rrd' Successful
Repairing Table -> 'snmp_query_graph_rrd_sv' Successful
Repairing Table -> 'snmp_query_graph_sv' Successful
Repairing Table -> 'snmpagent_cache' Successful
Repairing Table -> 'snmpagent_cache_notifications' Successful
Repairing Table -> 'snmpagent_cache_textual_conventions' Successful
Repairing Table -> 'snmpagent_managers' Successful
Repairing Table -> 'snmpagent_managers_notifications' Successful
Repairing Table -> 'snmpagent_mibs' Successful
Repairing Table -> 'snmpagent_notifications_log' Successful
Repairing Table -> 'user_auth' Successful
Repairing Table -> 'user_auth_cache' Successful
Repairing Table -> 'user_auth_group' Successful
Repairing Table -> 'user_auth_group_members' Successful
Repairing Table -> 'user_auth_group_perms' Successful
Repairing Table -> 'user_auth_group_realm' Successful
Repairing Table -> 'user_auth_perms' Successful
Repairing Table -> 'user_auth_realm' Successful
Repairing Table -> 'user_domains' Successful
Repairing Table -> 'user_domains_ldap' Successful
Repairing Table -> 'user_log' Successful
Repairing Table -> 'vdef' Successful
Repairing Table -> 'vdef_items' Successful
Repairing Table -> 'version' Successful

NOTE: Checking for Invalid Cacti Templates
NOTE: 50 Invalid Data Input Data Rows based upon template mappings removed from Data Templates
root@bsd11:/usr/local/share/cacti/cli #
root@bsd11:/usr/local/share/cacti/cli # php upgrade_database.php
You are attempting to install cacti 1.1.27 onto a 0.6.x database.
To continue, you must create a new database, import 'cacti.sql' into it,
and     update 'include/config.php' to point to the new database.
root@bsd11:/usr/local/share/cacti/cli #
root@bsd11:/usr/local/share/cacti/cli # mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
Enter password:
root@bsd11:/usr/local/share/cacti/cli #

root@bsd11:/usr/local/share/cacti/cli # mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 25
Server version: 10.2.10-MariaDB-log FreeBSD Ports

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use mysql;
Database changed
MariaDB [mysql]> GRANT SELECT ON mysql.time_zone_name TO cacti@localhost;
Query OK, 0 rows affected (0.00 sec)

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

MariaDB [mysql]> quit;
Bye
root@bsd11:/usr/local/share/cacti/cli #


 

 

my.cnf Recommend 값
collation_server 값 utf8_general_ci      ->   utf8mb4_unicode_ci
character_set_client 값 utf8                 ->   utf8mb4
max_heap_table_size 값 99M              ->   198M
max_allowed_packet 값 1048576        ->   16777216
innodb_buffer_pool_size 값 128M      ->    992M

 

root@bsd11:~ # vi /usr/local/etc/my.cnf

### 변경 내용 ###

[client]
#password       = your_password
port            = 3306
socket          = /tmp/mysql.sock
default-character-set = utf8mb4   <--utf8 에서 변경 


[mysqld]
character-set-server=utf8mb4
collation-server = utf8mb4_unicode_ci



max_heap_table_size             = 200M
max_allowed_packet = 16M
innodb_buffer_pool_size = 992M

 

변경후 mariadb restart 를 합니다.

root@bsd11:~ # service mysql-server restart
Stopping mysql.
Waiting for PIDS: 6265.
Starting mysql.
root@bsd11:~ #

 

웹페이지 확인

 

Next 를 클릭 하여 설정을 진행 합니다. (Google Chrome 의 경우 전체화면으로 전환 해야 Next 버튼이 보입니다.)

 

새로운 서버 구성 이기때문에 별도로 선택할것은 없습니다.

Next 를 클릭합니다.

 

Cacti Log Path 에 아래와 같이 표시가 된다면 log 파일을 생성 해야 합니다. 

 

log 파일 생성

root@bsd11:~ #
root@bsd11:~ # cd /var/log/cacti
root@bsd11:/var/log/cacti # touch log
root@bsd11:/var/log/cacti # chown cacti:cacti log

 

 

cacti-spine 의 경우 차후 설치를 진행 합니다.

 

Template Setup 에서는 아래와 같이 선택 합니다.

 

최초 로그인의 경우 admin/admin 입니다.

 

admin Password 를 변경 합니다.  암호의 경우 대소문자가 혼합되어 있어야 합니다.

설정된 패스워드로 로그인을 진행 합니다.

 

cacti 설정 내역 (New Graphs 에서 생성 내역이 적용 안될수 있음으로 중간에 로그아웃 후 다시로그인 하면 정상으로 생성된 결과를 볼수 있습니다.)

 

 

 

 

 

 

 

시간은 대략 5 분 ~ 30분 정도면 모니터링 결과를 표시해 줍니다.

 

댓글 남기기