Back to the list of connectors

lm_sensors

Description

Provides the monitoring environment sensors on Linux, through the sensors command.

Connector ID: lmsensors

Target

Typical platform: Any system

Operating system: Linux

Prerequisites

Leverages: lm_sensors

Technology and protocols: System Commands

This connector requires advanced privileges on the managed host for the commands below:

  • /usr/bin/sensors
  • /usr/sbin/dmidecode

This connector therefore needs to run as root or you need to configure a privilege-escalation mechanism like sudo on the managed host to allow the monitoring account to run the commands listed above.

Sample of /etc/sudoers to allow the above commands to be run as root by the hwsagent account:

hwsagent ALL=(root) NOPASSWD: /usr/bin/sensors
hwsagent ALL=(root) NOPASSWD: /usr/sbin/dmidecode

Examples

CLI

hws HOSTNAME -t linux -f lmsensors --ssh -u USER --sudo-command-list /usr/bin/sensors,/usr/sbin/dmidecode

hws-config.yaml

hosts:
- host:
    hostname: <HOSTNAME> # Change with actual host name
    type: linux
  selectedConnectors: [ lmsensors ] # Optional, to load only this connector
  ssh:
    username: <USERNAME> # Change with actual credentials
    password: <PASSWORD> # Encrypted using hws-encrypt
    useSudo: true
    useSudoCommands: [ "/usr/bin/sensors", "/usr/sbin/dmidecode" ]

Connector Activation Criteria

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

  • Operating System is Linux
  • The command below succeeds on the monitored host
    • Command: /usr/bin/sensors -h
    • Output contains: Usage: sensors (regex)

Metrics

Type Collected Metrics Specific Attributes (Labels)
Enclosure
  • hw.status{hw.type="enclosure",state="present"}
  • bios_version
  • serial_number
  • type
  • vendor
Fan
  • hw.fan.limit{limit_type="high.critical"}
  • hw.fan.limit{limit_type="high.degraded"}
  • hw.fan.speed
  • hw.status{hw.type="fan",state="present"}
  • sensor_location
Temperature Sensor
  • hw.status{hw.type="temperature",state="present"}
  • hw.temperature
  • hw.temperature.limit{limit_type="high.critical"}
  • hw.temperature.limit{limit_type="high.degraded"}
    Voltage Sensor
    • hw.status{hw.type="voltage",state="present"}
    • hw.voltage
    • hw.voltage.limit{limit_type="high.critical"}
    • hw.voltage.limit{limit_type="low.critical"}
    • sensor_location
    No results.