ex) target[192.168.1.1_1]: 1:MRTG@192.168.1.1:::::2
.....
감사합니다.
출처: http://blog.naver.com/seastar97?Redirect=Log&logNo=60113193685
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
su -i |
apt-get install mrtg snmpd |
mkdir /var/www/mrtg |
vi /etc/mrtg.cfg # Global Settings RunAsDaemon: yes EnableIPv6: no WorkDir: /var/www/mrtg Options[_]: bits,growright WriteExpires: Yes |
cat /etc/cron.d/mrtg |
cfgmaker MRTG@192.168.1.1 > /etc/mrtg.cfg |
indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html |
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 |
http://people.ee.ethz.ch/~oetiker/webtools/mrtg/doc/index.en.html
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
$ 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 아래 더 있었는데, 캡쳐 못함..ㅠㅠ |
sudo vi /etc/apt/sources.list |
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). |
sudo apt-get -f install |
$ 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. |
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.
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
You should also fetch and install my GPG key with which the repository is
signed, with the commands :
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
cd /root
You will now be able to install with the commands :
wget http://www.webmin.com/jcameron-key.asc
apt-key add jcameron-key.asc
apt-get update
All dependencies should be resolved automatically.
apt-get install webmin
Webmin has been tested on all regular Debian releases, Ubuntu Linux, and derivatives like Xandros and APLINUX.
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 .
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> |
<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> |
sudo /etc/init.d/apache2 restart |