2007/09/xx 後來為了某方面的需要,再把mibs搬出來用結果發現有 Unknown SNMP var 的問題,但尚未找到解決方案。不過如果用OIDs的話就可以。還有如果畫不出圖來的話,把 Options 的 gauge 拿掉就ok了,真是怪哉!!!,我還更新至 mrtg 2.15.2 了還是無解。
ssCpuUser & ssCpuSystem
vi mrtg-cpu.cfg
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
WorkDir: /var/www/mrtg/cpu
Target[10.1.1.254_sscpu]: ssCpuUser.0&ssCpuSystem.0:[email protected]
RouterUptime[10.1.1.254_sscpu]: [email protected]
MaxBytes[10.1.1.254_sscpu]: 100
Unscaled[10.1.1.254_sscpu]: dwmy
Directory[10.1.1.254_sscpu]: ssCpu
Options[10.1.1.254_sscpu]: growright, nopercent, gauge
YLegend[10.1.1.254_sscpu]: percentages.
ShortLegend[10.1.1.254_sscpu]: %
Legend1[10.1.1.254_sscpu]: percentages of user CPU time.
Legend2[10.1.1.254_sscpu]: percentages of system CPU time.
LegendI[10.1.1.254_sscpu]: User:
LegendO[10.1.1.254_sscpu]: System:
Title[10.1.1.254_sscpu]: percentages CPU time.
PageTop[10.1.1.254_sscpu]: <H1>percentages CPU time.[10.1.1.254]</H1>LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
WorkDir: /var/www/mrtg/cpu
Target[10.1.1.254_sscpuraw]: ssCpuRawUser.0&ssCpuRawSystem.0:[email protected]
RouterUptime[10.1.1.254_sscpuraw]: [email protected]
MaxBytes[10.1.1.254_sscpuraw]: 100
Unscaled[10.1.1.254_sscpuraw]: dwmy
Directory[10.1.1.254_sscpuraw]: ssCpuRaw
Options[10.1.1.254_sscpuraw]: growright, nopercent, gauge
YLegend[10.1.1.254_sscpuraw]: CPU time.
ShortLegend[10.1.1.254_sscpuraw]: /
Legend1[10.1.1.254_sscpuraw]: user CPU time.
Legend2[10.1.1.254_sscpuraw]: system CPU time.
LegendI[10.1.1.254_sscpuraw]: User:
LegendO[10.1.1.254_sscpuraw]: System:
Title[10.1.1.254_sscpuraw]: CPU time.
PageTop[10.1.1.254_sscpuraw]: <H1>CPU time.[10.1.1.254]</H1>
要事先使用 snmpwalk -v1 -c cross 10.1.1.254 ssCpuRawUser
來得知物件名稱接的"點"後面接的數字為何
中括號裡的值用來設定各自區分圖檔
會有兩個 LoadMIBs與 WorkDir
是可各自承接那個預設值
重點在於LoadMIBs,載入這個可讓mrtg認得 Target上的名稱項目
透過 ssCpuRawUser、ssCpuRawSystem取得使用者及系統負載數值
可在 /usr/share/snmp/mibs/裡參考到其它的項目
ref: http://ohaha.ks.edu.tw/mrtg-cpu2.php
— 我是分隔線 —
而 Windows平台上使用 MS SNMP
所用到的名稱為 hrSystemProcesses與 hrProcessorLoad
vi mrtg-cpu.cfg
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
WorkDir: /var/www/mrtg/cpu
Target[10.1.1.1_cpuwin1]: hrSystemProcesses.0&hrProcessorLoad.4:[email protected]
RouterUptime[10.1.1.1_cpuwin1]: [email protected]
MaxBytes[10.1.1.1_cpuwin1]: 300
Directory[10.1.1.1_cpuwin1]: cpuwin1
Options[10.1.1.1_cpuwin1]: growright, nopercent, gauge
YLegend[10.1.1.1_cpuwin1]: process
ShortLegend[10.1.1.1_cpuwin1]: /
Legend1[10.1.1.1_cpuwin1]: The number of process contexts currently loaded or running
Legend2[10.1.1.1_cpuwin1]: The average, over the last minute, of the percentage of time
LegendI[10.1.1.1_cpuwin1]: SystemProcesses:
LegendO[10.1.1.1_cpuwin1]: ProcessorLoad:
Title[10.1.1.1_cpuwin1]: process
PageTop[10.1.1.1_cpuwin1]: <H1>process[10.1.1.1] – hrSystemProcesses & hrProcessorLoad</H1>
留言