Laptop Battery checks

Hi , i am trying to fetch some useful info for laptop battery status and found below analysis but most of them are not working ,

https://bigfix.me/analysis/details/2994755

for example the below relevance is not working:-1:
% battery life in capacity
Period 1 day

 	* Results in a true/false
Show indented relevance
if not exists (selects "FullChargeCapacity from DCIM_Battery" of wmis "root\dcim\sysman") then ERROR "UNKNOWN" else ( (item 0 of it * 100 / item 1 of it) of (integer value of property "FullChargeCapacity" of it, integer value of property "DesignCapacity" of it) of select objects "* from DCIM_Battery" whose(exists integer values of properties "FullChargeCapacity" of it AND exists integer values of properties "DesignCapacity" of it) of wmis "root\dcim\sysman" )

E: User-defined error: UNKNOWN

That WMI provider (root\dcim\sysman) is not a standard WMI namespace, it’s a capability added by the Dell OpenManage software. Are these laptops Dell, and is OpenManage installed?

See https://www.dell.com/community/Systems-Management-General/root-dcim-sysman-missing/td-p/4356808 for a thread where OpenManage may not register the WMI provider (but I didn’t see a great resolution on it)

thanks for the reply, i have few laptop with Dell and others are hp. there is no open manage installed on it.

Look in the Win32_Battery class, there is some battery data in there.

(if (exists wmi whose (exists selects "* from win32_Battery" of it OR exists string value whose (it as lowercase contains "laptop") of selects "ChassisTypes from Win32_SystemEnclosure" of it)) then (relative significance places 2 of (100 - (((string value of select "FullChargedCapacity from BatteryFullChargedCapacity" of wmi "root\WMI" as integer as floating point / string value of select "DesignCapacity from Win32_PortableBattery" of wmi as integer as floating point) * 100))) as string) else ("NoBatteryWMI") | "#Error")

1 Like

thanks…