Type 'make' to compile the software and use 'make install' to install everything to: /usr/local/rrdtool.
... that wishlist is NO JOKE. If you find RRDtool useful make me happy. Go to http://tobi.oetiker.ch/wish and place an order.
-- Tobi Oetiker <tobi@oetiker.ch> ---------------------------------------------------------------- [root@Cacti rrdtool-1.4.7]# [root@Cacti rrdtool-1.4.7]# [root@Cacti rrdtool-1.4.7]# [root@Cacti rrdtool-1.4.7]# [root@Cacti rrdtool-1.4.7]# make && make install make all-recursive make[1]: Entering directory `/download/rrdtool-1.4.7' Making all in po make[2]: Entering directory `/download/rrdtool-1.4.7/po' make[2]: Leaving directory `/download/rrdtool-1.4.7/po' Making all in src make[2]: Entering directory `/download/rrdtool-1.4.7/src' ....... ....... running install running install_lib creating /usr/local/rrdtool/lib/python2.4 creating /usr/local/rrdtool/lib/python2.4/site-packages copying build/lib.linux-i686-2.4/rrdtoolmodule.so -> /usr/local/rrdtool/lib/python2.4/site-packages make[3]: Leaving directory `/download/rrdtool-1.4.7/bindings' make[2]: Leaving directory `/download/rrdtool-1.4.7/bindings' make[1]: Leaving directory `/download/rrdtool-1.4.7/bindings' make[1]: Entering directory `/download/rrdtool-1.4.7' make[2]: Entering directory `/download/rrdtool-1.4.7' make[2]: `install-exec-am'를 위해 할 일이 없습니다 make[2]: `install-data-am'를 위해 할 일이 없습니다 make[2]: Leaving directory `/download/rrdtool-1.4.7' make[1]: Leaving directory `/download/rrdtool-1.4.7' [root@Cacti rrdtool-1.4.7]# [root@Cacti rrdtool-1.4.7]#
폰트 설정을 위해 rrdtool 버전을 1.2.x로 낮출 때에는 libpng 버전도 낮추어야 한다.
Net-SNMP 설치
[root@Cacti download]# tar zxvf net-snmp-5.7.1.tar.gz net-snmp-5.7.1/ net-snmp-5.7.1/EXAMPLE.conf.def net-snmp-5.7.1/ov/ net-snmp-5.7.1/ov/oid_to_type.in net-snmp-5.7.1/ov/README net-snmp-5.7.1/ov/bitmaps/ net-snmp-5.7.1/ov/bitmaps/UCD.20.p net-snmp-5.7.1/ov/bitmaps/UCD.32.p net-snmp-5.7.1/ov/bitmaps/UCD.32.m net-snmp-5.7.1/ov/bitmaps/UCD.20.m ....... ....... net-snmp-5.7.1/configure.d/config_project_with_enable net-snmp-5.7.1/configure.d/config_os_misc2 net-snmp-5.7.1/configure.d/config_project_paths net-snmp-5.7.1/configure.d/config_modules_agent net-snmp-5.7.1/dotgdbinit net-snmp-5.7.1/m4/ net-snmp-5.7.1/m4/ltoptions.m4 net-snmp-5.7.1/m4/ltsugar.m4 net-snmp-5.7.1/m4/ac_add_search_path.m4 net-snmp-5.7.1/m4/ac_prompt_user.m4 net-snmp-5.7.1/m4/netsnmp_search_libs.m4 net-snmp-5.7.1/m4/ac_msg_cache.m4 net-snmp-5.7.1/m4/lt~obsolete.m4 net-snmp-5.7.1/m4/netsnmp_arg.m4 net-snmp-5.7.1/m4/libtool.m4 net-snmp-5.7.1/m4/ltversion.m4 net-snmp-5.7.1/m4/ac_msg_module_dbg.m4 [root@Cacti download]# [root@Cacti download]# [root@Cacti download]# [root@Cacti download]# cd net-snmp-5.7.1 [root@Cacti net-snmp-5.7.1]# ./configure checking what to build and install... agent apps man local mibs using default persistent mask 077 using default temporary file pattern /tmp/snmpdXXXXXX using default AgentX socket /var/agentx/master using default "enterprise.net-snmp" using default enterprise sysOID "NET-SNMP-MIB::netSnmpAgentOIDs..." using default notifications "NET-SNMP-MIB::netSnmpNotifications" using OS default send buffer size for server sockets using OS default recv buffer size for server sockets using OS default send buffer size for client sockets using OS default recv buffer size for client sockets checking whether to prompt for values... configure:
You are about to be prompted with a series of questions. Answer them carefully, as they determine how the SNMP agent and related
After the configure script finishes, you can browse the newly created net-snmp-config.h file for further - less important - parameters to modify. Be careful if you re-run configure though, since net-snmp-config.h will be overwritten.
-Press return to continue-
yes checking Default version of SNMP to use...
*** Default SNMP Version:
Starting with Net-SNMP 5.0, you can choose the default version of the SNMP protocol to use when no version is given explicitly on the command line, or via an 'snmp.conf' file. In the past this was set to SNMPv1, but you can use this to switch to SNMPv3 if desired. SNMPv3 will provide a more secure management environment (and thus you're encouraged to switch to SNMPv3), but may break existing scripts that rely on the old behaviour. (Though such scripts will probably need to be changed to use the '-c' community flag anyway, as the SNMPv1 command line usage has changed as well.). At this prompt you can select "1", "2" (for SNMPv2c), or "3" as the default version for the command tools (snmpget, ...) to use. This can always be overridden at runtime using the -v flag to the tools, or by using the "defVersion" token in your snmp.conf file. Providing the --with-default-snmp-version="x" parameter to ./configure will avoid this prompt.
[root@Cacti cacti]# vi /usr/local/cacti/include/config.php
<?php /* +-------------------------------------------------------------------------+ | Copyright (C) 2004-2011 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU General Public License | | as published by the Free Software Foundation; either version 2 | | of the License, or (at your option) any later version. | | | | This program is distributed in the hope that it will be useful, | | but WITHOUT ANY WARRANTY; without even the implied warranty of | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | GNU General Public License for more details. | +-------------------------------------------------------------------------+ | Cacti: The Complete RRDTool-based Graphing Solution | +-------------------------------------------------------------------------+ | This code is designed, written, and maintained by the Cacti Group. See | | about.php and/or the AUTHORS file for specific developer information. | +-------------------------------------------------------------------------+ | http://www.cacti.net/ | +-------------------------------------------------------------------------+ */
/* make sure these values refect your actual database/host/user/password */ $database_type = "mysql"; $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cacti"; $database_password = "cacti"; # 패스워드는 임의로 설정 $database_port = "3306"; $database_ssl = false;
$config['url_path'] = '/cacti/'; # cacti 위치를 설정하는 것임(굳이 안해도 될 듯...)
/* Default session name - Session name must contain alpha characters */ #$cacti_session_name = "Cacti";
?> [root@Cacti cacti]# [root@Cacti cacti]#
Mysql 설정
[root@Cacti cacti]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.5.20-log Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
다 입력 후 Finesh를 누르면 로그인 창이 뜬다 User Name : admin Password : admin
Cacti Spine Poller 설치
cacti를 설치하면 기본적으로 설치되는 poller는 중소규모 네트웤에는 적합하나, 대규모 네트워크에서는 기본 poller만으로는 부족하다. 따라서 별도로 제공하는 spine poller를 설치해서 사용해보자
[root@Cacti download]# tar zxvf cacti-spine-0.8.7i.tar.gz cacti-spine-0.8.7i/ cacti-spine-0.8.7i/ping.h cacti-spine-0.8.7i/ping.c cacti-spine-0.8.7i/common.h cacti-spine-0.8.7i/error.h cacti-spine-0.8.7i/AUTHORS cacti-spine-0.8.7i/Makefile.in cacti-spine-0.8.7i/error.c cacti-spine-0.8.7i/INSTALL cacti-spine-0.8.7i/configure ....... ....... cacti-spine-0.8.7i/Makefile.am cacti-spine-0.8.7i/poller.c cacti-spine-0.8.7i/spine.c cacti-spine-0.8.7i/php.c cacti-spine-0.8.7i/php.h cacti-spine-0.8.7i/package cacti-spine-0.8.7i/util.c cacti-spine-0.8.7i/NEWS [root@Cacti download]# [root@Cacti download]# [root@Cacti download]# cd cacti-spine-0.8.7i [root@Cacti cacti-spine-0.8.7i]# ./bootstrap INFO: Starting Spine build process INFO: Removing cache directories INFO: Running auto-tools to verify buildability Using `AC_PROG_RANLIB' is rendered obsolete by `AC_PROG_LIBTOOL' Putting files in AC_CONFIG_AUX_DIR, `config'. INFO: Spine bootstrap process completed
To compile and install Spine do the following:
./configure make make install
[root@Cacti cacti-spine-0.8.7i]# [root@Cacti cacti-spine-0.8.7i]# [root@Cacti cacti-spine-0.8.7i]# [root@Cacti cacti-spine-0.8.7i]# ./configure --with-mysql=/usr/local/server/mysql checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes ....... ....... checking for HP-UX gethostbyname_r... no configure: creating ./config.status config.status: creating Makefile config.status: creating config/config.h config.status: executing depfiles commands [root@Cacti cacti-spine-0.8.7i]# [root@Cacti cacti-spine-0.8.7i]# [root@Cacti cacti-spine-0.8.7i]# [root@Cacti cacti-spine-0.8.7i]# [root@Cacti cacti-spine-0.8.7i]# make if gcc -DHAVE_CONFIG_H -I. -I. -I./config -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/local/server/mysql/include -g -O2 -MT sql.o -MD -MP -MF ".deps/sql.Tpo" -c -o sql.o sql.c; \ then mv -f ".deps/sql.Tpo" ".deps/sql.Po"; else rm -f ".deps/sql.Tpo"; exit 1; fi ....... ....... gcc -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/local/server/mysql/include -g -O2 -o spine sql.o spine.o util.o snmp.o locks.o poller.o nft_popen.o php.o ping.o keywords.o error.o -L/usr/local/lib -L/usr/local/server/mysql/lib /usr/local/lib/libnetsnmp.so -lmysqlclient_r -lcrypto -lz -lpthread -lm -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath -Wl,/usr/local/lib [root@Cacti cacti-spine-0.8.7i]# [root@Cacti cacti-spine-0.8.7i]# [root@Cacti cacti-spine-0.8.7i]# make install make[1]: Entering directory `/download/cacti-spine-0.8.7i' test -z "/usr/local/spine/bin" || mkdir -p -- "/usr/local/spine/bin" /bin/sh ./libtool --mode=install /usr/bin/install -c 'spine' '/usr/local/spine/bin/spine' /usr/bin/install -c spine /usr/local/spine/bin/spine test -z "/usr/local/spine/etc" || mkdir -p -- "/usr/local/spine/etc" /usr/bin/install -c -m 644 'spine.conf.dist' '/usr/local/spine/etc/spine.conf.dist' make[1]: Leaving directory `/download/cacti-spine-0.8.7i' [root@Cacti cacti-spine-0.8.7i]# ls /usr/local bin cacti doc etc games include lib libexec man rrdtool sbin server share spine src [root@Cacti cacti-spine-0.8.7i]# [root@Cacti cacti-spine-0.8.7i]# cp /usr/local/spine/etc/spine.conf.dist /etc/spine.conf [root@Cacti cacti-spine-0.8.7i]# vi /etc/spine.conf
# +-------------------------------------------------------------------------+ # | Copyright (C) 2002-2011 The Cacti Group | # | | # | This program is free software; you can redistribute it and/or | # | modify it under the terms of the GNU Lesser General Public License | # | as published by the Free Software Foundation; either version 2.1 | # | of the License, or (at your option) any later version. | # | | # | This program is distributed in the hope that it will be useful, | # | but WITHOUT ANY WARRANTY; without even the implied warranty of | # | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # | GNU General Public License for more details. | # +-------------------------------------------------------------------------+ # | spine: a backend data gatherer for Cacti | # +-------------------------------------------------------------------------+ # | This poller would not have been possible without: | # | - Larry Adams (current development and enhancements) | # | - Rivo Nurges (rrd support, mysql poller cache, misc functions) | # | - RTG (core poller code, pthreads, snmp, autoconf examples) | # | - Brady Alleman/Doug Warner (threading ideas, implimentation details) | # +-------------------------------------------------------------------------+ # | Settings | # +-------------------------------------------------------------------------+ # | DB_Host 'localhost' or socket file for UNIX/Linux | # | IP Address for Windows | # | DB_Database Database name, typically 'cacti' | # | DB_Port The database port to use | # | DB_User The user to access the database, typically 'cactiuser' | # | DB_Pass The password for the Cacti user | # | SNMP_Clientaddr Bind SNMP to a specific address for sites that use | # | higher security levels | # | DB_PreG Set to 1 if you wish to work with older versions of | # | cacti 0.8.7. | # +-------------------------------------------------------------------------+ DB_Host localhost DB_Database cacti DB_User cacti DB_Pass cacti DB_Port 3306 DB_PreG 0 "/etc/spine.conf" 40L, 2791C written [root@Cacti cacti-spine-0.8.7i]# [root@Cacti cacti-spine-0.8.7i]# [root@Cacti cacti-spine-0.8.7i]# [root@Cacti cacti-spine-0.8.7i]# ln -s /usr/local/spine/bin/spine /sbin/
cacti를 실행 할 때 'date(): It is not safe to rely on the system's timezone settings.' 메시지가 발생하면
[root@Cacti rrdtool]# vi /usr/local/lib/php.ini ....... ....... [Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = "Asia/Seoul" <- 앞에 잇는 ;(세미콜론)을 없애고 Asia/Seoul 입력
POLLER: Poller[0] WARNING: Poller Output Table not Empty. cacti/cli 에 있는 'rebuild_poller_cache.php'를 실행
[root@Cacti cacti]# php cli/rebuild_poller_cache.php WARNING: Do not interrupt this script. Rebuilding the Poller Cache can take quite some time ....... [root@Cacti cacti]#
인터페이스 트래픽 관련 그래프를 생성할 때는 Data Sources 에서 몇가지 설정을 바꿔어 주어야 한다.
- Data Source Item Field > Maximum Value 를 숫자값으로 입력해 준다. - 100Mbits 이상의 그래프 생성을 위해 Output Type ID 를 In/Out Bits(64 bits Counters)로 바꾸어 준다.