WMI - 一般故障
我们有一个 .NET 应用程序,它使用 WMI 收集网络中计算机上的各种信息,例如读取 Win32_NTLogEvent 以查看 Symantec Antivirus 是否写入了任何内容。 查询工作正常,但在重复运行 WMI 查询后,“一般故障”错误将开始出现。 大约在大约之后,这种情况就会非常一致地发生。 125 电话。 重新启动我们正在运行 WMI 查询的计算机,总是会修复错误...直到运行下一个 125 个查询。
看来存储库很好,我们找不到任何日志文件大小问题。
更多信息 - 收到错误后运行 WMIDiag 并发现 -
25607 13:55:38 (1) !! 错误:报告 WMI 枚举操作错误:2 个错误!
25608 13:55:38 (0) ** - ROOT/CIMV2、SubClassesOf、'*'、0x80041006 - (WBEM_E_OUT_OF_MEMORY) 内存不足用于操作。
25609 13:55:38 (0) ** MOF 注册:'C:\WINNT\SYSTEM32\WBEM\SNMPREG.MOF ' 25610 13:55:38 (0) ** - Root/CIMv2、InstancesOf、'Win32_PerfFormattedData_PerfProc_Thread'、0x8007000E - 没有足够的存储空间来完成此操作。25611
13:55:38 (0) ** MOF 注册:' C:\WINDOWS\SYSTEM32\WBEM\WMI.MOF'
有人见过这个吗? 有想法吗?
We have a .NET application that uses WMI to gather a wide range of information on machines throughout a network, such as reading the Win32_NTLogEvent to see if Symantec Antivirus has written anything. The queries work fine, but after repeatedly running a WMI query "Generic Failure" errors will start coming back. This happens very consistently after approx. 125 calls. Rebooting the machine that we are running the WMI query against, always fixes the error... that is until the next 125 queries are run.
It appears that the repository is fine and we can't locate any log file size issues.
More Info - Ran WMIDiag after getting the error and found -
25607 13:55:38 (1) !! ERROR: WMI ENUMERATION operation errors reported: 2 ERROR(S)!
25608 13:55:38 (0) ** - ROOT/CIMV2, SubClassesOf, '*', 0x80041006 - (WBEM_E_OUT_OF_MEMORY) Not enough memory for the operation.
25609 13:55:38 (0) ** MOF Registration: 'C:\WINNT\SYSTEM32\WBEM\SNMPREG.MOF
'
25610 13:55:38 (0) ** - Root/CIMv2, InstancesOf, 'Win32_PerfFormattedData_PerfProc_Thread', 0x8007000E - Not enough storage is available to complete this operation..
25611 13:55:38 (0) ** MOF Registration: 'C:\WINDOWS\SYSTEM32\WBEM\WMI.MOF'
Anyone ever see this? Ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我们多次在不同的 WMI 查询中看到“一般失败”错误,因此我们基本上得出这样的结论:WMI 不够稳定,无法用于原始管理以外的任何用途。 经过几个月的折腾,我们唯一的解决方案是提取所有 WMI 调用并在纯 API 调用中寻找替代品。 他们总是会工作一段时间,然后因“通用错误”而失败(我知道这不是一个答案,但这是一个共同的经验,如果有人有答案,我会很高兴听到它)。
We saw the "Generic Failure" error so many times with different WMI queries that we basically came to the conclusion that WMI isn't stable enough to use for anything other than raw administration. Our only solution after months of messing around was to pull all the WMI calls and find replacements in pure API calls. They would always work for a while, and then fail with "Generic Error" (I know this isn't an answer, but it is a shared experience and if anyone has an answer I would be very happy to hear about it).
我相信我们已经找到问题了。 为了简化我们的一些查询,我们在 where 子句中添加了类似 1=1 的内容,以简化查询的构建。 删除了constant=constant,我测试的一个查询从 40 秒缩短到 0.4 秒,并且运行了 10,000 多次,没有产生一般故障 (WBEM_E_OUT_OF_MEMORY)。
I believe we have found the issue. To simplify some of our queries we were adding something like 1=1 in the where clause to ease the building of the query. Removed the constant=constant and the one query I was testing with went from 40 seconds to .4 seconds and has run over 10,000 times without generating a generic failure (WBEM_E_OUT_OF_MEMORY).
Windows 远程管理 (WinRM) 可以克服所有这些问题。
WinRM 是 WS 管理协议的 Microsoft 实现,该协议是基于标准简单对象访问协议 (SOAP) 的。
Windows Remote Management (WinRM) may overcome all these problems.
WinRM is the Microsoft implementation of WS-Management Protocol, a standard Simple Object Access Protocol (SOAP)-based.
当我尝试通过 WMI 在远程计算机上卸载/安装软件时,我遇到了类似的问题。
当您的漫游配置文件存在于目标计算机上时,就会出现问题。 这可能是由于之前查询了目标计算机上的 WMI。
我不知道这是否是同一问题,但在尝试卸载软件之前,我必须检查我的配置文件是否位于目标计算机上的“文档和设置”文件夹中。
我假设当您运行查询时,它会在本地计算机上创建您的配置文件。
每当我尝试在以前远程工作的计算机上卸载软件时,我都会收到一条通用失败消息。
现在,我确保在尝试远程卸载/安装软件组件之前,我的配置文件已从目标计算机中删除。 从那以后我就没遇到过任何问题。
希望这对任何人都有帮助。
I had a similar problem to this when attempting to uninstall / Install software on remote machines via WMI.
The problem arises where your roaming profile is present on the target machine. This can be due to having previusly queried the WMI on the target machine.
I dont know if this is the same issue, but I have to had to put a check in place to see if my profile is in the Documents and Settings folder on the target machine before i attempt to uninstall the software.
I'm assuming that when your running your query's its creating your profile on the local machine.
I got a Generic Failure message any time I had attempted to uninstall software on a machine I'd previously worked on remotley.
Now i ensure that before I attempt to uninstall / Install software components remotley, that my profile is removed form the target machine. I've had no problems since.
Hope this helps anyone.