The most detailed mrtg settings in history

Source: Internet
Author: User
Tags mrtg
The most detailed mrtg settings in history indicate that Mrtg can be used to monitor linux parameters. if you do not understand them, you can search for them. today, I mainly want to explain how to set it. i. early stage ??? Ww.2cto.com (1) MRTG needs to be based on the SNMP service, so please make sure your system... the most detailed mrtg settings in history indicate that Mrtg can be used to monitor linux parameters. if you do not understand them, you can search for them. today, I mainly want to explain how to set it. i. What is the early stage ?? Www.2cto.com (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, replace row 62: access notConfigGroup "" any noauth exact systemview none with access notConfigGroup "" any noauth exact mib2 none, and remove the annotation symbol before row 89th, changed to view mib2 encoded Ded .iso.org. dod. internet. mgmt. mib-2 fc www.2cto.com (2) linux Mrtg monitors host traffic starting 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, modify the startup mode. Start it by 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 (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 installing mrtg # cd/usr/local/src # wget http://oss.oetiker.ch/mrtg/pub/mrtg-2.14.5.tar.gz#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 in this directory: # cd/home/wwwroot/# mkdir mrtg # cd mrtg # mkdir sh can be created if the path is too long and inconvenient ?? Link: # cd/# ln-s/home/wwwroot/mrtg _ mrtg # ln-s/usr/local/mrtg/bin _ mrtgbin? Dashboard ??? # Cd/usr/local/src/mrtg-2.14.5 //? Input mrtg security? Object? # Cp./images/*. */_ mrtg/Then you need to create a configuration file: #/_ mrtgbin/mongomaker public @ change the cost? CIP -- output =/_ mrtg/lxy. cfg: # vi/_ 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 )? Y? Configuration? N (if? More? Y?? LANG = C/_ mrtgbin/mrtg/_ mrtg/lxy. cfg ===================================================== ============= (4) root ?? Why is it annoying to build sh and pl? N case, and then modify. sh? N case? Its? ?. Sh? N case? How is it? # Cd/_ mrtg/sh # chmod 0755 * (5) generate MRTG? Station head? File: it is already in the root directory #/_ mrtgbin/indexmaker -- output =/_ mrtg/index.html -- title = "externalin's MRTG"/_ mrtg/lxy. cfg (6) run the program #/_ mrtgbin/mrtg/_ mrtg/lxy. some cfg users use question mark ?? Method ??? Env LANG = C/_ 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 *****/_ mrtgbin/mrtg/_ 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/_ mrtg/sh (1 )?? Memory usage ?? R create a script file # Add vi mem. sh (step? 5) script: Do you want to have it after saving it? Are you sure you want? /Div> # chmod 0755/_ mrtg/sh/* (2) edit/mrtg/lxy. cfg and add (step? 5) content: 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]: '/_ 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]: '/_ 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 edit MRTG configuration File: maxBytes root ?????? R change # CpuTarget [cpu]: '/_ 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]: '/_ 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]: '/_ 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
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.