Всем привет.
Я сделал WSH-скрипт, который по SNMP считывает параметры активного оборудования D-Link используя WMI SNMP Provider.
Вот только надо теперь создать соответствующие WMI-пространства имен в root\snmp
Согласно вот этой инструкци
http://msdn.microsoft.com/en-us/library/aa393621(VS.85).aspx пытаюсь скомпилировать mib'ы свитчей D-Link. Например для компиляции mib-файла dlkAgent.mib ввожу такю комманду:
Code Snippetsmi2smir /v2c /i "C:\Program Files\D-Link\D-Link SNMP Solutions\SMIDB" /g dlkAgent.mib > dlkAgent.mof
Комманда выдает вот такой результат:
Code Snippetsmi2smir : Version : MIB definitions compiled from "dlkAgent.mib"
<235,Warning>: "dlkAgent.mib" (line 1, col 49): Unrecognized character in input, ignored. "(null)"
<235,Warning>: "dlkAgent.mib" (line 2, col 50): Unrecognized character in input, ignored. "(null)"
<235,Warning>: "dlkAgent.mib" (line 6, col 202): Unrecognized character in input, ignored. "(null)"
<235,Warning>: "dlkAgent.mib" (line 7, col 49): Unrecognized character in input, ignored. "(null)"
<235,Warning>: "dlkAgent.mib" (line 10, col 164): Unrecognized character in input, ignored. "(null)
"<235,Warning>: "dlkAgent.mib" (line 15, col 304): Unrecognized character in input, ignored. "(null)
"<1031,Warning>: "dlkAgent.mib" (line 28, col 8): Standard symbol "IpAddress" should be imported from
module "RFC1155-SMI" or "SNMPv2-SMI". Assuming the standard definition
<1031,Warning>: "dlkAgent.mib" (line 32, col 8): Standard symbol "DisplayString" should be imported
from module "RFC1213-MIB" or "SNMPv2-TC". Assuming the standard definition
smi2smir : Syntax Check successful on "dlkAgent.mib"
<1070,Fatal>: "dlkAgent.mib" (line 34, col 8): MIB Module "DLINK-ID-REC-MIB", from which symbol "dli
nk-common-mgmt" is IMPORTed, is not present in the input
<1080,Warning>: "dlkAgent.mib" (line 28, col 8): MIB Module "RFC1155-SMI", from which symbol "IpAddr
ess" is IMPORTed, is not present in the input
<1080,Warning>: "dlkAgent.mib" (line 32, col 8): MIB Module "RFC1213-MIB", from which symbol "Displa
yString" is IMPORTed, is not present in the input
<1080,Warning>: "dlkAgent.mib" (line 33, col 8): MIB Module "DLINK-ID-REC-MIB", from which symbol "A
gentNotifyLevel" is IMPORTed, is not present in the input
<1070,Fatal>: "dlkAgent.mib" (line 34, col 8): MIB Module "smi2smir : Version : MIB definitions compiled from "dlkAgent.mib"
<235,Warning>: "dlkAgent.mib" (line 1, col 49): Unrecognized character in input, ignored. "(null)"
<235,Warning>: "dlkAgent.mib" (line 2, col 50): Unrecognized character in input, ignored. "(null)"
<235,Warning>: "dlkAgent.mib" (line 6, col 202): Unrecognized character in input, ignored. "(null)"
<235,Warning>: "dlkAgent.mib" (line 7, col 49): Unrecognized character in input, ignored. "(null)"
<235,Warning>: "dlkAgent.mib" (line 10, col 164): Unrecognized character in input, ignored. "(null)
"<235,Warning>: "dlkAgent.mib" (line 15, col 304): Unrecognized character in input, ignored. "(null)
"<1031,Warning>: "dlkAgent.mib" (line 28, col 8): Standard symbol "IpAddress" should be imported from
module "RFC1155-SMI" or "SNMPv2-SMI". Assuming the standard definition
<1031,Warning>: "dlkAgent.mib" (line 32, col 8): Standard symbol "DisplayString" should be imported
from module "RFC1213-MIB" or "SNMPv2-TC". Assuming the standard definition
smi2smir : Syntax Check successful on "dlkAgent.mib"
<1070,Fatal>: "dlkAgent.mib" (line 34, col 8): MIB Module "DLINK-ID-REC-MIB", from which symbol "dli
nk-common-mgmt" is IMPORTed, is not present in the input
<1080,Warning>: "dlkAgent.mib" (line 28, col 8): MIB Module "RFC1155-SMI", from which symbol "IpAddr
ess" is IMPORTed, is not present in the input
<1080,Warning>: "dlkAgent.mib" (line 32, col 8): MIB Module "RFC1213-MIB", from which symbol "Displa
yString" is IMPORTed, is not present in the input
<1080,Warning>: "dlkAgent.mib" (line 33, col 8): MIB Module "DLINK-ID-REC-MIB", from which symbol "A
gentNotifyLevel" is IMPORTed, is not present in the input
<1070,Fatal>: "dlkAgent.mib" (line 34, col 8): MIB Module "DLINK-ID-REC-MIB", from which symbol "dli
nk-common-mgmt" is IMPORTed, is not present in the input
smi2smir : Could not resolve one or more symbols in "dlkAgent.mib"", from which symbol "dlink-common-mgmt" is IMPORTed, is not present in the input
smi2smir : Could not resolve one or more symbols in "dlkAgent.mib"
Пытался скомпилировать файл DLINK-ID-REC-MIB.mib получил следующее:
Code Snippetsmi2smir : Version <UnknownVersion> : MIB definitions compiled from "DLINK-ID-REC-MIB.mib"
smi2smir : Syntax Check successful on "DLINK-ID-REC-MIB.mib"
<1048,Warning>: "DLINK-ID-REC-MIB.mib" (line 28, col 4): Value dlink-mgmt defined, but not referenced
<1048,Warning>: "DLINK-ID-REC-MIB.mib" (line 27, col 4): Value dlink-products defined, but not referenced
<1048,Warning>: "DLINK-ID-REC-MIB.mib" (line 29, col 4): Value dlink-common-mgmt defined, but not referenced
<1085,Warning>: "DLINK-ID-REC-MIB.mib" (line 11, col 398): No Groups found in module "DLINK-ID-REC-M
IB". Could not fabricate MODULE-IDENTITY. Attempt to load the module into the SMIR will fail.
smi2smir : Semantic Check successful on "DLINK-ID-REC-MIB.mib"
smi2smir: Could not generate MOF
Как я понимаю, судя по ошибкам, при компиляции данных mib'ов не хватает каких-то данных, которые находятся в других mib-файлах, хотя я задавал ключ:
/i "C:\Program Files\D-Link\D-Link SNMP Solutions\SMIDB"
Никто не подскажет как решить эту проблему ?