RadarURL

조회 수 717 추천 수 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 928102
654 웹서버,WAS http를 https로 리다이렉트하는 여러가지 방법 new JaeSoo 2025.09.10 0
653 웹서버,WAS SSL인증서 없이 HTTPS에서 HTTP로 되돌리기 new JaeSoo 2025.09.10 2
652 웹서버,WAS [SSL] win-acme, Let's encrypt로 무료 SSL 인증서 발급 new JaeSoo 2025.09.10 0
651 웹서버,WAS [SSL] Windows 10에서 Let's Encrypt로 SSL 인증서 무료 발급받기 new JaeSoo 2025.09.10 0
650 웹서버,WAS 무료로 https SSL/TLS 인증서를 발급받을 수 있는 인증 기관 new JaeSoo 2025.09.10 0
649 웹서버,WAS 아파치 서버에 https SSL 인증서 적용하는 방법 (apache httpd) new JaeSoo 2025.09.10 0
648 웹서버,WAS 아파치2(Apache2) SSL HTTPS 적용하기 new JaeSoo 2025.09.10 0
647 웹서버,WAS 아파치 웹서버에 멀티 도메인에 대한 80, 443 포트 설정하는 방법 newfile JaeSoo 2025.09.10 0
646 소프트웨어 Google Photo 대신 Immich를 써보자 file JaeSoo 2025.08.07 126
645 소프트웨어 [사진관리] PhotoPrism vs LibrePhoto 비교 소감 JaeSoo 2025.05.19 14
644 윈도우즈 윈도우 자동 로그온 설정이 보이지 않을 때 조치사항 JaeSoo 2024.08.16 203
643 소프트웨어 핸드폰 연락처 한방에 깔끔하게 정리하기 - by.컨택에디터(Contact Editor) JaeSoo 2024.05.27 31
642 윈도우즈 Rufus 로 윈도우10 usb 디스크를만들때 UEFI,Legacy 설정 (4G 이상 부팅 이미지 GPT) file JaeSoo 2023.11.20 2260
641 윈도우즈 Windows 11에서 모든 시스템 트레이 아이콘을 관리하고 표시하는 방법 file JaeSoo 2023.11.05 1367
640 윈도우즈 윈도우11 작업 표시줄 좌/우/상/하 이동 및 두 줄 만드는 방법 file JaeSoo 2023.11.05 1250
639 윈도우즈 윈도우11의 마우스 오른쪽 버튼 메뉴, 기존 윈도우 형태로 되돌리는 방법 file JaeSoo 2023.10.25 913
638 윈도우즈 [Msoffice] Pdfmaker office addin 오류 해결방법 file JaeSoo 2023.08.21 3776
637 유닉스/리눅스 [U2L] Unix to Linux 기대효과 분석 JaeSoo 2023.05.16 1258
636 유닉스/리눅스 리눅스 inodes full 이슈 해결 방법 JaeSoo 2023.05.02 169
635 유닉스/리눅스 inode full JaeSoo 2023.05.01 115
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 33 Next
/ 33


즐겨찾기 (가족)

JAESOO's HOMEPAGE


YOUNGAE's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

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

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

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

JServer.kr

제이서버 메타블로그

재수 티스토리


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

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너