Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 759595

Summary: net-analyzer/icinga2-2.12.1 with broken check-lmsensors
Product: Gentoo Linux Reporter: onkobu
Component: Current packagesAssignee: Matthew Thode ( prometheanfire ) <prometheanfire>
Status: UNCONFIRMED ---    
Severity: normal CC: jstein
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description onkobu 2020-12-12 13:23:02 UTC
File /usr/share/icinga2/include/plugins-contrib.d/hardware.conf contains a CheckCommand "lmsensors" which points to check_lmsensors. The ebuild/ package itself does not list such a file. Neither does it exist in /usr/lib64/nagios/plugins/ which seems to be PluginContribDir.

When using this check command for example in a service it only complains about the non-existing command:

execvpe(/usr/lib64/nagios/plugins/check_lmsensors) failed: No such file or directory

Also monitoring-plugins does not provide such a file/ command. I didn't check with nagios-plugins because it is blocked by monitoring-plugins.

In addition I'm certain that the official command[1] does not work at all. I filed a pull request to fix two issues. Now I have it up and running locally.

[1] https://icinga.com/docs/icinga-2/latest/doc/10-icinga-template-library/#lmsensors

Reproducible: Always

Steps to Reproduce:
1. enable check command lmsensors from command definition
2. reload icinga2
3. output of service reads: No such file or directory
Actual Results:  
Check command is not found.

Expected Results:  
Check command exists and yields temperature output.

Either there is no such CheckCommand-definition at all or if there is one it must work.
Comment 1 onkobu 2020-12-12 13:27:35 UTC
A sample service configuration (/etc/icinga2/conf.d/services.conf):

apply Service "lmsensors" {
  import "generic-service"
  check_command = "lmsensors"

  # pick any sensor name from output of command sensors
  vars.lmsensors_sensor = "k10temp-pci-00c3,CPU"

  assign where host.name == NodeName
}

This binds the check command to the "object Host NodeName {…}" - definition from /etc/icinga2/conf.d/hosts.
Comment 2 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2020-12-13 01:08:30 UTC
Do you have a link to the pull request?  It's possible I could include it in a revbump of the existing package while waiting for upstream to merge it.
Comment 3 onkobu 2020-12-25 19:47:37 UTC
I need to split it first since it suffers from two problems. Making argument order irrelevant is a cheap one. Filtering the value from sensors output is a bit harder. Output seems to differ between distributions, e.g. multi column instead of multi row.

Feel free to incorporate the full blob if you're in a hurry. (I wouldn't be surprised if I'm the only one left using Icinga2 with such features.)

https://github.com/jackbenny/check_temp/pull/7