New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


WMI : 80041014: A component, such as a provider, failed to initialize for internal reasons.

Votes:

0

Your Vote:

Up

Down

Hello,

I'm trying to use WMI Custom Sensor to get the space used by VSS Shadow copies on our servers (2012 R2). I'm running this WMI query with the sensor : SELECT UsedSpace FROM Win32_ShadowStorage

When I use this query locally on one of the servers that I want to monitor, I get a result in bytes.

But with the sensor, as with PRTG's WMI tester tool, I get this error : 80041014: A component, such as a provider, failed to initialize for internal reasons.

Other WMI sensors (eventlog, logical disk) just works well on those devices.

I've tried to modify the namespace parameter on the sensor from root\cimv2 to nothing (blank field) : no more result.

Can someone tell me what I'm doing wrong ?

Regards

vss windows-2012-r2 wmi wmi-custom-sensor

Created on Apr 11, 2017 6:47:56 AM by  klmj (0) 2



8 Replies

Votes:

0

Your Vote:

Up

Down

In the mean time, I'm using this powershell script to get the result, devices must have WinRM configured :

param(
    # must me a resolvable hostname (Netbios or DNS)
    [Parameter(Position=0)]
    [string]
    $ComputerName = 'nvsrv2doma.cciag.lan',
    
    # WMI query to be run on the server, must return only one value
    [Parameter(Position=1)]
    [string]
    $Query = "SELECT UsedSpace FROM Win32_ShadowStorage"
)

# Error handling
trap{
    if($RemoteSession){Remove-PSSession -Session $RemoteSession}
    # Return value 0 and error message
    "0:$($_.ToString())"
    exit 2
}

# PS-remoting on server
$RemoteSession = New-PSSession -Authentication Kerberos -ComputerName $ComputerName

# run WMI query in remote session
$result = Invoke-Command -Session $RemoteSession -ScriptBlock {param ($wql) Get-WmiObject -Query $wql} -ArgumentList $Query -ErrorAction Stop
Remove-PSSession -Session $RemoteSession

# set result
$PropName = $result | gm | where MemberType -eq Property | where name -NotMatch "__" | select -expand name
$result = Invoke-Expression "`$result.$PropName"

# Return result and error code
"$($result/1Gb):Ok"
exit 0

Created on Apr 11, 2017 9:12:05 AM by  klmj (0) 2



Votes:

0

Your Vote:

Up

Down

Hello there,

Did you check out this article from Microsoft already?

Kind regards,

Erhard

Created on Apr 11, 2017 3:09:03 PM by  Erhard Mikulik [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hello Erhard,

Thank you for the link, I've tried both workarounds of sections "I’m getting an 0x80041013 (“Provider not found”) or an 0x80041014 (“Component failed to initialize) error" and "I’m getting an error regarding provider registration" without success.

Furthermore, I've made new test with PowerShell locally on those devices : I've run the following command in normal and in elevated prompt : Get-WmiObject -Query "SELECT UsedSpace FROM Win32_ShadowStorage"

I only get result in elevated prompts, in normal prompt I got the following error : Get-WmiObject : Initialization failure At line:1 char:1 + Get-WmiObject -Query "SELECT UsedSpace FROM Win32_ShadowStorage" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

So I think this issue is related to UAC.

On our PRTG's server, I run successfully this command in a PowerShell prompt run-as with credentials I set in PRTG (where 'DEVICE' is the name of the remote server I try to monitor.) : Get-WmiObject -Query "SELECT UsedSpace FROM Win32_ShadowStorage" -ComputerName DEVICE

I've tried to put It in a script :

param(
    # must me a resolvable hostname (Netbios or DNS)
    [Parameter(Position=0)]
    [string]
    $ComputerName = 'DEVICE',
    
    # WMI query to be run on the server, must return only one value
    [Parameter(Position=1)]
    [string]
    $Query = "SELECT UsedSpace FROM Win32_ShadowStorage",

    # WMI result modifier
    [Parameter(Position=2)]
    [string]
    $ResultModifier = "/1Gb"
)

# Error handling
trap{
    # Return value 0 and error message
    "0:$($_.ToString())"
    exit 2
}

# run WMI query
$result = Get-WmiObject -Query $Query -ComputerName $ComputerName -ErrorAction Stop

# set and transfrom result
$PropName = $result | gm | where MemberType -eq Property | where name -NotMatch "__" | select -expand name
$result = Invoke-Expression "`$result.$PropName"
$result = Invoke-Expression "`$result$ResultModifier"

# Return result and error code
"$($result):Ok"
exit 0

But PRTG return "System Error: Initialization failure (code: PE022)"

Note that I've successfully run the script of my previous post on the same device, with same credentials.

This script run successfully in a PowerShell prompt run-as with credentials I set in PRTG, on the PRTG's server.

It seems that there is an issue with WMI related functionality handling by PRTG and UAC...

Regards

EDIT It seems that the markup parser do not like my piece of code ^.^'

EDIT BY MOD: Fixed :)

Created on Apr 13, 2017 9:39:28 AM by  klmj (0) 2

Last change on Apr 19, 2017 9:14:09 AM by  Konstantin Wolff [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi,
are both machines (Probe and target) in the same domain? Do you have tried passing a Credential Object with the WMI Query?
This could be done with something like:

$password = "YOURPASSWORD" | ConvertTo-SecureString -AsPlainText -Force
$credentials = New-Object System.Management.Automation.PSCredential(("{0}\{1}" -f ,"YOURDOMAIN", "YOURUSER"), $password)

# run WMI query
$result = Get-WmiObject -Query $Query -ComputerName $ComputerName -ErrorAction Stop -Credential $credentials

Created on Apr 19, 2017 9:19:51 AM by  Konstantin Wolff [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi Konstantin,

  1. Yes, both machines are in the same domain.
  2. No, but I've done it by integrating your piece of code to my script.

Same results :

  • From ISE/Powershell the WMI request return good result.
  • From PRTG "System Error: Initialization failure (code: PE022)".



Regards.

PS : Thank you for the code formatting ;)

Created on Apr 19, 2017 10:58:59 AM by  klmj (0) 2



Votes:

0

Your Vote:

Up

Down

Hey,
my apologies for the delay. There could be an issue with the permissions of the calling process, which in this case would be the PRTG Probe (which is running with the local SYSTEM account). Could you try letting the probe run under a different user account?
Preferably one which is part of the local Administrator group?
Best
Konstantin

Created on Apr 25, 2017 1:42:44 PM by  Konstantin Wolff [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi,

I've try to modify the account running Probe's service, now it is running with the same account as the one used in credentials in my previous tests.

As a result, all of my 3 sensors are now down, with new error messages :

DescriptionSensorNameMessage
WQL queryWMI Custom UsedSpace from Win32_ShadowStorage80041014: A component, such as a provider, failed to initialize for internal reasons.
First scriptEXE VSS Shadows used spaceA required privilege is not held by the client. (0x522)
Second scriptCustom EXE/Script SensorA required privilege is not held by the client. (0x522

All my others sensors (3958 on this probe) just work fine.

Then I've modified the security context of my EXE/Script sensors, from Use Windows credentials of parent device to Use security context of probe service. They both now work as before :

DescriptionSensorNameMessage
First scriptEXE VSS Shadows used spaceOK
Second scriptCustom EXE/Script SensorSystem Error: Initialization failure (code: PE022)



Regards.

Created on Apr 27, 2017 9:11:56 AM by  klmj (0) 2

Last change on Apr 27, 2017 11:14:28 AM by  Luciano Lingnau [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hey,
could you possibly open up a support ticket and forward us the System Logs as well as the Sensor Results. You can set the sensor to write results on tab Settings. There just switch the Result Handling Option to Write to Disk.
This will create the sensor logs under <prtg_data_directory>\Logs (Sensors). Just forward us those for the sensors affected.
Best Konstantin

Created on Apr 27, 2017 2:27:31 PM by  Konstantin Wolff [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.