RadarURL

조회 수 5372 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

가 크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

가 크게 작게 위로 아래로 댓글로 가기 인쇄

3. MRTG Script 사용법


앞에서도 밝혔듯이 필자가 mrtg를 약간 수정을 했다고 했다. 그 수정한 script를 사용
하는 법을 이 section 에서 다루고자 한다.


mrtg script 는 4가지의 option을 가지고 있다. 아래의 help를 보도록 하자.
 


 Hanterm 

 [root@bbuwoo mydir]$ mrtg help

  Usage: /usr/sbin/mrtg {conf|index|log}
  conf  - create mrtg config file
  index - create index file of mrtg
  log   - logging mrtg log

 [root@bbuwoo mydir]$
 


mrtg script 에는 위에서와 같이 3가지의 옵션을 보여준다. 위에서 4 가지라고 한것은
rpm 으로 설치를 할때 mrtg.cfg 를 생성시켜 주기 위한 것으로 알 필요는 없다.  일단
각각의 옵션들에 대해 설명을 해 보도록 하겠다.

mrtg log 명령은  mrtg.cfg file의 설정을 이용하여 WorkDir 에 mrtg log와 html file
그리고 gif image(mrtg graph)를 생성을 한다.

mrtg index 는 index.html 을 생성해 준다.

mrtg conf 는 mrtg.cfg 를 생성을 해 주는데.. 여기서는 router 의 전송량을 mrtg.cfg
로 만들어 주게 되어 있다. 그러므로 mrtg conf 명령은 별로 사용할일이 없을 것이다.
아니 router의 사용량을 보고 싶다면 mrtg conf명령을 실행하되.. 주의 할것은 기본적
인 mrtg.cfg 를 덮어씌우게 되므로 백업을 한 뒤에 생성을 하고 생성된 파일에서 mrtg
router 설정 부분만 원 cfg file의 가장 뒤에 붙여서 사용을 하기 바란다.

그럼 다시 본론으로 들어가서 앞에서 까지의 과정 즉,  mrtg.cfg 의 수정을 완료를 했
다면 일단 처음 mrtg.cfg를 수정한 사람의 경우에는 WorkDir 로 지정되어 있는 디렉토
리에 있는 파일들을 모두 삭제를 한다. 이유는 아직 mrtg.cfg를 설정하지 않았는데 앞
에서 cron 으로 mrtg 를  작동하게 해 놓았기 때문에 잘못된 데이타 들이 들어가 있는
log file들이 존재 하기 때문이다. 그러므로 일단 이 파일들을 삭제한 뒤에 아래와 같
이 명령을 실행 하도록 한다.

다시 당부하지만 WorkDir 즉 /home/httpd/html/MRTG-data 에 있는 파일들을 삭제할 경
우는 mrtg.cfg 를 처음 설정한 경우에만 해당한다.
 


 Hanterm

 [root@bbuwoo etc]$ rm -rf /home/httpd/html/MRTG-data/*.*

 삭제를 할때 *으로 삭제를 하면 기본적인 icon까지 삭제가 되므로
 꼭 *.* 으로 삭제를 하기 바란다.

 [root@bbuwoo etc]$ mrtg log
  Rateup WARNING: rateup could not read the primary log file for router_1
  Rateup WARNING: rateup The backup log file for router_1 was invalid as well
  Rateup WARNING: rateup Can't remove router_1.old updating log file
  Rateup WARNING: rateup Can't rename router_1.log to router_1.old updating log file
  Rateup WARNING: rateup could not read the primary log file for router_2
  Rateup WARNING: rateup The backup log file for router_2 was invalid as well
  Rateup WARNING: rateup Can't remove router_2.old updating log file
  Rateup WARNING: rateup Can't rename router_2.log to router_2.old updating log file
  Rateup WARNING: rateup could not read the primary log file for work
  Rateup WARNING: rateup The backup log file for work was invalid as well
  Rateup WARNING: rateup Can't remove work.old updating log file
  Rateup WARNING: rateup Can't rename work.log to work.old updating log file
  Rateup WARNING: rateup could not read the primary log file for work_eth0
  Rateup WARNING: rateup The backup log file for work_eth0 was invalid as well
  Rateup WARNING: rateup Can't remove work_eth0.old updating log file
  Rateup WARNING: rateup Can't rename work_eth0.log to work_eth0.old updating log file
  Rateup WARNING: rateup could not read the primary log file for work_load
  Rateup WARNING: rateup The backup log file for work_load was invalid as well
  Rateup WARNING: rateup Can't remove work_load.old updating log file
  Rateup WARNING: rateup Can't rename work_load.log to work_load.old updating log file
  Rateup WARNING: rateup could not read the primary log file for work_httpd
  Rateup WARNING: rateup The backup log file for work_httpd was invalid as well
  Rateup WARNING: rateup Can't remove work_httpd.old updating log file
  Rateup WARNING: rateup Can't rename work_httpd.log to work_httpd.old updating log file
  Rateup WARNING: rateup could not read the primary log file for work_disk
  Rateup WARNING: rateup The backup log file for work_disk was invalid as well
  Rateup WARNING: rateup Can't remove work_disk.old updating log file
  Rateup WARNING: rateup Can't rename work_disk.log to work_disk.old updating log file
  Rateup WARNING: rateup could not read the primary log file for work_mem
  Rateup WARNING: rateup The backup log file for work_mem was invalid as well
  Rateup WARNING: rateup Can't remove work_mem.old updating log file
  Rateup WARNING: rateup Can't rename work_mem.log to work_mem.old updating log file
  Rateup WARNING: rateup could not read the primary log file for work_swap
  Rateup WARNING: rateup The backup log file for work_swap was invalid as well
  Rateup WARNING: rateup Can't remove work_swap.old updating log file
  Rateup WARNING: rateup Can't rename work_swap.log to work_swap.old updating log file

  mrtg log 명령을 처음 실행하면 위와 같이 현란한 에러 메세지들이 출력이 될것이다.
  하지만 당황하지 말자. 그냥 나오는 메세지 들이다. 3 번째 명령 부터는 에러가 없어
  질 것이다. 단순히 log file의 backup file이 존재하지 않기 때문에 발생하는 에러일
  뿐이다.

 [root@bbuwoo etc]$ mrtg index

  mrtg index 명령은 mrtg log 명령으로 log file 들과 결과물들을 생성한 후에 index
  page를 생성을 한다

 [root@bbuwoo etc]$
 


위의 process 를 마친 후면 web browser로 http://domain.com/MRTG-data/ 로 들어가서
확인을 할수가 있다. 이까지의 작업을 마쳤으면 다음 부터는 아무것도 할 필요가 없이
그냥 나두면 cron daemon 이 알아서 계속 측정을 하게 된다.
 


3. MRTG Script 사용법
앞에서도 밝혔듯이 필자가 mrtg를 약간 수정을 했다고 했다. 그 수정한 script를 사용 하는 법을 이 section 에서 다루고자 한다. mrtg script 는 4가지의 option을 가지고 있다. 아래의 help를 보도록 하자.
 Hanterm

 [root@bbuwoo mydir]$ mrtg help

  Usage: /usr/sbin/mrtg {conf|index|log}
  conf  - create mrtg config file
  index - create index file of mrtg
  log   - logging mrtg log

 [root@bbuwoo mydir]$
mrtg script 에는 위에서와 같이 3가지의 옵션을 보여준다. 위에서 4 가지라고 한것은
rpm 으로 설치를 할때 mrtg.cfg 를 생성시켜 주기 위한 것으로 알 필요는 없다.  일단
각각의 옵션들에 대해 설명을 해 보도록 하겠다.

mrtg log 명령은  mrtg.cfg file의 설정을 이용하여 WorkDir 에 mrtg log와 html file
그리고 gif image(mrtg graph)를 생성을 한다.

mrtg index 는 index.html 을 생성해 준다.

mrtg conf 는 mrtg.cfg 를 생성을 해 주는데.. 여기서는 router 의 전송량을 mrtg.cfg
로 만들어 주게 되어 있다. 그러므로 mrtg conf 명령은 별로 사용할일이 없을 것이다.
아니 router의 사용량을 보고 싶다면 mrtg conf명령을 실행하되.. 주의 할것은 기본적
인 mrtg.cfg 를 덮어씌우게 되므로 백업을 한 뒤에 생성을 하고 생성된 파일에서 mrtg
router 설정 부분만 원 cfg file의 가장 뒤에 붙여서 사용을 하기 바란다.

그럼 다시 본론으로 들어가서 앞에서 까지의 과정 즉,  mrtg.cfg 의 수정을 완료를 했
다면 일단 처음 mrtg.cfg를 수정한 사람의 경우에는 WorkDir 로 지정되어 있는 디렉토
리에 있는 파일들을 모두 삭제를 한다. 이유는 아직 mrtg.cfg를 설정하지 않았는데 앞
에서 cron 으로 mrtg 를  작동하게 해 놓았기 때문에 잘못된 데이타 들이 들어가 있는
log file들이 존재 하기 때문이다. 그러므로 일단 이 파일들을 삭제한 뒤에 아래와 같
이 명령을 실행 하도록 한다.

다시 당부하지만 WorkDir 즉 /home/httpd/html/MRTG-data 에 있는 파일들을 삭제할 경
우는 mrtg.cfg 를 처음 설정한 경우에만 해당한다.
 Hanterm

 [root@bbuwoo etc]$ rm -rf /home/httpd/html/MRTG-data/*.*

 삭제를 할때 *으로 삭제를 하면 기본적인 icon까지 삭제가 되므로
 꼭 *.* 으로 삭제를 하기 바란다.

 [root@bbuwoo etc]$ mrtg log
  Rateup WARNING: rateup could not read the primary log file for router_1
  Rateup WARNING: rateup The backup log file for router_1 was invalid as well
  Rateup WARNING: rateup Can't remove router_1.old updating log file
  Rateup WARNING: rateup Can't rename router_1.log to router_1.old updating log file
  Rateup WARNING: rateup could not read the primary log file for router_2
  Rateup WARNING: rateup The backup log file for router_2 was invalid as well
  Rateup WARNING: rateup Can't remove router_2.old updating log file
  Rateup WARNING: rateup Can't rename router_2.log to router_2.old updating log file
  Rateup WARNING: rateup could not read the primary log file for work
  Rateup WARNING: rateup The backup log file for work was invalid as well
  Rateup WARNING: rateup Can't remove work.old updating log file
  Rateup WARNING: rateup Can't rename work.log to work.old updating log file
  Rateup WARNING: rateup could not read the primary log file for work_eth0
  Rateup WARNING: rateup The backup log file for work_eth0 was invalid as well
  Rateup WARNING: rateup Can't remove work_eth0.old updating log file
  Rateup WARNING: rateup Can't rename work_eth0.log to work_eth0.old updating log file
  Rateup WARNING: rateup could not read the primary log file for work_load
  Rateup WARNING: rateup The backup log file for work_load was invalid as well
  Rateup WARNING: rateup Can't remove work_load.old updating log file
  Rateup WARNING: rateup Can't rename work_load.log to work_load.old updating log file
  Rateup WARNING: rateup could not read the primary log file for work_httpd
  Rateup WARNING: rateup The backup log file for work_httpd was invalid as well
  Rateup WARNING: rateup Can't remove work_httpd.old updating log file
  Rateup WARNING: rateup Can't rename work_httpd.log to work_httpd.old updating log file
  Rateup WARNING: rateup could not read the primary log file for work_disk
  Rateup WARNING: rateup The backup log file for work_disk was invalid as well
  Rateup WARNING: rateup Can't remove work_disk.old updating log file
  Rateup WARNING: rateup Can't rename work_disk.log to work_disk.old updating log file
  Rateup WARNING: rateup could not read the primary log file for work_mem
  Rateup WARNING: rateup The backup log file for work_mem was invalid as well
  Rateup WARNING: rateup Can't remove work_mem.old updating log file
  Rateup WARNING: rateup Can't rename work_mem.log to work_mem.old updating log file
  Rateup WARNING: rateup could not read the primary log file for work_swap
  Rateup WARNING: rateup The backup log file for work_swap was invalid as well
  Rateup WARNING: rateup Can't remove work_swap.old updating log file
  Rateup WARNING: rateup Can't rename work_swap.log to work_swap.old updating log file

  mrtg log 명령을 처음 실행하면 위와 같이 현란한 에러 메세지들이 출력이 될것이다.
  하지만 당황하지 말자. 그냥 나오는 메세지 들이다. 3 번째 명령 부터는 에러가 없어
  질 것이다. 단순히 log file의 backup file이 존재하지 않기 때문에 발생하는 에러일
  뿐이다.

 [root@bbuwoo etc]$ mrtg index

  mrtg index 명령은 mrtg log 명령으로 log file 들과 결과물들을 생성한 후에 index
  page를 생성을 한다

 [root@bbuwoo etc]$
위의 process 를 마친 후면 web browser로 http://domain.com/MRTG-data/ 로 들어가서
확인을 할수가 있다. 이까지의 작업을 마쳤으면 다음 부터는 아무것도 할 필요가 없이
그냥 나두면 cron daemon 이 알아서 계속 측정을 하게 된다.



출처 : http://oops.org/?&t=lecture&sb=mrtg&n=3

?

공부 게시판

공부에 도움되는 글을 올려주세요.

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 [공지] 공부 게시판 입니다. 처누 2003.08.18 2018179
2632 u-E(TestBed) 티소믈리에, 차 문화를 바꾸다 new 광휘의철편64 2026.10.06 3
2631 가상화 창원흥신소 서비스 안내 new 흔들리는골렘32 2026.10.06 2
2630 경제 동작노래방 010 2817 0845 모임 분위기에 맞는 노래방 안내 new 교활한철학자타조18 2026.10.06 1
2629 윈도우즈 유심&통장 [카,톡] sim256 (24시문의) 대포유심 대포통장판매 선불유심팝니다 대포유심팝니다 new 놀라운운석99 2026.10.06 1
2628 업무 강남세븐❤️OlO-8655-OO53❤️친절문의환영 #강남세븐 #역삼동세븐 #강남세븐데이즈 #강남풀싸롱 #역삼동풀싸롱 #선릉역풀싸롱 #역삼동룸싸롱 #역삼룸사롱 #역삼풀살롱 #강남미러초이스 #역삼미러초이스 new 괴랄한재규어89 2026.10.06 1
2627 건강 파주누수업체, 신속 해결의 모든 것 new 우중충한도적91 2026.10.06 2
2626 u-E(활성화) ㅇㅇ병원, 당신의 건강을 책임지는 현명한 선택 new 빛나는달고나24 2026.10.06 1
2625 u-E(표준화) 양산싱크대막힘 시원하게 뚫는 비법 new 예측불가토끼46 2026.10.06 1
2624 동식물 용인두피문신 고민? 만족 후기 보려면 new 절묘한솔개92 2026.10.06 6
2623 구글 애드센스 토보샵: 명품레플리카 쇼핑의 시작 new 얼어붙은흐름98 2026.10.06 3
2622 사무 소프트웨어 대전누수, 근본 원인 해결의 시작 new 적막한체이서42 2026.10.06 1
2621 사업 마인드 끝판왕 사이즈까지 장착 완료! 010---8293---0291---- 여기가 베트남인줄 마블 노래클럽 new 기운찬오소리38 2026.10.05 1
2620 건강 카-툑 gusim8003 [24시문의] 선불유심내구제/내구제대출/소액대출/급전/ 비대면대출 상조내구제 무직자대출 대출 new 어설픈오소리22 2026.10.05 3
2619 하드웨어 강남엘리트❤️OlO-8655-OO53❤️친절문의24시 강남하퍼1등실장 #강남엘리트 #강남엘리트위치 #강남엘리트하퍼 #하이퍼블릭엘리트 #강남엘리트예약문의 #선릉엘리트 #선릉역엘리트 #강남사라있네 new 괴랄한재규어89 2026.10.05 1
2618 블로그 청담동셔츠룸 010 2817 0845 일정과 인원에 맞춘 셔츠룸 문의 new 정열적인퀘이사14 2026.10.05 2
2617 카메라 최근 테헤란로 벤처 밸리의 핵심 리더들 사이에서 ‘클래스가 다른 정통 수질과 프라이빗 무드’로 소문 자자한 '선릉 룸싸롱' 기습 방문, 인공미를 거부하는 무결점 뉴페이스들과 심장을 마비시킨 사심 플러팅에 제대로 저격당하고 온 솔직 후기 new 희미한홍학99 2026.10.05 2
2616 u-E(활성화) 본식DVD, 웨딩영상 색감이 중요한 이유새 창 열림 힘겨운귤35 2026.10.05 2
2615 공지 대전, 인천, 세종 하수구 막힘 문제 해결 방법 정열적인코요테90 2026.10.05 4
2614 취미 <문경맥주> 구입 할 수 있는 곳은 새 창 열림 타오르는드래곤61 2026.10.05 1
2613 데이터베이스 강남건전지❤️OlO-8655-OO53❤️친절문의환영 #강남건전지 #강남유니콘 #선릉유니콘 #강남건전지위치 #선릉역건전지#대치동유니콘 #강남바커스 #선릉바커스 #선릉역바커스 #강남룸클럽 #선릉룸클럽 #강남베터리 #강남바데리 괴랄한재규어89 2026.10.05 1
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 132 Next
/ 132


즐겨찾기 (가족)

JAESOO's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

숭실대 컴퓨터 통신연구실 (서창진)

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

아스가르드 좋은사람/나쁜사람

JServer.kr

제이서버 메타블로그

재수 티스토리


즐겨찾기 (강의, 커뮤니티)

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너