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/dmidecodehws-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)
 
- Command: 
Metrics
| Type | Collected Metrics | Specific Attributes (Labels) | 
|---|---|---|
| Enclosure | 
 | 
 | 
| Fan | 
 | 
 | 
| Temperature Sensor | 
 |  | 
| Voltage Sensor | 
 | 
 |