How does one install Mrtg in linux (CentOS? Solution

Source: Internet
Author: User
Tags mrtg
How does one install Mrtg in linux (CentOS? I. early stage ??? 1) MRTG must be based on the SNMP service. therefore, make sure that your system has enabled this service and modify the SNMP configuration: # vi/etc/snmp/snmpd. conf removes the comment symbol # before the 89th Line and changes it to www.2cto.com... how does one install Mrtg in linux (CentOS? Solution 1: Early Stage ??? /Div> (1) MRTG must be based on the SNMP service. therefore, make sure that your system has enabled this service and modify the SNMP configuration: # vi/etc/snmp/snmpd. conf removes the annotator # before the 89th Line and changes it to www.2cto.com view mib2 encoded .iso.org. dod. internet. mgmt. mib-2 fc changed 62 rows: access notConfigGroup "" any noauth exact systemview none to access notConfigGroup "" any noauth exact mib2 none (2) linux Mrtg monitors host traffic to start http and snmp services: first, check whether the two services are enabled when the system starts # chkconfig -- list | grep nginx is not started. if so, you need to modify the startup mode in which you want to start it yourself :# Chkconfig -- level 35 nginx on uses the same settings for the snmpd service. now, manually start # service nginx start # service snmpd start ?? Again? Why does it happen? Etup Configuration Server ??? Its ?? C from ???? /Div> can I check whether the port is enabled ?? Does it already exist? ??? /Div> # netstat-tunlp | grep snmptcp 0 0 0.0.0.0: 199 0.0.0.0: * LISTEN 4973/snmpdudp 0 0 0.0.0.0: 161 0.0.0.0: * 4973/snmpd www.2cto.com (3) MRTG generation requires the support of http services for image browsing, and the support of gd, libpng, and zlib software. how many other software is required for the normal operation of gd? Mo? ?? If?] Self ?? T need me ?? Manual Security ?) 1. install zlib-1.2.3 # tar zxvf zlib-1.2.3.tar.gz # cd zlib-1.2.3 #. /configure -- prefix =/usr/local/zlib # make install 2. install httpd-2.2.4 # tar zxvf httpd-2.2.4.tar.gz # cd httpd-2.2.4 #. /configure -- prefix =/usr/local/apache -- sysconfdir =/etc/httpd -- enable-so -- enable-track-vars -- enable-rewrite -- with-z-dir =/ usr/local/zlib # make install start httpd/usr/local/apache/bin/apachectl-k start 3. install libpng-1.2.14 # tar zxv F libpng-1.2.14.tar.gz # cd libpng-1.2.14 # cp scripts/makefile. linux makefile # make. You can edit the makefile file, find the zlib item, and re-specify the path to/usr/local/zlib/lib and/usr/local/zlib/include ). # Make install 4. install freetype-2.1.10 # tar-zvxf freetype-2.1.10.tar.gz # cd freetype-2.1.10 # mkdir-p/usr/local/freetype #. /configure -- prefix =/usr/local/freetype # make; make install 5. install composer SRC. by default, v6bjpeg does not build directories. Therefore, you need to manually create directories: # mkdir-pv/usr/local/logs 6/{, bin, lib, include, man/{, man1 }, man1} installation # tar zxvf ready src.v6b.tar.gz #. /configure -- prefix =/usr/local/Versions 6/-- enable-shared -- enable-static # make inst All # make install-lib 6. install libxml2-2.6.19 # tar-zxf libxml2-2.6.19.tar.gz # cd libxml2-2.6.19 # mkdir-p/usr/local/libxml2 #. /configure -- prefix =/usr/local/libxml2 # make; make install # cp xml2-config/usr/bin 7. install the GD-2.0.33 Library # tar-zvxf gd-2.0.33.tar.gz # mkdir-p/usr/local/gd2 # cd gd-2.0.33 #. /configure -- prefix =/usr/local/gd2 -- with-jpeg =/usr/local/defaults 6/-- with-png =/usr/local/lib/-- with-zlib = /usr/l Ocal/zlib/-- with-freetype =/usr/local/freetype/# make install (4) modify the system ?? Language configuration # add the following to vi/etc/profile? Shang? /Div> LC_ALL = CLANGUAGE = on 2 ,? Shi 'an? (1) start to install mrtg # cd/usr/local/src # tar zvxf mrtg-2.14.5.tar.gz # cd mrtg-2.14.5 #. /configure -- prefix =/usr/local/mrtg note: "-- prefix =/usr/local/mrtg" is the specified installation path # make install (2) when MRTG is configured, what is the homepage of mrtg on the web? To create a directory? Yes:/home/wwwroot/create the mrtg and sh directories under this directory: # cd/home/wwwroot/# mkdir mrtg # cd mrtg # mkdir sh www.2cto.com? Dashboard ??? Go to # cd/usr/local/src/mrtg-2.14.5 # cp./images/*. */root/mrtg/if the path is too long it is inconvenient to establish ?? Connection: # cd/root # ln-s/home/wwwroot/mrtg # ln-s/usr/local/mrtg/bin mrtgbin, then you need to create a configuration file: #/root/mrtgbin/mongomaker public @ change cost? CIP -- output =/root/mrtg/lxy. cfg: # vi/root/mrtg/lxy. cfg remove the # WorkDir:/home/http/mrtg annotation and change it to WorkDir:/home/wwwroot/mrtg (here is the mrtg web directory). then # Options [_]: growright, remove # Before bits, align to the left, add Language: big5 at the end, and save (3) modify. sh? N case? Its? ?. Sh? N case? How is it? # Cd/root/mrtg/sh # chmod 0755 *. sh # chmod 0755 *. pl (4 )? Y? Configuration? NLANG = C/root/mrtgbin/mrtg/root/mrtg/lxy. cfg (5) generate MRTG? Station head? File: it is already in the root directory #/root/mrtgbin/indexmaker -- output =/root/mrtg/index.html -- title = "stored Alin's MRTG"/root/mrtg/lxy. cfg (6) run the program #/root/mrtgbin/mrtg/root/mrtg/lxy. some cfg users use question mark ?? Method ??? Env LANG = C/root/mrtgbin/mrtg/lxy. cfg if there is a warning or ??,? T how many times does it run ,? Warning or ?? No longer? R: OK (7) the web page generated by MRTG is static. in order to refresh the page continuously, add the preceding command to crontab # crontab-e and add the following line */1 *****/root/mrtgbin/mrtg/root/mrtg/lxy. cfg save, and then reboot ?? G? ,? Http: // change the cost? CIP/mrtg should be able to see the network usage curve, one point? And then compare ?? Eclipse _! Note: If you have set up an intermediate firewall without enabling port 80 access, you need to edit/etc/sysconfig/iptables to allow others to access port 80. 3. mrtg. target: The script Xsize to be executed: generate the horizontal width of the chart (maximum 600) Ysize: generate the vertical height of the chart (maximum 200) Title: Title kmg: change the default multiplier prefixesYtics: vertically divided into several blocks (GRIDS) MaxBytes: the maximum vertical value of the chart PageTop: the message above the page is kilo: generally write 1024, if needed, is the unit of 1000 in the computer LegendI: The first LegendO in the data returned from the SHELL: The second Options in the data returned from the SHELL: growright, indicating that the chart is extended to the right 4. configure other? Note: do I have to modify the configuration? Step 2? In step (3) (4) (5) (6? What about other configurations? Expected? Under A # cd/root/mrtg/sh (1 )?? Memory usage ?? R create a script file # vi mem. sh add the following script :#! /Bin/bash # run this script to check the mem usage. totalmem = '/usr/bin/free | grep Mem | awk' {print $2} ''usef8 ='/usr/bin/free | grep Mem | awk '{print $ 3} ''uptime = '/usr/bin/UPtime | awk' {print $3 "" $4 "" $5} ''echo $ totalmemecho $ usedmemecho $ After uptime is saved to make it have? Are you sure you want? /Div> # chmod 755/root/mrtg/sh/mem. sh (2) edit/mrtg/lxy. cfg and add the following content: Target [memory]: '/root/mrtg/sh/mem. shMaxBytes [memory]: 4096000 Title [memory]: Memory UsagesShortLegend [memory]: & kmg [memory]: kB, MBkilo [memory]: 1024 YLegend [memory]: Memory Usage: legend1 [memory]: Total Memory: Legend2 [memory]: Used Memory: LegendI [memory]: Total Memory: LegendO [memory]: Used Memory: Options [memory]: growright, gauge, nopercen TPageTop [memory]: Memory Usages 5. various shells (after the configuration is modified, the first ?, Then it will be heavy ?? (1) MEMORY: mem. sh #! /Bin/bash # This script to monitor the mem usage. totalmem = '/usr/bin/free | grep Mem | awk' {print $2} ''usef8 ='/usr/bin/free | grep Mem | awk '{print $ 3} ''echo "$ totalmem" echo "$ usef8" edit the MRTG configuration file: root ?????? R modify # MemTarget [memory]: '/root/mrtg/sh/mem. sh 'unscaled [memory]: dwymMaxBytes [memory]: 2048000 Title [memory]: MemoryShortLegend [memory]: & kmg [memory]: kB, MBkilo [memory]: 1024 YLegend [memory]: Memory Usage: Legend1 [memory]: Total Memory: Legend2 [memory]: Used Memory: LegendI [memory]: Total Memory: LegendO [memory]: used Memory: Options [memory]: growright, gauge, nopercentPageTop [memory]: Memory (2) SWAP: swap. sh #! /Bin/bash # This script to monitor the swap usage. totalswap = '/usr/bin/free | grep Swap | awk' {print $2} ''usedswap = '/usr/bin/free | grep Swap | awk' {print $ 3} ''echo "$ totalswap" echo "$ usedswap" edit the MRTG configuration file: maxBytes root ?????? R change # SwapTarget [swap]: '/root/mrtg/sh/swap. sh 'unscaled [swap]: dwymMaxBytes [swap]: 3048000 Title [swap]: SWAPShortLegend [swap]: & kmg [swap]: kB, MBkilo [swap]: 1024 YLegend [swap]: Swap subnet [swap]: Total SwapLegend2 [swap]: Used SwapLegendI [swap]: Total SwapLegendO [swap]: Used SwapOptions [swap]: growright, gauge, nopercentPageTop [swap]: Swap (3) CPU: cpu. sh #! /Bin/bash # run this script to check the mem usage. totalmem = '/usr/bin/free | grep Mem | awk' {print $2} ''usef8 ='/usr/bin/free | grep Mem | awk '{print $ 3} ''uptime = '/usr/bin/UPtime | awk' {print $3 "" $4 "" $5} ''echo $ totalmemecho $ usedmemecho $ UPtimehostname www.2cto.com Edit MRTG configuration file: maxBytes root ?????? R change # CpuTarget [cpu]: '/root/mrtg/sh/cpu. sh 'maxbytes [cpu]: 100 Title [cpu]: CPUOptions [cpu]: gauge, nopercent, growrightYLegend [cpu]: CPU loading (%) ShortLegend [cpu]: % LegendO [cpu]: & CPU USERLegendI [cpu]: & CPU SYSTEMPageTop [cpu]: CPU (4) magnetic ?? Child? Df. pl #! /Usr/bin/perl # output (df-kl) looks like this: # Filesystem 1k-blocks Used Available Use % Mounted on #/dev/md0 95645100 30401312 64272080 33% 14119/#/dev/hde1 1159 12231 9%/boot # In which case, this script returns: #95659219 #30402503 # when run. foreach $ filesystem ('df-kl | grep-v "Filesystem" ') {@ df = split (/\ s +/, $ filesystem ); $ total + = $ df [1]; $ usage + = $ df [2];} print "$ total \ n"; print "$ usage \ n "; Hostname: Edit the MRTG configuration file: MaxBytes root ?????? R modify # Disk usedTarget [disk]: '/root/mrtg/sh/df. pl 'title [disk]: Disk SpaceUnscaled [disk]: dwymMaxBytes [disk]: 115247550kmg [disk]: KB, MB, GBLegendI [disk]: Total Disk SpaceLegendO [disk]: used Disk SpaceLegend1 [disk]: Total Disk SpaceLegend2 [disk]: Used Disk SpaceYLegend [disk]: MegabytesShortLegend [disk]: & Options [disk]: growright, gauge, nopercentPageTop [disk]: Disk Space (5) magnetic? I/O: io. sh #! /Bin/bash # This script will monitor the KBread/sec & KBwriten/sec of Disk. # Creater: ccc it loren ext: 2288 2005/8/3 # As sda, sdb, sdc, sdd, hda. # disk = sdahd = sdadisk =/dev/$ hdKBread_sec = 'iostat-x $ disk | grep $ hd | awk '{print $8}' KBwrite _ sec = 'iostat- x $ disk | grep $ hd | awk '{print $9} ''echo "$ KBread_sec" echo "$ KBwrite_sec" hostname: Edit the MRTG configuration file: if yes? Z? Y more partitions? T modify io. sh # Disk I/OTarget [diskIO]: '/root/mrtg/sh/io. sh 'title [diskIO]: Disk hda I/OUnscaled [diskIO]: dwymMaxBytes [diskIO]: 100kmg [diskIO]: KB, MB, GBLegendI [diskIO]: disk I/O KBread/secLegendO [diskIO]: Disk I/O KBwrite/secLegend1 [diskIO]: Disk I/O KBread/secLegend2 [diskIO]: disk I/O KBwrite/secYLegend [diskIO]: MegabytesShortLegend [diskIO]: & Options [diskIO]: growright, gauge, nopercentPageTop [diskIO]: Disk I/O Source http://www.cnblogs.com/see7di/archive/2012/12/10/2811041.html
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.