Страница 1 из 8

MRTG часть 2 - восстание машин:)

СообщениеДобавлено: 22 сен 2008, 15:56
shtirlitz
Добрый день!
Хочу замерить MRTG стоящем на freebsd загрузку процессора на windows xp.
Выдрал OID на http://support.ipmonitor.com/mibs/WINDO ... cessorTime
1.3.6.1.4.1.311.1.1.3.1.1.7.1.3

при запуске конфига выдает:

Код: Выделить всё
SNMP Error:
2008-09-22 18:58:57: ERROR: Target[cpu_shtirlitz][_IN_] '1.3.6.1.4.1.311.1.1.3.1.1.7.1.3&1.3.6.1.4.1.311.1.1.3.1.1.7.1.3' evaluated to 'дЇ' instead of a number
2008-09-22 18:58:57: ERROR: Target[cpu_shtirlitz][_OUT_] '1.3.6.1.4.1.311.1.1.3.1.1.7.1.3&1.3.6.1.4.1.311.1.1.3.1.1.7.1.3' evaluated to 'дЇ' instead of a number



часть конфига для winxp
Код: Выделить всё
Target[Cpu_shtirlitz]:1.3.6.1.4.1.311.1.1.3.1.1.7.1.3&1.3.6.1.4.1.311.1.1.3.1.1.7.1.3
RouterUptime[CPU_Shtirlitz]: public@192.168.0.8
MaxBytes[CPU_Shtirlitz]: 100
Title[CPU_Shtirlitz]: CPU
PageTop[CPU_Shtirlitz]: <H1>CPU[/H1]
ShortLegend[CPU_Shtirlitz]: %
YLegend[CPU_Shtirlitz]: CPU Utilization
Legend1[CPU_Shtirlitz]: CPU Utilazation in % (Load)
Legend2[CPU_Shtirlitz]: CPU Utilazation in % (Load)
LegendO[CPU_Shtirlitz]: Usage
Options[CPU_Shtirlitz]: gauge, growright


кто-нибудь знает что это за подводный камень?

Re: MRTG часть 2 - восстание машин:)

СообщениеДобавлено: 22 сен 2008, 16:13
root
а почему в Target у тя нет ни хоста ни community ? тока OID и все...
в статье, посмотри внимательно, в примере:
Target[cpu3560]: 1.3.6.1.4.1.9.2.1.58.0&1.3.6.1.4.1.9.2.1.58.0:pub@10.3.1.10:::::2

и сравни со своим
Target[Cpu_shtirlitz]:1.3.6.1.4.1.311.1.1.3.1.1.7.1.3&1.3.6.1.4.1.311.1.1.3.1.1.7.1.3


так же у тя сначала идет "Cpu_shtirlitz", а потом "CPU_Shtirlitz"

должно быть одинаково везде

Re: MRTG часть 2 - восстание машин:)

СообщениеДобавлено: 22 сен 2008, 17:30
shtirlitz
Испарвил конфиг

Код: Выделить всё
Target[CPU_Shtirlitz]:1.3.6.1.4.1.311.1.1.3.1.1.7.1.3&1.3.6.1.4.1.311.1.1.3.1.1.7.1.3:public@192.168.0.8:::::2
RouterUptime[CPU_Shtirlitz]: public@192.168.0.8
MaxBytes[CPU_Shtirlitz]: 100
Title[CPU_Shtirlitz]: CPU
PageTop[CPU_Shtirlitz]: <H1>CPU[/H1]
ShortLegend[CPU_Shtirlitz]: %
YLegend[CPU_Shtirlitz]: CPU Utilization
Legend1[CPU_Shtirlitz]: CPU Utilazation in % (Load)
Legend2[CPU_Shtirlitz]: CPU Utilazation in % (Load)
LegendO[CPU_Shtirlitz]: Usage
Options[CPU_Shtirlitz]: gauge, growright


выдает
shtirlitz# mrtg mrtg.cfg
2008-09-22 20:29:26: ERROR: Target[cpu_shtirlitz][_IN_] ' $target->[3]{$mode} ' did not eval into defined data
2008-09-22 20:29:26: ERROR: Target[cpu_shtirlitz][_OUT_] ' $target->[3]{$mode} ' did not eval into defined data

Re: MRTG часть 2 - восстание машин:)

СообщениеДобавлено: 22 сен 2008, 17:47
shtirlitz
Я вот сейчас полазил mib браузером по windows, и почему-то нашел только ветку 1.3.6.1.4.1 а дальше разветвлений нет.
Может Это поэтому?
И еще я мониторил эту машину c помощью solarwinds через snmp - все нормально показывалось.
Никаких дополнительных вещей я не ставил на машину кроме snmp и загрузка процессора нормально показывалась и все остальное.
А вот через mrtg не могу.

Re: MRTG часть 2 - восстание машин:)

СообщениеДобавлено: 22 сен 2008, 17:56
root
посмотреть что отдается:
Код: Выделить всё
snmpwalk -v2c -c public 192.168.0.8


посмотри отдается ли этот OID вообще:
Код: Выделить всё
snmpwalk -v2c -c public 192.168.0.8 1.3.6.1.4.1.311.1.1.3.1.1.7.1.3

Re: MRTG часть 2 - восстание машин:)

СообщениеДобавлено: 22 сен 2008, 18:01
shtirlitz
Код: Выделить всё
SNMPv2-SMI::enterprises.311.1.1.3.1.1.7.1.3 = No Such Object available on this agent at this OID


неа не отдается,

тогда возникает вопрос, как найти OID который отвечает за cpu

Re: MRTG часть 2 - восстание машин:)

СообщениеДобавлено: 22 сен 2008, 18:15
shtirlitz
snmpwalk делал,
только выдает он несколько тысяч строк. все смотрел, и какие-то пробовал в качестве счетчика процессора,
но что-то не получалось.
есть наверное маленькая хитрость как из этих тысяч вытащить оид нужного девайса :)

Re: MRTG часть 2 - восстание машин:)

СообщениеДобавлено: 23 сен 2008, 08:09
root
под винду подсказать не могу, т.к. не пользуюсь данной OS
могу тока спросить гугла :) и вот что он говорит:
1. http://forums.adventnet.com/viewtopic.php?t=2418
You can find the CPU utilization of windows system by querying the oid .1.3.6.1.2.1.25.3.3.1.2 (.iso.org.dod.internet.mgmt.mib-2.host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad) in HOST-RESOURCES-MIB.
There is no direct OID for getting memory utilization ,However we can obtain the same by querying the OID 1.3.6.1.2.1.25.5.1.1.2 from the same MIB which fetches the individual memory usage of all the process. The sum of these memory usages by the processes divided by the total memory available for processes which can be obtained from the OID .1.3.6.1.2.1.25.2.2,will get you the memory utilization .

Make sure that HOST-RESOURCE-MIB is implemented in your snmp agent . If not, refer the agent documentation as such to know how to load the MIB in your agent.
From the manager stand point you need to use "-m" option for loading MIB's.
For example: java snmpget [-m MIB_files] host OID ,will load MIB file that is mentioned and will perform "snmpget" in the corresponding OID.


2. NET-SNMP Tutorial -- Using local MIBs

3.
Try oid .1.3.6.1.2.1.25.3.3.1.2 for cpu utilization


4.
For Win2K processor load, I am using the hrProcessorLoad entry
(1.3.6.1.2.1.25.3.3.1.2.5) from
.iso.org.dod.internet.mgmt.mib-2.host.hrdevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad.

You need to walk 1.3.6.1.2.1.25.3.3.1.2 to figure out what the instance
should be. On my boxes, it is has consistently been .5.

I have found that you need to multiply Processor Load captures by 100 to
get around MRTG rounding problems. I also seem to remember reading
somewhere that the snmp4w2k MIBs have a problem with multiple processors
but can't remember where I saw that (and I haven't seen any problems on my
multiprocessor boxes).

On my Win2K boxes, 1.3.6.1.4.1.311.1.1.3.1.1.2.1.3.0 is
.iso.org.dod.internet.private.enterprise.microsoft.software.systems.os.windowsNT.performance.cpuprocessorTable.cpuprocessorEntry.cpuPercentProccessorTime

and holds no values when I walk it.


5. http://forums.adventnet.com/
Once more,in windows(2000,xp),the OID of cpu is 1.3.6.1.2.1.25.3.3.1.2 .


6. http://www.netuality.ro/monitoring-windows-servers-with-snmp
For instance, .1.3.6.1.2.1.25.3.3.1.2.1 -> .1.3.6.1.2.1.25.3.3.1.2.4 the OID for CPU load on each of the 4 virtual CPUs [it’s a dual Xeon with HT].
Memory-related OIDs for my configuration are :

* .1.3.6.1.2.1.25.2.3.1.5.6 - Total physical memory
* .1.3.6.1.2.1.25.2.3.1.6.6 - Used physical memory
* .1.3.6.1.2.1.25.2.3.1.6.6 - Total virtual memory [”virtual”=”swap” in Windows lingo]
* .1.3.6.1.2.1.25.2.3.1.6.6 - Used virtual memory


под FreeBSD для графика по CPU использую след. OID:
Код: Выделить всё
Target[cpu]: .1.3.6.1.4.1.2021.11.9.0&.1.3.6.1.4.1.2021.11.9.0:RO-localhost@localhost + .1.3.6.1.4.1.2021.11.10.0&.1.3.6.1.4.1.2021.11.10.0:RO-localhost@localhost

Re: MRTG часть 2 - восстание машин:)

СообщениеДобавлено: 23 сен 2008, 16:43
shtirlitz
нашел, в моем случае это оказался 1.3.6.1.2.1.25.3.3.1.2.3
у меня оказывается под рукой оказался мощный MIB браузер.
От туда выдрал, а те что я скачивал из интернета, как уже говорилось,
не могли зайти в ветку процессоров.

спасибо за участие :))

Re: MRTG часть 2 - восстание машин:)

СообщениеДобавлено: 23 сен 2008, 17:27
root
нзчт ;)

З.Ы. Рассказал бы для "потомков" как и что ты делал на Windows для поднятия этого "безобразия" :)