STEP 1.
Weathermap4RRD는 Perl 버전과 PHP 버전이 있는데 PHP 버전으로 설치하고, 사용 할 것이다.
PHP 버전을 설치 하기에 앞서 PHP를 먼저 설치해야 한다.
[root@mrtg mrtg]# cd /usr/local/rrdbuild/
[root@mrtg rrdbuild]# wget http://kr2.php.net/get/php-5.2.13.tar.gz/from/kr.php.net/mirror
--2010-03-26 10:56:49-- http://kr2.php.net/get/php-5.2.13.tar.gz/from/kr.php.net/mirror
Resolving kr2.php.net... 211.234.110.150
Connecting to kr2.php.net|211.234.110.150|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://kr.php.net/distributions/php-5.2.13.tar.gz [following]
--2010-03-26 10:56:49-- http://kr.php.net/distributions/php-5.2.13.tar.gz
Resolving kr.php.net... 115.165.178.40
Connecting to kr.php.net|115.165.178.40|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11719620 (11M) [application/x-gzip]
Saving to: `php-5.2.13.tar.gz'
100%[=======================================================================>] 11,719,620 3.55M/s in 3.1s
2010-03-26 10:56:52 (3.55 MB/s) - `php-5.2.13.tar.gz' saved [11719620/11719620]
[root@mrtg rrdbuild]#
PHP를 다운 받았으므로, 이제 압축을 해제하고 설치를 시작 하겠다.
[root@mrtg rrdbuild]# tar xvfz php-5.2.13.tar.gz
................ 생략(참고로 PHP는 굉장히 오랫 동안 압축을 푼다) ................
php-5.2.13/README.SELF-CONTAINED-EXTENSIONS
php-5.2.13/stub.c
php-5.2.13/buildconf
php-5.2.13/stamp-h.in
php-5.2.13/README.SVN-RULES
php-5.2.13/README.input_filter
php-5.2.13/generated_lists
php-5.2.13/README.Zeus
php-5.2.13/INSTALL
php-5.2.13/TODO-PHP5
php-5.2.13/EXTENSIONS
php-5.2.13/server-tests-config.php
php-5.2.13/snapshot
php-5.2.13/php.gif
php-5.2.13/README.PARAMETER_PARSING_API
php-5.2.13/acconfig.h
php-5.2.13/README.PHP4-TO-PHP5-THIN-CHANGES
php-5.2.13/CREDITS
php-5.2.13/README.UPDATE_5_2
php-5.2.13/README.UNIX-BUILD-SYSTEM
php-5.2.13/buildconf.bat
[root@mrtg rrdbuild]# cd php-5.2.13
[root@mrtg php-5.2.13]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --disable-debug --enable-safe-mode --enable-sockets --enable-sysvsem=yes --enable-sysvshm=yes --enable-ftp --enable-magic-quotes --enable-gd-native-ttf --enable-inline-optimization --enable-bcmath --with-zlib --with-jpeg-dir=/usr --with-png-dir=/usr/lib --with-freetype-dir=/usr --with-libxml-dir=/usr --enable-exif --with-gd --with-ttf --with-gettext --enable-sigchild --enable-mbstring
.............. 생략(이것 역시 길다)...............
checking dynamic linker characteristics... GNU/Linux ld.so
(cached) (cached) checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
Generating files
updating cache ./config.cache
creating ./config.status
creating php5.spec
creating main/build-defs.h
creating scripts/phpize
creating scripts/man1/phpize.1
creating scripts/php-config
creating scripts/man1/php-config.1
creating sapi/cli/php.1
creating main/php_config.h
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+
Thank you for using PHP.
[root@mrtg php-5.2.13]#
--prefix=/usr/local/php는 php가 설치될 디렉토리 경로이다.
--with-apxs2=/usr/local/apache/bin/apxs는 Apache의 apxs를 이용해 아파치에 모듈을 적재한다.
--with-config-file-path=/usr/local/apache/conf는 php의 환경설정 파일인 php.ini가 생성 될 위치이다.
그 외 각종 라이브러리를 포함하는 옵션이다.
[root@mrtg php-5.2.13]# make
/bin/sh /usr/local/rrdbuild/php-5.2.13/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/date/lib -Iext/date/ -I/usr/local/rrdbuild/php-5.2.13/ext/date/ -DPHP_ATOM_INC -I/usr/local/rrdbuild/php-5.2.13/include -I/usr/local/rrdbuild/php-5.2.13/main -I/usr/local/rrdbuild/php-5.2.13 -I/usr/local/rrdbuild/php-5.2.13/ext/date/lib -I/usr/include/libxml2 -I/usr/include/freetype2 -I/usr/local/rrdbuild/php-5.2.13/ext/mbstring/oniguruma -I/usr/local/rrdbuild/php-5.2.13/ext/mbstring/libmbfl -I/usr/local/rrdbuild/php-5.2.13/ext/mbstring/libmbfl/mbfl -I/usr/local/rrdbuild/php-5.2.13/TSRM -I/usr/local/rrdbuild/php-5.2.13/Zend -I/usr/include -g -O2 -prefer-non-pic -c /usr/local/rrdbuild/php-5.2.13/ext/date/php_date.c -o ext/date/php_date.lo
/bin/sh /usr/local/rrdbuild/php-5.2.13/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/date/lib -Iext/date/ -I/usr/local/rrdbuild/php-5.2.13/ext/date/ -DPHP_ATOM_INC -I/usr/local/rrdbuild/php-5.2.13/include -I/usr/local/rrdbuild/php-5.2.13/main -I/usr/local/rrdbuild/php-5.2.13 -I/usr/local/rrdbuild/php-5.2.13/ext/date/lib -I/usr/include/libxml2 -I/usr/include/freetype2 -I/usr/local/rrdbuild/php-5.2.13/ext/mbstring/oniguruma -I/usr/local/rrdbuild/php-5.2.13/ext/mbstring/libmbfl -I/usr/local/rrdbuild/php-5.2.13/ext/mbstring/libmbfl/mbfl -I/usr/local/rrdbuild/php-5.2.13/TSRM -I/usr/local/rrdbuild/php-5.2.13/Zend -I/usr/include -g -O2 -prefer-non-pic -c /usr/local/rrdbuild/php-5.2.13/ext/date/lib/astro.c -o ext/date/lib/astro.lo
............... 생략 ..............
ge_scanner.lo Zend/zend_ini_parser.lo Zend/zend_ini_scanner.lo Zend/zend_alloc.lo Zend/zend_compile.lo Zend/zend_constants.lo Zend/zend_dynamic_array.lo Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_ts_hash.lo Zend/zend_stream.lo Zend/zend_iterators.lo Zend/zend_interfaces.lo Zend/zend_exceptions.lo Zend/zend_strtod.lo Zend/zend_objects.lo Zend/zend_object_handlers.lo Zend/zend_objects_API.lo Zend/zend_default_classes.lo Zend/zend_execute.lo sapi/cli/php_cli.lo sapi/cli/php_cli_readline.lo sapi/cli/getopt.lo main/internal_functions_cli.lo -lcrypt -lcrypt -lrt -lfreetype -lpng -lz -ljpeg -lz -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -o sapi/cli/php
Build complete.
Don't forget to run 'make test'.
[root@mrtg php-5.2.13]# make install
Installing PHP SAPI module: apache2handler
/usr/local/apache/build/instdso.sh SH_LIBTOOL='/usr/local/apache/build/libtool' libphp5.la /usr/local/apache/modules
/usr/local/apache/build/libtool --mode=install cp libphp5.la /usr/local/apache/modules/
cp .libs/libphp5.so /usr/local/apache/modules/libphp5.so
cp .libs/libphp5.lai /usr/local/apache/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /usr/local/rrdbuild/php-5.2.13/libs'
chmod 755 /usr/local/apache/modules/libphp5.so
[activating module `php5' in /usr/local/apache/conf/httpd.conf]
Installing PHP CLI binary: /usr/local/php/bin/
Installing PHP CLI man page: /usr/local/php/man/man1/
Installing build environment: /usr/local/php/lib/php/build/
Installing header files: /usr/local/php/include/php/
Installing helper programs: /usr/local/php/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/php/man/man1/
page: phpize.1
page: php-config.1
Installing PEAR environment: /usr/local/php/lib/php/
[PEAR] Archive_Tar - installed: 1.3.3
[PEAR] Console_Getopt - installed: 1.2.3
[PEAR] Structures_Graph- installed: 1.0.2
[PEAR] XML_Util - installed: 1.2.1
[PEAR] PEAR - installed: 1.9.0
Wrote PEAR system config file at: /usr/local/php/etc/pear.conf
You may want to add: /usr/local/php/lib/php to your php.ini include_path
Installing PDO headers: /usr/local/php/include/php/ext/pdo/
[root@mrtg php-5.2.13]#
PHP의 환경 설정을 한다. /usr/local/apache/conf에 php.ini라는 이름으로 복사 한다.
[root@mrtg php-5.2.13]# cp php.ini-dist /usr/local/apache/conf/php.ini
[root@mrtg php-5.2.13]#
웹서버(아파치)와 연동하기 위해서는 httpd.conf를 수정해야 하는데 앞에서 웹서버 설치 할 때 이미 php 관련된 사항을 모두 입력 하였다. 그래도 확인 차원에서 입력해야 하는 부분을 다시 한번 보여주겠다.
[root@mrtg php-5.2.13]# vi /usr/local/apache/conf/httpd.conf
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html index.htm index.php index.cgi
</IfModule>
#
# The following lines prevent .htaccess and .htpasswd files from being
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-cgi .cgi .pl
#
# AddHandler allows you to map certain file extensions to "handlers":
웹서버를 멈췄다가 다시 시작하여, 테스트를 해 보도록 한다.
[root@mrtg php-5.2.13]# /usr/local/apache/bin/apachectl stop
[root@mrtg php-5.2.13]# /usr/local/apache/bin/apachectl start
[root@mrtg php-5.2.13]#
테스트 페이지를 만들어서 php의 정보를 보여주는 함수를 사용해 본다.
[root@mrtg php-5.2.13]# vi /usr/local/apache/htdocs/phpinfo.php
<? phpinfo(); ?>
[root@mrtg php-5.2.13]#
위와 같이 웹브라우저를 띄우고 웹서버 주소에서 phpinfo.php를 입력하면 PHP 정보가 나오게 된다.
STEP 2.
이제 본격적으로 Weathermap4RRD를 설치 할 것이다. 우선 Weathermap4RRD를 다운 받고 압축을 해제한다.
[root@mrtg php-5.2.13]# cd /usr/local/rrdbuild/
[root@mrtg rrdbuild]# lftpget "http://weathermap4rrd.tropicalex.net/get_file.php?id=21&path=/code&filename=weathermap4rrd-php-1.2bfinal.tgz"
※ 위에서 파일을 받을 주소가 특수문자(?, &)등을 포함하고 있어서 wget이나 lftpget만 입력하면 제대로 파일을 다운로드하지 못하여 주소에 " " 로 묶어주었다. wget으로 받은 경우에는 ? 뒤부터 파일 이름으로 해석을 한 반면, lftpget을 이용하니 제대로 weathermap4rrd-php-1.2bfinal.tgz으로 받아졌다.
[root@mrtg rrdbuild]# tar xvfz weathermap4rrd-php-1.2bfinal.tgz
weathermap4rrd-php-1.2bfinal/
weathermap4rrd-php-1.2bfinal/graph.php
weathermap4rrd-php-1.2bfinal/net.php
weathermap4rrd-php-1.2bfinal/graphic.php
weathermap4rrd-php-1.2bfinal/INSTALL
weathermap4rrd-php-1.2bfinal/overlib_mini.js
weathermap4rrd-php-1.2bfinal/weathermap.conf
weathermap4rrd-php-1.2bfinal/rrd.php
weathermap4rrd-php-1.2bfinal/w4rrd.php
weathermap4rrd-php-1.2bfinal/config.php
weathermap4rrd-php-1.2bfinal/map.htm
weathermap4rrd-php-1.2bfinal/histo.php
weathermap4rrd-php-1.2bfinal/overlib.js
weathermap4rrd-php-1.2bfinal/CHANGELOG
weathermap4rrd-php-1.2bfinal/linkgraph.php
weathermap4rrd-php-1.2bfinal/overlib/
weathermap4rrd-php-1.2bfinal/index.php
weathermap4rrd-php-1.2bfinal/README
weathermap4rrd-php-1.2bfinal/icons/
weathermap4rrd-php-1.2bfinal/icons/wireless_router.png
weathermap4rrd-php-1.2bfinal/icons/router_cisco.png
weathermap4rrd-php-1.2bfinal/icons/terminal.png
weathermap4rrd-php-1.2bfinal/icons/router2.png
weathermap4rrd-php-1.2bfinal/icons/pix.png
weathermap4rrd-php-1.2bfinal/icons/server.png
weathermap4rrd-php-1.2bfinal/config_tool.php
weathermap4rrd-php-1.2bfinal/LICENSE
weathermap4rrd-php-1.2bfinal/currentvalues.php
[root@mrtg rrdbuild]#
압축을 해제하였으니, 이제 config.php와 weathermap.conf를 편집한다.
config.php는 RRDTool 실행을 위한 경로 설정과 weahtermap.conf의 경로를 설정한다.
weahtermap.conf에서는 weahtermap에서의 노드와 회선등의 설정 정보를 정의한다.
우선 config.php 파일을 수정한다.
[root@mrtg rrdbuild]# cd weathermap4rrd-php-1.2bfinal
[root@mrtg weathermap4rrd-php-1.2bfinal]# vi config.php
<?php
//$rrdtool = "/usr/bin/rrdtool";
//$rrdtool = "/usr/src/rrdtool-1.3.6/src/rrdtool";
$rrdtool = "/usr/local/rrdtool-1.2.12/bin/rrdtool";
# You have to set up this variable to your weathermap4rrd path
# it will be used to read config file
$weathermap4php= dirname($_SERVER['PATH_TRANSLATED']);
#$configfile=$weathermap4php."/weathermap.conf";
$configfile=$_GET['config'];
if (empty($configfile)) {
if (empty($weathermap4php)) {
$configfile = "weathermap.conf";
} else {
$configfile = $weathermap4php."/weathermap.conf";
}
} else {
if (empty($weathermap4php)) {
$configfile = $configfile;
} else {
$configfile = $weathermap4php."/".$configfile;
}
}
weahtermap.conf를 수정한다. 웹서버에서 구동시키기 위하여, weathermap4rrd-php-1.2bfinal 디렉토리를 웹서버가 위치한 디렉토리로 복사를 할 것이다.
[root@mrtg weathermap4rrd-php-1.2bfinal]# cd /usr/local/rrdbuild/
[root@mrtg rrdbuild]# cp -r weathermap4rrd-php-1.2bfinal /usr/local/apache/htdocs/weathermap
[root@mrtg rrdbuild]# cd /usr/local/apache/htdocs/weathermap/
[root@mrtg weathermap]# vi weathermap.conf
# This file is an example of what directives may be used in your configuration file. For more details, please visit :
#
# http://weathermap4rrd.tropicalex.net
# December 2005 / Alexandre Fontelle
# BACKGROUND directive defines a background PNG file.
# (optional)
#BACKGROUND france_.png
# Size of image generated if no background has been defined. If one background is defined, size of background will be used.
HEIGHT 600
WIDTH 740
# FONT from 1 to 5 (define size of font that will be used in graph to display node's names, title...)
FONT 4
# Position of legend
LEGENDPOS 300 460
# LEGENDSTYLE should be "orignal" or "line"
LEGENDSTYLE line
# label of TITLE
TITLE "Example Tropicalex Network map"
# Position of title in graph
TITLEPOS 4 470
# Color of background title
TITLEBACKGROUND 255 255 128
# Color of font to display title
TITLEFOREGROUND 0 0 0
# Allow to define if CHECK directive in NODE section has to be used or not
# *******
# WARNING : use of this feature could really slow generation of map because of ping function call (especially when a node is down)
# *******
# IPCHECK default value is 0
IPCHECK 0
# Time between two refresh of display in seconds
REFRESH 40
# OUTPUTFILE define path and name of PNG picture that will be generated
OUTPUTFILE /var/www/weathermap4rrdtest.tropicalex.net/htdocs/weathermap4rrd-php-1.2final/weathermap.png
# HTMLFILE define path and name of html file that will be generated to store html map of network weathermap
HTMLFILE /var/www/weathermap4rrdtest.tropicalex.net/htdocs/weathermap4rrd-php-1.2final/weathermap.html
# Legend colors and boundaries values
# For example first line means that between 1 and 10% of bandwidth use, color used to draw the arrow will be RGB(140,0,255)
# low high red green blue
SCALE 1 10 140 0 255
SCALE 10 25 32 32 255
SCALE 25 40 0 192 255
SCALE 40 55 0 240 0
SCALE 55 70 240 240 0
SCALE 70 85 255 192 0
SCALE 85 90 255 100 0
SCALE 90 100 255 0 0
# You may use AUTOSCALE directive to create a dynamic colors scale
# Example of AUTOSCALE syntax :
# AUTOSCALE 15 24 232 2 0 0 0
# AUTOSCALE 11
################
# NODES SECTION #
################
# Name of node (this name won't be displayed on map)
NODE Freebackbone
# Position of node in the map
POSITION 135 125
# Name that will be displayed on the map in label
LABEL Freebackbone
# You have ability to choose between several kind of label : "round" or "normal" for square
LABELTYPE round
NODE Bastille2
POSITION 200 387
# You need to define IP of node if you plan to use CHECK directive (see below)
IP 192.168.0.7
# Weathermap4rrd will test if node is down or up with a TCP request on port 80 of node
# *******
# WARNING : use of this feature could really slow generation of map (especially when a node is down)
# *******
CHECK tcp 80
LABEL Bastille2
LABELTYPE round
# LABELTPT defined transparency of node on network weathermap.
# Be careful 0 will disable LABELTPT value reading and it will be like LABELTPT 100
LABELTPT 80
# You may associate an icon to your node. To do so, use ICON directive
# Icon has to be a PNG file format
ICON icons/router_cisco.png
# You may want to resize icon...then use ICONRESIZE. Value is in % of original image. In this example icon displayed on map will be 75% of original size
ICONRESIZE 75
NODE k7
POSITION 478 387
IP 192.168.0.8
# Weathermap4rrd will test if node is down or up with a "ping" request (use ICMP protocol).
# *******
# WARNING : use of this feature could really slow generation of map (especially when a node is down)
# *******
CHECK ping
LABEL K7
# if no LABELTYPE is defined, default is "normal" (square)
# LABELTYPE round
ICON icons/terminal.png
ICONTPT 50
NODE switch
POSITION 405 125
LABEL switch
LABELTYPE round
NODE workstation1
POSITION 500 250
LABEL workstation1
LABELTYPE round
NODE workstation2
POSITION 500 300
LABEL workstation2
LABELTYPE round
#################
# LINKS section #
#################
# Name of link (won't be displayed on map, just useful for internal use of weathermap4rrd)
LINK internet-switch
# Put name of nodes A and B that are linked
NODES Freebackbone switch
# Define file where interfaces trafic values have to be read (could be a MRTG file or RRD file). See http://weathermap4rrd.tropicalex.net for details
# You may have a different file for inbound and outbound values. If so, use TARGETIN and TARGETOUT directives.
TARGET /home/monitor/monitoring/rrd/bastille2.eth1.rrd # LINKOVERLIBGRAPH allow you to display a popup window when mouse cursor is over a link. Content of this window will be result of call to script defined as value of LINKOVERLIBGRAPH directive. If LINKOVERLIBGRAPH is used without parameter (as in this example), script graph.php will be used.
LINKOVERLIBGRAPH
# LINKINFOURL defined URL link that will be used if you click on link. Default is globalgraph (that in fact called linkgraph.php)
# You may put what you like
LINKINFOURL globalgraph
# Define position of RRA in RRD file for inbound bandwidth values for node A (here Freebackbone)
INPOS 1
# Define position of RRA in RRD file for outbound bandwidth values for node A (here Freebackbone)
OUTPOS 2
# UNIT defines unit of values stored in TARGET file
UNIT bytes
# Define bandwidth of link in Kilobits
BANDWIDTH 316
# DISPLAYVALUE allow you to display value of bandwith just below the % bandwidth
DISPLAYVALUE 1
# Type of ARROW to display. You may choose between : "normal", "round" or "halfarrow"
ARROW halfarrow
# You may create group of link in order to filter display
GROUP dsl
#INTERNODEDISPLAY 100
# Define if middle internode will be displayed when number of internodes is odd
INTERNODEDISPLAYMID no
INTERNODEDISPLAYNUM no
LINK internet-Bastille2
NODES Freebackbone Bastille2
TARGET /home/monitor/monitoring/rrd/bastille2.eth1.rrd
# LINKOVERLIBGRAPH http://www.google.fr/intl/fr_fr/images/logo.gif
LINKOVERLIBGRAPH
LINKINFOURL globalgraph
INPOS 1
OUTPOS 2
UNIT bytes
BANDWIDTH 316
DISPLAYVALUE 1
ARROW normal
# Define points that have to be used to draw link between nodes A & B
INTERNODE 135 250
# Define transparency of round that will be display on internode position
INTERNODEDISPLAY 75
# When there is a odd number of internodes defined. You may choose if you want to display a round as for an internode in middle of link.
INTERNODEDISPLAYMID no
# You may want to display a number in round (for debug)
INTERNODEDISPLAYNUM no
LINK k7-Bastille2
NODES Bastille2 k7
TARGETOUT /home/monitor/monitoring/rrd/bastille2.eri0.rrd
TARGETIN /home/monitor/monitoring/rrd/bastille2.eri0.rrd
LINKOVERLIBGRAPH currentvalues.php
LINKINFOURL globalgraph
INPOS 1
OUTPOS 2
UNIT bytes
BANDWIDTH 316
DISPLAYVALUE 1
ARROW normal
LINK switch-workstation1
NODES switch workstation1
TARGET /home/monitor/monitoring/rrd/bastille2.eri0.rrd
INPOS 1
OUTPOS 2
UNIT bytes
BANDWIDTH 31
DISPLAYVALUE 0
ARROW circle
INTERNODE 500 125
LINK switch-workstation2
NODES switch workstation2
TARGET /home/monitor/monitoring/rrd/bastille2.eri0.rrd
INPOS 1
OUTPOS 2
UNIT bytes
BANDWIDTH 13
DISPLAYVALUE 0
ARROW circle
INTERNODE 405 300
INTERNODEDISPLAY 75
weathermap.conf는 위와 같이 되어있을 것이다.
OUTPUTFILE에서는 Weahtermap을 경험해 본 사람은 알겠지만, html로 생성 된 파일에서 스크린을 png 파일로 변환하여 저장을 할 수 있는 경로를 입력한다.
HTMLFILE에서는 웹브라우저에서 볼 수 있게 weathermap.html이 생성 될 경로를 입력한다. 사용자 편의에 맞춰 이름이나 경로 수정이 가능하다.
SCALE은 그래프에서 구간을 설정하여 트래픽을 나타내는 화살표를 색으로 구분 할 수 있게 해준다.
기본으로 들어있는 파일을 살펴보면 SCALE 1 10 140 0 255 라고 되어있다. 물론 그 위에 #으로 주석처리를 하여 low high red green blue라고 써 있는 것을 확인 할 수 있다.
트래픽이 1~10%까지 트래픽의 경우에는 화살표의 색상을 색상표 RGB에 맞춰 Red 140 , Green 0 , Blue 255로 색깔을 표현 할 것이다. 사용자가 구축하는 서버의 특성에 맞춰서 %의 단위나, 색상이나 변경이 가능하다.
NODE는 트래픽 화살표를 그리기 위한 축이라고 할 수 있으며, NODE의 이름으로 LINK를 표현 할 때 이용되므로 서버 관리자가 관리하기 편하고 기억하기 쉽게 정리하는 것이 좋다. POSITION을 통해서 X축과 Y축 값에 따라 위치를 정할 수 있다. 웹브라우저에서 위치를 정할 때는 조금씩 수정하고, 새로고침 하는것이 가장 좋은 방법이라고 생각한다.
LABEL은 NODE에 마우스를 가져가면 띄워주는 라벨이며, IP를 입력하면 ping 테스트를 하며, ping이 정상적인 경우에는 녹색으로 정상적으로 되지 않을 경우에는 붉은색으로 표시한다. LABELTYPE으로 라벨의 모양이나 위치 등도 변경이 가능하다.
ICON 등을 하위 경로 등에 두어 NODE에 이미지를 넣을 수 도 있고, ICONSIZE를 통해서 이미지의 사이즈도 변경이 가능하다. ICONESIZE 75는 이미지의 75%로 표시 한다는 의미이다.
LINK는 NODE와 NODE를 이어주는 화살표라고 할 수 있으며, TARGET을 통해 서버에 저장된 rrd 파일을 읽어와서 맵에 맞게 표현해준다.
LINKINFOURL을 통해 특정 회선에 대한 MRTG를 웨더맵과 연동한다.
LINKOVERLIBGRAPH 옵션을 통해서 마우스 포인터가 화살표에 올라가면, MRTG 그래프를 표시해주기도 한다.
트래픽의 BANDWIDTH나 ARROW의 옵션을 통하여 화살표를 양방향, 단방향등 여러가지 옵션을 줄 수 있다.
설정을 변경 하였는데도 그래프가 아래 그림과 같이 나올 것이다.
위에 설정에서 알 수 있듯이 weahtermap을 표현하기 위해서는 html과 png 파일등을 쓰거나 실행 할 수 있어야 한다.
[root@mrtg weathermap]# cd /usr/local/apache/htdocs/
[root@mrtg htdocs]# chmod 777 weathermap/
[root@mrtg htdocs]#
권한 변경 후 아래와 같이 그래프가 제대로 나오기 시작한다.
설정 부분은 본인이 직접 운영을 하면서 시행착오를 거치다보면 더 좋은 Weahtermap을 표현 할 수 있다고 생각한다.
'Linux tools > MRTG' 카테고리의 다른 글
MRTG 설정 및 사용하기 (0) | 2010.03.25 |
---|---|
MRTG 설치 방법 (0) | 2010.03.23 |