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?