2

On of my Nagios plugins to monitor the network load gives me problems on one Windows 2008 R2 server (out of 600). You can download the plugin here: https://github.com/willemdh/check_ms_win_network_load

The problem happens while trying

Get-WmiObject Win32_PerfFormattedData_Tcpip_NetworkInterface

Which results in:

Get-WmiObject : Invalid class "Win32_PerfFormattedData_Tcpip_NetworkInterface"
At line:1 char:1
+ Get-WmiObject Win32_PerfFormattedData_Tcpip_NetworkInterface
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidType: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

The issue started happening when the network card was replaced in VMware from "E1000" to "VMXNET 3". As I suspected WMI issues, i already tried the following steps to try solve it:

winmgmt /salvagerepository %windir%\System32\wbem

winmgmt /resetrepository %windir%\System32\wbem

Rename the repository folder located at %windir%\System32\wbem\repository to repository.old

winmgmt /resyncperf

wmiadap /f

wmiadap /r

Between each of the above steps I stopped WMI and rebooted the server. Nothing helped. What else could be I do so I can query Win32_PerfFormattedData_Tcpip_NetworkInterface class again?

willemdh
  • 245
  • 4
  • 14
  • Did you try rebuilding the network adapter in the VM? – Colyn1337 Feb 10 '16 at 03:42
  • What do you mean wth rebuild? Remove the network card and re-add it one more time? Like we did before the problems started? – willemdh Feb 10 '16 at 10:12
  • [Rebuilding the WMI Repository](https://blogs.technet.microsoft.com/askperf/2009/04/13/wmi-rebuilding-the-wmi-repository/) or [Invalid WMI Class](https://blogs.technet.microsoft.com/askperf/2014/08/11/wmi-missing-or-failing-wmi-providers-or-invalid-wmi-class/) or … – JosefZ May 15 '16 at 20:58

1 Answers1

0

AFAIK Win32_PerfFormattedData_Tcpip_NetworkInterface class depends on PerfLib. Did you check how your performance counters were set for this server? Try re-creating the performance counter.

Try this:

(get-counter -ListSet 'network adapter').Counter

or this for win7 and earlier:

(get-counter  -ListSet 'network interface').Counter

Run the perfmon and look for the counters for the net adapter.