Read your blog about the new Battery Sensor and had to have a bit of a laugh to myself about the section 'Add and Configure the Sensor' which said "Nothing could be easier" because every server we try it on gives us the error "80041010: The specified class is not valid".

We are running version 19.4.53.1912 of PRTG and have Windows credentials in the settings of the parent device. All the servers we are trying to monitor have an APC UPS.

What do we have to do to resolve this?


Article Comments

Hello Jason,

APC UPS is a different kind of beast, please see here.

Kind regards,

Erhard


Nov, 2019 - Permalink

Hi Erhard

The link takes me to the blog I was referring to in my original post.

In it it says you can use the battery sensor to monitor "Uninterruptible power supplies connected via USB" which is exactly what I am trying to do!


Nov, 2019 - Permalink

Sorry, I fixed the link shortly after publishing my answer, you were just too fast ;)


Nov, 2019 - Permalink

This is the query the sensor is running: SELECT InstanceName, ManufactureName, DeviceName, DesignedCapacity FROM BatteryStaticData

Most likely there is nothing coming back, that's why the sensor does not work, you can run the query for example with our WMI Tester and let me know what you get there.

Kind regards,

Erhard


Nov, 2019 - Permalink

I want to check I'm doing this correctly. I have run WMITest, chosen advanced and pasted in your query above. That is correct?

I tried this on Windows 2016 and Windows 2019 servers with USB connected UPS and got the same error "80041010: The specified class is not valid". I'm no expert on WMI but I presume this means that BatteryStaticData doen't exist?

For a comparison I did the same thing on my Windows 10 laptop (which obviously has an actual battery) and I got the same error! I assume that the query should work on my laptop.

Thanks for the link about setting up monitoring with a powershell script. It will be useful if this sensor doesn't work with USB connected UPS but obviously takes quite a bit more work to deploy and I would prefer to use a 'proper' sensor for longer term reliability and support.


Nov, 2019 - Permalink

Hi Jason,

Yes, you did it correct, it's easiest to run the test locally on the target machine, that way you also do not need to pass along credentials. Mistake on my end: On WMI Tester's tab "Advanced" namespace is by default set to "root\cimV2", you need to change that to "root\WMI" (without quotes), then try again.

If it still does not work, try this on the target server:

  • Stop the Windows Management Instrumentation service
  • Open command prompt, run the following commands:
    • winmgmt /resyncperf.
    • wmiadap.exe /f.
  • Start the Windows Management Instrumentation service and check again.

Kind regards,

Erhard


Nov, 2019 - Permalink

Hi Erhard

I've changed to root\WMI and now get some values returned on the laptop.

Unfotunately there is no change on the servers, even after running the suggested command prompt commands.


Nov, 2019 - Permalink

Hello Jason,

Hm, then it appears the operating system does not recognize the usb connected UPS in order to add it to this WMI section, eventually the vendor has further input about this.

Kind regards,

Erhard


Nov, 2019 - Permalink