http://www.net-snmp.org качаем последнюю версию snmp.
$ sudo su
# cd /путь до папки куда распаковали содержимое
# ./configure - далее отвечаем на вопросы.
этот конфиг проверен лично мной и используется. ссылка в конце статьи.
sudo gedit /etc/mrtg.cfg:
######################################################################
# Multi Router Traffic Grapher -- Sample Configuration File
######################################################################
# This file is for use with mrtg-2.5.4c
# Global configuration
RunAsDaemon: yes
LogDir: /var/log/mrtg
WorkDir: /var/www/mrtg
WriteExpires: Yes
EnableIPv6: no
#HtmlDir: /var/www/mrtg
#ImageDir: /var/www/mrtg #images
###########################
# Сетевой интерфейс маршрутизатора
Title[wlan0]: Output interface
PNGTitle[wlan0]: Interface to local #Internet
MaxBytes[wlan0]: 64000
AbsMax[wlan0]: 128000
Options[wlan0]: growright, bits
SetEnv[wlan0]: MRTG_INT_IP="192.168.1.1" MRTG_INT_DESCR="wlan0"
Target[wlan0]: 2:public@localhost:
PageTop[wlan0]: < h1 >
Output interface< /h1 >
YLegend[wlan0]: bits/s
ShortLegend[wlan0]: b/s
Legend1[wlan0]: Incoming Traffic
Legend2[wlan0]: Outgoing Traffic
Legend3[wlan0]: Maximum Incoming Traffic
Legend4[wlan0]: Maximum Outgoing Traffic
LegendI[wlan0]: In:
LegendO[wlan0]: Out:
WithPeak[wlan0]: ymwd
# Сетевой интерфейс маршрутизатора
Title[eth0]: Output interface
PNGTitle[eth0]: Interface to Internet
MaxBytes[eth0]: 64000
AbsMax[eth0]: 128000
Options[eth0]: growright, bits
SetEnv[eth0]: MRTG_INT_IP="93.170.13.118" MRTG_INT_DESCR="eth0"
Target[eth0]: 2:public@localhost:
PageTop[eth0]: < h1 > Output interface< / h1 >
YLegend[eth0]: bits/s
ShortLegend[eth0]: b/s
Legend1[eth0]: Incoming Traffic
Legend2[eth0]: Outgoing Traffic
Legend3[eth0]: Maximum Incoming Traffic
Legend4[eth0]: Maximum Outgoing Traffic
LegendI[eth0]: In:
LegendO[eth0]: Out:
WithPeak[eth0]: ymwd
###########################
# CPU
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
Target[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[cpu]: public@127.0.0.1
MaxBytes[cpu]: 100
Title[cpu]: CPU Load
PageTop[cpu]: < H1 >Active CPU Load %< / H1 >
Unscaled[cpu]: ymwd
ShortLegend[cpu]: %
YLegend[cpu]: CPU Utilization
Legend1[cpu]: Active CPU in % (Load)
Legend2[cpu]:
Legend3[cpu]:
Legend4[cpu]:
LegendI[cpu]: Active
LegendO[cpu]:
Options[cpu]: growright,nopercent
###########################
# Memory
LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt
Target[mem]: .1.3.6.1.4.1.2021.4.6.0&.1.3.6.1.4.1.2021.4.6.0:public@localhost
PageTop[mem]: < H1 >Free Memory< / H1 >
Options[mem]: nopercent,growright,gauge,noinfo
Title[mem]: Free Memory
MaxBytes[mem]: 1000000
kMG[mem]: k,M,G,T,P,X
YLegend[mem]: bytes
ShortLegend[mem]: bytes
LegendI[mem]: Free Memory:
LegendO[mem]:
Legend1[mem]: Free memory, not including swap, in bytes
# Multi Router Traffic Grapher -- Sample Configuration File
######################################################################
# This file is for use with mrtg-2.5.4c
# Global configuration
RunAsDaemon: yes
LogDir: /var/log/mrtg
WorkDir: /var/www/mrtg
WriteExpires: Yes
EnableIPv6: no
#HtmlDir: /var/www/mrtg
#ImageDir: /var/www/mrtg #images
###########################
# Сетевой интерфейс маршрутизатора
Title[wlan0]: Output interface
PNGTitle[wlan0]: Interface to local #Internet
MaxBytes[wlan0]: 64000
AbsMax[wlan0]: 128000
Options[wlan0]: growright, bits
SetEnv[wlan0]: MRTG_INT_IP="192.168.1.1" MRTG_INT_DESCR="wlan0"
Target[wlan0]: 2:public@localhost:
PageTop[wlan0]: < h1 >
Output interface< /h1 >
YLegend[wlan0]: bits/s
ShortLegend[wlan0]: b/s
Legend1[wlan0]: Incoming Traffic
Legend2[wlan0]: Outgoing Traffic
Legend3[wlan0]: Maximum Incoming Traffic
Legend4[wlan0]: Maximum Outgoing Traffic
LegendI[wlan0]: In:
LegendO[wlan0]: Out:
WithPeak[wlan0]: ymwd
# Сетевой интерфейс маршрутизатора
Title[eth0]: Output interface
PNGTitle[eth0]: Interface to Internet
MaxBytes[eth0]: 64000
AbsMax[eth0]: 128000
Options[eth0]: growright, bits
SetEnv[eth0]: MRTG_INT_IP="93.170.13.118" MRTG_INT_DESCR="eth0"
Target[eth0]: 2:public@localhost:
PageTop[eth0]: < h1 > Output interface< / h1 >
YLegend[eth0]: bits/s
ShortLegend[eth0]: b/s
Legend1[eth0]: Incoming Traffic
Legend2[eth0]: Outgoing Traffic
Legend3[eth0]: Maximum Incoming Traffic
Legend4[eth0]: Maximum Outgoing Traffic
LegendI[eth0]: In:
LegendO[eth0]: Out:
WithPeak[eth0]: ymwd
###########################
# CPU
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
Target[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[cpu]: public@127.0.0.1
MaxBytes[cpu]: 100
Title[cpu]: CPU Load
PageTop[cpu]: < H1 >Active CPU Load %< / H1 >
Unscaled[cpu]: ymwd
ShortLegend[cpu]: %
YLegend[cpu]: CPU Utilization
Legend1[cpu]: Active CPU in % (Load)
Legend2[cpu]:
Legend3[cpu]:
Legend4[cpu]:
LegendI[cpu]: Active
LegendO[cpu]:
Options[cpu]: growright,nopercent
###########################
# Memory
LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt
Target[mem]: .1.3.6.1.4.1.2021.4.6.0&.1.3.6.1.4.1.2021.4.6.0:public@localhost
PageTop[mem]: < H1 >Free Memory< / H1 >
Options[mem]: nopercent,growright,gauge,noinfo
Title[mem]: Free Memory
MaxBytes[mem]: 1000000
kMG[mem]: k,M,G,T,P,X
YLegend[mem]: bytes
ShortLegend[mem]: bytes
LegendI[mem]: Free Memory:
LegendO[mem]:
Legend1[mem]: Free memory, not including swap, in bytes
sudo indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html
моя статистика: http://darvin.info-lan.me/mrtg
моя статистика: http://darvin.info-lan.me/mrtg
Комментариев нет:
Отправить комментарий