#Default is /usr/local/mrtg-2
mkdir /usr/local/mrtg
./configure –prefix=/usr/local/mrtg
make
make install
#make mrtg, images and icons data directory
mkdir /home/user/public_html/mrtg
mkdir /home/user/public_html/mrtg/images
mkdir /home/user/public_html/mrtg/icons
#copy to icons data
cp /usr/local/mrtg/share/mrtg2/*.png /home/user/public_html/mrtg/icons
#make data and logs directory
mkdir /usr/local/mrtg/data
mkdir /usr/local/mrtg/logs
#make config data with cfgmaker
#cfgmaker:/usr/loca/mrtg/bin/cfgmaker
#cfgmaker [community]@[host] > [output]
#choice localhost or network example!!
cfgmaker localhost@localhost > /usr/local/mrtg/data/local.cfg
cfgmaker network@192.168.0.0 > /usr/local/mrtg/data/network.cfg
#And Edit
#First setting directory
Htmldir: /home/user/public_html/mrtg
Imagedir: /home/user/public_html/mrtg/images
Iconsdir: icons
Logdir: /usr/local/mrtg/logs
#Refresh [second]
Refresh : 300
#Language Japanese
Language: eucjp
Target[Traffics]: 2:[Community]@[Host]:
Target[Traffics]: 2:local@localhost:
SetEnv[Traffics]: MRTG_INT_IP=”192.168.0.0″ MRTG_INT_DESCR=”eth0″
MaxBytes[Traffics]: 12500000
Options[Traffics]:growright
Title[Traffics]: Traffic Analysis
PageTop[Traffics]: <h1>Traffic Analysis</h1>
###############################################
# CPU Load Average
Target[CPU_AVG]:1.3.6.1.4.1.2021.10.1.5.2&1.3.6.1.4.1.2021.10.1.5.2:community@192.168.0.0
MaxBytes[CPU_AVG]: 2000
Options[CPU_AVG]:integer, gauge, withzeroes, growright, noinfo, nopercent
YLegend[CPU_AVG]: CPU Load Average
ShortLegend[CPU_AVG]: (%)
LegendI[CPU_AVG]:Average 1 minutes
LegendO[CPU_AVG]:Average 5 minutes
Legend1[CPU_AVG]:Average 1 minutes
Legend2[CPU_AVG]:Average 5 minutes
Title[CPU_AVG]:CPU Load Average
PageTop[CPU_AVG]:<h1>CPU Load Average</h1>
##############################################
# Rate of CPU Usage
Target[CPU_USE]:.1.3.6.1.4.1.2021.11.50.0&.1.3.6.1.4.1.2021.11.52.0:community@192.168.0.0
MaxBytes[CPU_USE]: 100
Options[CPU_USE]:growright, noinfo, nopercent
YLegend[CPU_USE]: CPU Usage
ShortLegend[CPU_USE]:(%)
LegendI[CPU_USE]:User:
LegendO[CPU_USE]:System:
Legend1[CPU_USE]:CPU Usage (User)
Legend2[CPU_USE]:CPU Usage (System)
Title[CPU_USE]: Rage of CPU Usage
PageTop[CPU_USE]:<h1>Rate of CPU Usage</h1>
##############################################
# Memory Free
Target[Mem]:.1.3.6.1.4.1.2021.4.6.0&.1.3.6.1.4.1.2021.4.4.0:community@192.168.0.0
#MaxBytes[Mem]:2289220
MaxBytes1[Mem]:2289220
MaxBytes2[Mem]:505860
Unscaled[Mem]:dwmy
Options[Mem]:gauge, growright, noinfo
YLegend[Mem]:Memory Free
ShortLegend[Mem]:Bytes
kilo[Mem]:1024
kMG[Mem]:k,M,G,T,P
LegendI[Mem]:Real
LegendO[Mem]:Swap
Legend1[Mem]:Real Memory
Legend2[Mem]:Swap Memory
Title[Mem]:Memory Free
PageTop[Mem]:<h1>Memory Free</h1>
#############################################
# Disk Used
Target[Disk]:.1.3.6.1.4.1.2021.9.1.9.1&.1.3.6.1.4.1.2021.9.1.9.1:community@192.168.0.0
MaxBytes[Disk]:100
Unscaled[Disk]:dwmy
Options[Disk]:gauge, growright, nopercent, noinfo
YLegend[Disk]:Disk Used
ShortLegend[Disk]:(%)
LegendI[Disk]:/ Disk Used
LegendO[Disk]:/ Disk Used
Legend1[Disk]:/ Disk Used
Legend2[Disk]:/ Disk Used
Title[Disk]: Disk Used
PageTop[Disk]:<h1> Disk Used </h1>
#Save And Close
#Go to /usr/local/mrtg/bin
./mrtg /usr/local/merg/data/local.cfg
# or
./mrtg /usr/local/merg/data/network.cfg
#if you show these Errors
———————————————————————–
ERROR: Mrtg will most likely not work properly when the environment
variable LANG is set to UTF-8. Please run mrtg in an environment
where this is not the case. Try the following command to start:
env LANG=C ./mrtg /usr/local/mrtg/data/network.cfg
———————————————————————–
>env LANG=C ./mrtg /usr/local/mrtg/data/network.cfg
#make index.html
./indexmaker /usr/local/mrtg/data/local.cfg > /home/user/public_html/mrtg/
#or
./indexmaker /usr/local/mrtg/data/network.cfg > /home/user/public_html/mrtg/
#Add service Crond
crontab -e
*/5 * * * * root ./mrtg /usr/local/mrtg/data/network.cfg
or
*/5 * * * * root LANG=C ./mrtg /usr/local/mrtg/data/network.cfg
Tagged with: au • error • GD • HTML • Perl