Back to the list of connectors[1]

WMI - Battery

Description

This connector enables hardware monitoring for batteries of Windows computers.

community[2] hardware[3] windows[4]

Source[5]

Target

Typical platform: Any system

Operating system: Microsoft Windows

Prerequisites

Leverages: WMI

Technology and protocols: WMI/WinRM

Examples

CLI

metricshub HOSTNAME -t win -c +GenBatteryNT --wmi -u USER

metricshub.yaml

resourceGroups:
  <RESOURCE_GROUP>:
    resources:
      <HOSTNAME-ID>:
        attributes:
          host.name: <HOSTNAME> # Change with actual host name
          host.type: win
        connectors: [ +GenBatteryNT ] # Optional, to load only this connector
        protocols:
          wmi:
            username: <USERNAME> # Change with actual credentials
            password: <PASSWORD> # Encrypted using metricshub-encrypt

Connector Activation Criteria

The WMI - Battery connector will be automatically activated, and its status will be reported as OK if all the below criteria are met:

  • Operating System is Microsoft Windows
  • The Windows service WINMGMT is running
  • The WMI query below to the managed host succeeds:
    • Namespace: root\cimv2
    • WQL Query: SELECT DeviceID FROM Win32_Battery

Metrics

Type Collected Metrics Specific Attributes
battery
  • hw.battery.charge
  • hw.battery.time_left
  • hw.status{hw.type="battery", state="degraded|failed|ok"}
  • hw.status{hw.type="battery", state="present"}
  • chemistry
  • hw.parent.type
  • id
  • model
  • name
  • vendor
No results.