japanese site
온라인강좌책메일다운로드동아리쇼핑기술지원기업정보갤러리동영상 블로그
『신개념 4단계 리눅스기술지원 시스템 공개』

※ 『무료 리눅스 배포판 배송서비스』 ※

다양한 Sample Configuration File
조회 : 3,708  

다양한 Sample Configuration File 예


MRTG로 다양한 네트웍장비의 자원을 분석하기위해서는 Configuration File을 생성해야한다.

Configuration FIile을 생성하는 방법은 cfgmaker를 이용하는 방법과 기존에 생성된 파일을 활용하는 방법 두가지가 있다.

여기서 보여드리는 Configuration File의 예는 다양한 자원분석을 위한 샘플파일이다.


Some example mrtg.cfg files

Minimal mrtg.cfg

 WorkDir: /usr/tardis/pub/www/stats/mrtg
 Target[r1]: 2:public@myrouter.somplace.edu
 MaxBytes[r1]: 64000
 Title[r1]: Traffic Analysis ISDN
 PageTop[r1]: <H1>Stats for our ISDN Line</H1>

Cfg for several Routers.

 WorkDir: /usr/tardis/pub/www/stats/mrtg
 Title[^]: Traffic Analysis for
 PageTop[^]: <H1>Stats for
 PageTop[$]: Contact The Chief if you notice anybody<HR>
 MaxBytes[_]: 64000
 Options[_]: growright
 Title[isdn]: our ISDN Line
 PageTop[isdn]: our ISDN Line</H1>
 Target[isdn]: 2:public@router.somplace.edu
 Title[backb]: our Campus Backbone
 PageTop[backb]: our Campus Backbone</H1>
 Target[backb]: 1:public@router.somplace.edu
 MaxBytes[backb]: 1250000
 # the following line removes the default prepend value
 # defined above
 Title[isdn2]: Traffic for the Backup ISDN Line
 PageTop[isdn2]: our ISDN Line</H1>
 Target[isdn2]: 3:public@router.somplace.edu


NET-SNMP Tutorial -- MRTG

This page will present a few ideas of what you can monitor on your hosts with the net-snmp using the mrtg utility.

This is not an MRTG tutorial, and it is not going to talk about monitoring network traffic.

Note, that these examples uses values that are only available from net-snmp-4.2 and that the LoadMIBs mrtg directive requires mrtg-2.8.0.

Monitoring CPU load

There are several ways to try to monitor CPU usage, because the system maintains several
CPU counters: Idle, System, User, Nice. As MRTG does not allow you to graph more than two values at a time,
it is possible to select any two values ang graoh aginst each other, but it it also possible to compute a combined value.

User vs Idle CPU usage

An example of such a graph is here.

The corresponding MRTG configuration is

    LoadMIBs: /usr/local/share/snmp/mibs/UCD-SNMP-MIB.txt
    RouterUptime[kontor.cpu]: public@
    MaxBytes[kontor.cpu]: 100
    Title[kontor.cpu]: CPU LOAD
    PageTop[kontor.cpu]: <H1>User CPU Load %</H1>
    Unscaled[kontor.cpu]: ymwd
    ShortLegend[kontor.cpu]: %
    YLegend[kontor.cpu]: CPU Utilization
    Legend1[kontor.cpu]: User CPU in % (Load)
    Legend2[kontor.cpu]: Idle CPU in % (Load)
    LegendI[kontor.cpu]:  User
    LegendO[kontor.cpu]:  Idle
    Options[kontor.cpu]: growright,nopercent

User vs System CPU usage

An example of such a graph is here.

The corresponding MRTG configuration is

    LoadMIBs: /usr/local/share/snmp/mibs/UCD-SNMP-MIB.txt
    RouterUptime[kontor.usrsys]: public@
    MaxBytes[kontor.usrsys]: 100
    Title[kontor.usrsys]: CPU LOAD
    PageTop[kontor.usrsys]: <H1>CPU (user and system) Load %</H1>
    Unscaled[kontor.usrsys]: ymwd
    ShortLegend[kontor.usrsys]: %
    YLegend[kontor.usrsys]: CPU Utilization
    Legend1[kontor.usrsys]: User CPU in % (Load)
    Legend2[kontor.usrsys]: System CPU in % (Load)
    LegendI[kontor.usrsys]:  User
    LegendO[kontor.usrsys]:  System
    Options[kontor.usrsys]: growright,nopercent

Active CPU usage

An example of such a graph is here. This example sums User, System and Nice and plots it as a single value.

The corresponding MRTG configuration is

    LoadMIBs: /usr/local/share/snmp/mibs/UCD-SNMP-MIB.txt
    Target[kontor.cpusum]:ssCpuRawUser.0&ssCpuRawUser.0:public@ + ssCpuRawSystem.0&ss
CpuRawSystem.0:public@ + ssCpuRawNice.0&ssCpuRawNice.0:public@
    RouterUptime[kontor.usrsys]: public@
    MaxBytes[kontor.cpusum]: 100
    Title[kontor.cpusum]: CPU LOAD
    PageTop[kontor.cpusum]: <H1>Active CPU Load %</H1>
    Unscaled[kontor.cpusum]: ymwd
    ShortLegend[kontor.cpusum]: %
    YLegend[kontor.cpusum]: CPU Utilization
    Legend1[kontor.cpusum]: Active CPU in % (Load)
    LegendI[kontor.cpusum]:  Active
    Options[kontor.cpusum]: growright,nopercent

Monitoring DISK space

There are two tables that can be used when monitoring disk space,
UCD-SNMP-MIB:dskTable and HOST-RESOURCES-MIB:hrStorageTable.
There are two noticeable differences bwtween these tables: UCD-SNMP-MIB:dskTable requires a configuration directive in snmpd.conf,
but it also gives a direct measure of the percentage of free space

On the system I used for these examples, I have the following disks:

    $ df
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/hda6             289M   56M  218M  21% /
    /dev/hda1             7.3G  3.2G  4.1G  44% /mnt/windows
    /dev/hda7             1.7G  1.2G  429M  74% /usr
    /dev/hdc1              19G  6.7G   11G  37% /space

and I have put the following lines into snmpd.conf:

    disk    /              100000
    disk    /usr         100000
    disk    /space     100000

Monitoring from dskTable

I used the direct percentage of disk full for the root and /usr partitions in this example It plot the usage of the root and the /usr partitions in one graph.

    LoadMIBs: /usr/local/share/snmp/mibs/UCD-SNMP-MIB.txt
    RouterUptime[kontor.root]: public@
    MaxBytes[kontor.root]: 100
    Title[kontor.root]: DISK USAGE
    PageTop[kontor.root]: <H1>DISK / and /usr Usage %</H1>
    Unscaled[kontor.root]: ymwd
    ShortLegend[kontor.root]: %
    YLegend[kontor.root]: DISK Utilization
    Legend1[kontor.root]: Root disk
    Legend2[kontor.root]: /usr disk
    LegendI[kontor.root]:  Root disk
    LegendO[kontor.root]:  /usr disk
    Options[kontor.root]: growright,gauge,nopercent

Monitoring from hrStorageTable

Use of hrStorageTable requires no preceding configuration, as in this example It plot the partition size as one value, and the used space as another.
the values returned here are in units of hrStorageUnits, which, dependent on the file system type, may or may not be 1K.

    LoadMIBs: /usr/local/share/snmp/mibs/HOST-RESOURCES-MIB.txt
    RouterUptime[kontor.hrroot]: public@
    MaxBytes[kontor.hrroot]: 300000
    Title[kontor.hrroot]: DISK / USAGE
    PageTop[kontor.hrroot]: <H1>DISK / Usage</H1>
    ShortLegend[kontor.hrroot]: B
    kMG[kontor.hrroot]: k,M,G,T,P
    kilo[kontor.hrroot]: 1024
    YLegend[kontor.hrroot]: DISK / Utilization
    Legend1[kontor.hrroot]: Root disk size
    Legend2[kontor.hrroot]: Root disk usage
    LegendI[kontor.hrroot]:  Root disk size
    LegendO[kontor.hrroot]:  Root disk usage
    Options[kontor.hrroot]: growright,gauge,nopercent

The complete picture

Last modified: Fri Dec 4 19:46:18 PST 1999

[원글링크] : https://www.linux.co.kr/home2/board/subbs/board.php?bo_table=lecture&wr_id=534

이 글을 트위터로 보내기 이 글을 페이스북으로 보내기 이 글을 미투데이로 보내기



『신개념 4단계 리눅스기술지원 시스템 공개』

CentOS 리눅스 전문서적 국내최초출시

회사소개 | 보도기사 | 채용안내 | 광고안내 | 이용약관 | 개인정보취급방침 | 책임한계와 법적고지 | 불편사항 신고하기 | 사이트맵
ㅇ 서울 : 서울특별시 강남구 노현로79길 66, 402호(역삼동,청송빌딩)  ㅇ 부산 : 부산광역시 해운대구 우동 1470 에이스하이테크21 914호
ㅇ 대표 : 1544-8128 ㅇ부산직통 : 051-744-0077 ㅇ서울직통 : 02-856-0055 ㅇ FAX : 02-6280-2663
ㅇ 사업자번호 : 128-86-68239 ㅇ 통신판매업 신고번호 : 2013-부산금정-0035호 ㅇ 개인정보책임자 : 이재석
ㅇ 상호명 : (주) 수퍼유저 ㅇ 대표자 : 박성수
Copyright ⓒ (주)수퍼유저. All rights reserved.

 아 이 디
회원 가입 | 비밀번호 찾기

▷ 네트웍
개념및 프로토콜
네트웍 장비

저자 박성수
페이지수 2,032 pages

리눅스 서버 구축 및 관리에 필요한 거의 모든 부분과 전반적인 실무 기법들을 다루고 있음

페이지수 820 pages

리눅스 보안에 관련된 내용을 종합적으로 쓴 책. 저자의 명성 그대로 보안관련의 모든 내용이 그대로 담겨져 있다.