인터페이스 부분에 :::::2 (5개임)에 추가하면 된다.

ex) target[192.168.1.1_1]: 1:MRTG@192.168.1.1:::::2
.....

감사합니다.

출처: http://blog.naver.com/seastar97?Redirect=Log&logNo=60113193685

Posted by 노을지기

댓글을 달아 주세요

리눅스의 명령어를 잘 익숙하지 않아서 이런 실수를 하였다.
메시지
mrtg error duplicate definition for target

아래 출처에서 말하듯 2개의 target 설정이 잘못되었다.

이것은 아래 명령어 때문에 발생하였다.
#cfgmaker public@192.168.0.1 >> /etc/mrtg.cfg

이전에 하나 추가했는데, 다시 명령어를 실행을 >> 로 추가하였기 때문이다.

현재 아는 방법은 다른 디바이스의 cfg을 각각 만들어
indexmaker로 합쳐주면 되는듯하다.
(나중에 확인 후 올릴 예정)

출처: http://www.mail-archive.com/mrtg@lists.oetiker.ch/msg29013.html
Flo,
You are using duplicate entries for 2 targets that is Target[10.17.5.201_1]:
this same name (10.17.5.201_1) occurs twice in your cfg file so just replace
the name (10.17.5.201_1) with (10.17.5.201_2) or any other suitable name....
you can not define two differnt target with the same name.. so replace any 1 target name....
and your problem will be solved.
hope it will help you out

Regards
S. Waqqas
[EMAIL PROTECTED] wrote:
Hi I have a problem with my mrtg.
I use mrtg and rrdtool to get informations from layer 3 switches (Traffic
and Broadcasts)
I use mrtg version 2.11.1 and Perl Version 5.8.8
mrtg works a few days, and then I have these error in the Log:
>First definition is on line 25
>contains a duplicate definition for target[10.17.5.201_1].
>2006-11-24 10:12:11 -- ERROR: Line 3101 (Target[10.17.5.201_1]:
>1:[EMAIL PROTECTED]:) in CFG file (D:/MONITORING/Config/mrtgnew.cfg)
If I delete all mrtg data and run the config script, mrtg works well, but
after a few days I have these problem.
If you need more informations , tell me.
Sorry for my poor english.
flo

Posted by 노을지기

댓글을 달아 주세요

MRTG란 Multi Router Traffic Grapher 한다. (왜? 정의하니깐..ㅡㅡ;;)

그래서 그냥 설치하기로..^^
문제는 mrtg는 기본이 root로 설정하고자 해서...
이번만 sudo를 사용하지 않고, 그냥 root 계정으로 설치한다.

 su -i
라고 하면 현재 계정의 비밀번호를 물어본다.
입력하면 자주 보았던 # <- root 계정 접속.(비추천..^^)

내 설정은 현 리눅스가 아닌, 라우터의 정보를 받을 예정임.
귀차니즘으로 인하여 둘 다 설치.. 하지만 snmpd는 설정하지 않을 예정..
 apt-get install mrtg snmpd
창이 나오면서 root만 사용할 것이냐고 물어봄.
yes

기본 웹 디렉토리를 /var/www/mrtg
설정 파일은 /etc/mrtg.cfg
 mkdir /var/www/mrtg

설정파일에 추가
 vi /etc/mrtg.cfg

# Global Settings
RunAsDaemon: yes
EnableIPv6: no
WorkDir: /var/www/mrtg
Options[_]: bits,growright
WriteExpires: Yes


cron 파일 점검
 cat /etc/cron.d/mrtg
0-55/5 * * * * root if [ -x /usr/bin/mrtg ] && [ -r /etc/mrtg.cfg ]; then env LANG=C /usr/bin/mrtg /etc/mrtg.cfg >> /var/log/mrtg/mrtg.log 2>&1; fi

cfg 파일 생성
 cfgmaker MRTG@192.168.1.1 > /etc/mrtg.cfg
이곳이 중요하다.
이미 ns-5gt에 snmp 설정을 하였다.
MRTG 이름으로 하였고, 사설 아이피인 기본 아이피로 사용중이다.
그리고 이 장비에서 서버 아이피로 snmp로 전송되게 설정이 끝난 상태이다.

아무런 메시지가 안 나오면 이상이 없는 것이다.
snmp 등 에러메시지가 나오면 점검해야한다.

HTML 파일을 생성한다.
indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html
역시 아무런 메시지가 없으면 끝..

그후 웹페이지로 확인한다.
http://localhsot/mrtg

corn에 등록
 vi /var//var/spool/cron/crontabs/root

*/5 * * * * /bin/run-parts /etc/cron.mrtg 1> /dev/null
5 * * * * /bin/run-parts /etc/cron.mrtg 1> /dev/null
5분 마다 실행하는 것이다.
이것은 mrtg가 root만 접속하기 때문에 이곳에 설정..
[While 님의 도음으로 수정합니다.]

나중에 cpu 및 ram도 테스트해야겠음..
여기까지만..


출처: http://www.debianhelp.co.uk/mrtg.htm
What is MRTG?

The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic load on network links. MRTG generates HTML pages containing PNG images which provide a LIVE visual representation of this traffic.

Download MRTG

http://people.ee.ethz.ch/~oetiker/webtools/mrtg/download.en.html

MRTG Documentation

http://people.ee.ethz.ch/~oetiker/webtools/mrtg/doc/index.en.html

http://people.ee.ethz.ch/~oetiker/webtools/mrtg/3party.en.html

First you need to install apache2 webserver for this click here

Now we need to install mrtg and snmp

Installing MRTG in Debian

#apt-get install mrtg snmpd

The installation will create an mrtg subdirectory where the Apache Web pages reside. On your Debian system the path of this subdirectory is:

/var/www/mrtg

Now you need to edit the mrtg configuration file to edit the some of the settings

File is located at /etc/mrtg.cfg you need to change the global settings as follows

# Global Settings

RunAsDaemon: yes
EnableIPv6: no
WorkDir: /var/www/mrtg
Options[_]: bits,growright
WriteExpires: Yes

Title[^]: Traffic Analysis for

You will find a crontab running every 5 minutes as user root

# cat /etc/cron.d/mrtg
0-55/5 * * * * root if [ -x /usr/bin/mrtg ] && [ -r /etc/mrtg.cfg ]; then env LANG=C /usr/bin/mrtg /etc/mrtg.cfg >> /var/log/mrtg/mrtg.log 2>&1; fi

Now we need to assign the snmp community name in snmp configration file /etc/snmp/snmpd.conf

# sec.name source community
# com2sec paranoid default public
com2sec readonly default public
#com2sec readwrite default private

Now you need to restart the snmp service

#/etc/init.d/snmpd restrat

The configuration file creating using

#cfgmaker public@localhost > /etc/mrtg.cfg

Creating a configuration file for a device using

#cfgmaker public@192.168.0.1 >> /etc/mrtg.cfg

With the configuration file created correctly there's only one other thing you have to do and that's to use the indexmaker utility to create the summary home page. Since you have to re-run this command every time you make certain changes to the /etc/mrtg.cfg configuration file,

Creating index file for the webserver using

#indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html

Now you need to reboot your system wait for five minutes or so and then take a look at your summary home page. If your Debian system's IP address is 172.16.0.20 then you'd type in the following in the address bar of a browser running on a system on the same network:

http://172.16.0.20/mrtg/

Your summary home page should come up with a graph for each target entry in the configuration file. If a graph looks like there's no data on it, click on it and check the statistics to see if any traffic is being seen. Small amounts of traffic won't show up on the graphs because we used the Unscaled statement

Some of examples how to monitor cpu and memory usage

CPU Usage

/etc/mrtg/cpu.cfg

WorkDir: /var/www/localhost/htdocs/mrtg
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
Target[localhost.cpu]:ssCpuRawUser.0&ssCpuRawUser.0:public@127.0.0.1+ ssCpuRawSystem.0&ssCpuRawSystem.0:public@127.0.0.1+
ssCpuRawNice.0&ssCpuRawNice.0:public@127.0.0.1
RouterUptime[localhost.cpu]: public@127.0.0.1
MaxBytes[localhost.cpu]: 100
Title[localhost.cpu]: CPU Load
PageTop[localhost.cpu]: <H1>Active CPU Load %</H1>
Unscaled[localhost.cpu]: ymwd
ShortLegend[localhost.cpu]: %
YLegend[localhost.cpu]: CPU Utilization
Legend1[localhost.cpu]: Active CPU in % (Load)
Legend2[localhost.cpu]:
Legend3[localhost.cpu]:
Legend4[localhost.cpu]:
LegendI[localhost.cpu]: Active
LegendO[localhost.cpu]:
Options[localhost.cpu]: growright,nopercent

Memory Usage

/etc/mrtg/mem.cfg

LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt
Target[localhost.mem]: .1.3.6.1.4.1.2021.4.6.0&.1.3.6.1.4.1.2021.4.6.0:public@localhost
PageTop[localhost.mem]: <H1>Free Memory</H1>
WorkDir: /var/www/localhost/htdocs/mrtg
Options[localhost.mem]: nopercent,growright,gauge,noinfo
Title[localhost.mem]: Free Memory
MaxBytes[localhost.mem]: 1000000
kMG[localhost.mem]: k,M,G,T,P,X
YLegend[localhost.mem]: bytes
ShortLegend[localhost.mem]: bytes
LegendI[localhost.mem]: Free Memory:
LegendO[localhost.mem]:
Legend1[localhost.mem]: Free memory, not including swap, in bytes

Creating jobs for the above two examples

CPU

/etc/cron.mrtg/cpu

#!/bin/sh
/usr/bin/mrtg /etc/mrtg/cpu.cfg

Memory

/etc/cron.mrtg/mem

#!/bin/sh
/usr/bin/mrtg /etc/mrtg/mem.cfg

Run each script 3 times (disregard the warnings)

/etc/cron.mrtg/cpu
/etc/cron.mrtg/mem

Make the Index Files

#/usr/bin/indexmaker --output=/var/www/mrtg/index.html \
--title="Memory and CPU Usage :)" \
--sort=name \
--enumerate \
/etc/mrtg/cpu.cfg \
/etc/mrtg/mem.cfg

Make the mrtg.cfg file

#cfgmaker --global "WorkDir: /var/www/mrtg/" \
--global "Options[_]: growright,bits" \
--ifref=ip \
public@localhost > /etc/mrtg/mrtg.conf

Cronjob setup

/bin/cat >> /var/spool/cron/crontabs/root
*/5 * * * * /bin/run-parts /etc/cron.mrtg 1> /dev/null


Posted by 노을지기

댓글을 달아 주세요

  1. 2011.09.03 22:20

    5 * * * * /bin/run-parts /etc/cron.mrtg 1> /dev/null
    이것은 매 시간 5분에 시작하는 것으로 1시간에 한번입니다.

    */5 * * * * /bin/run-parts /etc/cron.mrtg 1> /dev/null
    이렇게 수정해주셔야합니다.

  2. 2011.09.09 06:32 신고

    아 감사합니다.

  3. 2013.01.05 19:05

    Les agriculteurs ont peut-être trouvé un nouveau créneau d'activité pendant l'hiver : déneiger les routes en échange d'une rémunération, http://www.moncleroutletespain.com/ moncler chaquetas, comme l'a proposé la chambre d'agriculture d'Ile-de-France aux pouvoirs publics de cette région handicapée par la neige en décembre. Selon la Chambre d'Agriculture interdépartementale d'Ile de France, http://www.moncleroutletespain.com/ moncler online, qui a consacré des efforts au sujet, http://www.moncleroutletespain.com/ http://www.moncleroutletespain.com/, l'exemple a été donné par l'Eure-et-Loir, http://www.moncleroutletespain.com/ moncler españa, où un accord a été conclu par le Conseil général avec les agriculteurs locaux, http://www.moncleroutletespain.com/ moncler, dont les tracteurs ont été équipés pour le déneigement. Economie Composants: Qualcomm achète Atheros pour 3, http://www.moncleroutletespain.com/ moncler outlet,1 milliards de dollars Economie 35h: le Medef opposé à une suppression des allégements de chargesRelated articles:


    http://origamiart.kr/726 http://origamiart.kr/726

    http://oracle.tistory.com/176 http://oracle.tistory.com/176

다운로드 위치: http://www.webmin.com/download.html

아래 설명대로 그대로 하면 된다..
하지만 에러 때문에 무진장 시간을 낭비했다..
에러 메시지는 바로??

 $ sudo apt-get install webmin
Reading package lists... Done
Building dependency tree
Reading state information... Done
webmin is already the newest version.
You might want to run `apt-get -f install' to correct these:
The following packages have unmet dependencies:
  webmin: Depends: libnet-ssleay-perl but it is not going to be installed
          Depends: libauthen-pam-perl but it is not going to be installed
          Depends: libio-pty-perl but it is not going to be installed
          Depends: apt-show-versions but it is not going to be installed
아래 더 있었는데, 캡쳐 못함..ㅠㅠ
not packaging..

이것은 apt-get server의 문제인듯한데...
아무래도 파일을 못찾는듯...

그래서 구글에서 검색한 결과 apt sources.list에 추가..

아무리 찾아도 안되서 그냥 막 추가함..^^
us. uk. kr 사이트를 추가한 후 마지막으로 webmin 사이트도 추가
 sudo vi /etc/apt/sources.list

deb http://ca.archive.ubuntu.com/ubuntu/ karmic multiverse
deb-src http://ca.archive.ubuntu.com/ubuntu/ karmic multiverse
deb http://ca.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb-src http://ca.archive.ubuntu.com/ubuntu/ karmic-updates multiverse

deb http://us.archive.ubuntu.com/ubuntu/ karmic multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ karmic multiverse
deb http://us.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-updates multiverse

deb http://uk.archive.ubuntu.com/ubuntu/ karmic multiverse
deb-src http://uk.archive.ubuntu.com/ubuntu/ karmic multiverse
deb http://uk.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb-src http://uk.archive.ubuntu.com/ubuntu/ karmic-updates multiverse

deb http://kr.archive.ubuntu.com/ubuntu/ karmic multiverse
deb-src http://kr.archive.ubuntu.com/ubuntu/ karmic multiverse
deb http://kr.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb-src http://kr.archive.ubuntu.com/ubuntu/ karmic-updates multiverse

deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib


업데이트를 위해 키 추가
sudo wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc

그후에 업데이트 및 설치
 apt-get update
apt-get install webmin

하지만 다름과 같은 메시지...
 $ sudo apt-get install webmin
Reading package lists... Done
Building dependency tree
Reading state information... Done
webmin is already the newest version.
You might want to run `apt-get -f install' to correct these:
The following packages have unmet dependencies:
  webmin: Depends: libnet-ssleay-perl but it is not going to be installed
          Depends: libauthen-pam-perl but it is not going to be installed
          Depends: libio-pty-perl but it is not going to be installed
          Depends: apt-show-versions but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


마지막 메시지의 의미를 몰랐다..ㅠㅠ
unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

좀 영어에 대하여 좀 생각 할 것을..
아무것도 없이 그냥 명령을 넣으라는 것을..ㅠㅠ
나름 정확히 한다고.. 이것으로 몇시간을 날린 줄 모르겠다.

그냥 아무 생각없이 그냥 입력하면 되는데..ㅠㅠ
 sudo apt-get -f install
-f 옵션이므로 강제로 설치한다.
 $ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  apt-show-versions libapt-pkg-perl libauthen-pam-perl libio-pty-perl libnet-ssleay-perl
The following NEW packages will be installed:
  apt-show-versions libapt-pkg-perl libauthen-pam-perl libio-pty-perl libnet-ssleay-perl
0 upgraded, 5 newly installed, 0 to remove and 377 not upgraded.
1 not fully installed or removed.
Need to get 402kB of archives.
After this operation, 1,819kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ca.archive.ubuntu.com karmic/universe libnet-ssleay-perl 1.35-2ubuntu1 [204kB]
Get:2 http://ca.archive.ubuntu.com karmic/universe libauthen-pam-perl 0.16-1.1 [33.0kB]
Get:3 http://ca.archive.ubuntu.com karmic/main libio-pty-perl 1:1.07-2 [42.5kB]
Get:4 http://ca.archive.ubuntu.com karmic/main libapt-pkg-perl 0.1.23build1 [88.5kB]
Get:5 http://ca.archive.ubuntu.com karmic/universe apt-show-versions 0.16 [33.7kB]
Fetched 402kB in 2s (159kB/s)
Selecting previously deselected package libnet-ssleay-perl.
(Reading database ... 137663 files and directories currently installed.)
Unpacking libnet-ssleay-perl (from .../libnet-ssleay-perl_1.35-2ubuntu1_i386.deb) ...
Selecting previously deselected package libauthen-pam-perl.
Unpacking libauthen-pam-perl (from .../libauthen-pam-perl_0.16-1.1_i386.deb) ...
Selecting previously deselected package libio-pty-perl.
Unpacking libio-pty-perl (from .../libio-pty-perl_1%3a1.07-2_i386.deb) ...
Selecting previously deselected package libapt-pkg-perl.
Unpacking libapt-pkg-perl (from .../libapt-pkg-perl_0.1.23build1_i386.deb) ...
Selecting previously deselected package apt-show-versions.
Unpacking apt-show-versions (from .../apt-show-versions_0.16_all.deb) ...
Processing triggers for man-db ...
Setting up libnet-ssleay-perl (1.35-2ubuntu1) ...
Setting up libauthen-pam-perl (0.16-1.1) ...
Setting up libio-pty-perl (1:1.07-2) ...
Setting up libapt-pkg-perl (0.1.23build1) ...
Setting up apt-show-versions (0.16) ...
** initializing cache. This may take a while **

Setting up webmin (1.530) ...
Webmin install complete. You can now login to https://ubuntu:10000/
as root with your root password, or as any user who can use sudo
to run commands as root.

설치가 끝났다.
캐나다 서버에서 받아서 잘 설치하는군..(있는 곳이 캐나다라서..ㅠㅠ)

그후에 웹브라우저에서 https://ubuntu:10000 으로 접속하면 된다.
ID/PWD는 root/[ubutu pasword]
일반 사용자 아이디는 안 됨.

이것으로 무진장 고생했다..ㅠㅠ
다시는 안 잊어버릴 듯하다..
퇴근하자..ㅋㅋ


참고 자료: webmin 사이트

Installing on Debian

If you are using the DEB version of webmin, first download the file and then run the command : dpkg --install webmin_1.530_all.deb The install will be done automatically to /usr/share/webmin, the administration username set to root and the password to your current root password. You should now be able to login to Webmin at the URL http://localhost:10000/. Or if accessing it remotely, replace localhost with your system's IP address.

If Debian complains about missing dependencies, you can install them with the command : apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl If you are installing on Ubuntu and the apt-get command reports that some of the packages cannot be found, edit /etc/apt/sources.list and make sure the lines ending with universe are not commented out.

Some Debian-based distributions (Ubuntu in particular) don't allow logins by the root user by default. However, the user created at system installation time can use sudo to switch to root. Webmin will allow any user who has this sudo capability to login with full root privileges.

If you want to connect from a remote server and your system has a firewall installed, see this page for instructions on how to open up port 10000.

Using the Webmin APT repository

If you like to install and update Webmin via APT, edit the /etc/apt/sources.list file on your system and add the lines : deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
You should also fetch and install my GPG key with which the repository is signed, with the commands : cd /root
wget http://www.webmin.com/jcameron-key.asc
apt-key add jcameron-key.asc
You will now be able to install with the commands : apt-get update
apt-get install webmin
All dependencies should be resolved automatically.

Supported Debian-based Distributions

Webmin has been tested on all regular Debian releases, Ubuntu Linux, and derivatives like Xandros and APLINUX.

Source Packages

The files needed to build the Debian package are deb/webmin_1.530.dsc, deb/webmin_1.530.diff, and webmin-1.530.tar.gz .


Posted by 노을지기

댓글을 달아 주세요

  1. 2012.10.12 12:09

    감사합니다. 덕분에 별다른 문제 없이 설치 했네요~^^a

버전 : Linux userver 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 21:21:01 UTC 2011 i686 GNU/Linux

서버를 설치했는데, 아직은 php 파일만 지원해주는 듯...

html 에서는 아직 php을 지원안해주고 있다.
이것에 대하여 설정해야한다.
지원할 파일: html, htm, php

전에는 httpd.conf 에서 모든 것을 설정하였는데, 이제는 분리되어 있다..ㅠㅠ(rpm은 분리되었지만..)
conf 위치: /etc/apache2/apache2.conf
207라인: include /etc/apache2/httpd.conf

* Index 파일 설정
/etc/apache2/mods-enabled/dir.conf
어랏... 이미 index.htm index.php 가 되어 있으므로 패스~~
(찾는데 고생했는데..ㅡㅡ;;;)

* html 파일에서 php 적용
/etc/apache2/mods-enabled/php5.conf
 sudo vi /etc/apache2/mods-enabled/php5.conf

 <IfModule mod_php5.c>
      AddType application/x-httpd-php .php .phtml .html .htm .php3
      AddType application/xhttpd-php-source .phps
</LfModule>
html과 htm 추가해야한다.

변경되었음
 <IfModule mod_php5.c>
    <FilesMatch "\.ph(p3?|tml|p)$">
        SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.h(tml?|tm)$">
        SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.phps$">
        SetHandler application/x-httpd-php-source
    </FilesMatch>
    # To re-enable php in user directories comment the following lines
    # (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
    # prevents .htaccess files from disabling it.
    <IfModule mod_userdir.c>
        <Directory /home/*/public_html>
            php_admin_value engine Off
        </Directory>
    </IfModule>
</IfModule>

|p 는 |은 \위에 있는 | =>  비교 문자


* charest 설정
/etc/apache2/conf.d/charset
우선 영문 위주니깐.. 변경 안함.. 기본..

그후 apache 재실행
 sudo /etc/init.d/apache2 restart

그럼 이제 html 문서에서도 php가 제대로 실행된다.

너무 오랜만에 봐서리... 이 간단한 것을 찾는 것도 시간이 오래걸린다.
투자한 시간에 비해 효율은 엉망인듯...ㅠㅠ




Posted by 노을지기

댓글을 달아 주세요

  1. 2013.08.02 18:04

    감사합니다.. 1시간 동안 찾다가 겨우 되었네요..ㅠㅠ

이전버튼 1 2 3 4 5 6 이전버튼