2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-29 05:17:50 +00:00

427 Commits

Author SHA1 Message Date
sibeream
a0ef84f658 Flag allow-no-sensors added. 2021-02-24 15:50:14 +01:00
Samuel FORESTIER
ab69812631 Fixes missing Fahrenheit conversion with raw output enabled 2019-10-07 19:30:11 +02:00
Samuel FORESTIER
10c4f2afdf Fixes Fahrenheit missing conversion when data are JSON-formatted 2019-08-21 19:20:46 +02:00
Ondřej Lysoněk
d20ecfd4e8 Fix coding style
Let's use the kernel coding style in lm_sensors.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-07-29 10:38:22 +02:00
Michal Simek
1b8b1bce9e sensors: Scale voltage and current values
scale_value is generic function for scaling values. There is a lower
resolution then json format provides for voltage and current.
The patch is calling scale_value() and showing values with higher
resolution.
For example on Xilinx ZynqMP platform:
ina226-i2c-3-41
Adapter: i2c-0-mux (chan_id 0)
in0:           2.00 mV
in1:         848.00 mV
power1:      287.50 mW
curr1:       330.00 mA

Signed-off-by: Michal Simek <monstr@monstr.eu>
2019-06-20 13:31:52 +02:00
Ondřej Lysoněk
2c8cca3d6c sensors: json: Do not print a stray comma
Previously, if an error happened when reading the value of a subfeature,
subCnt would get incremented and a stray comma would get printed in the
following iteration, even though nothing was printed in the previous
iteration. This would produce a syntactically incorrect JSON.

This is based on a patch from the su8 user on GitHub.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-05-05 11:43:44 +02:00
Ondřej Lysoněk
50f227dafe sensors: json: Skip printing an unnecessary newline
Don't print a newline if no features were printed.

This is based on a patch from the su8 user on GitHub.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-05-05 11:43:44 +02:00
Camille019
c3dc727f5f
sensors: Fix power_common_sensors[] list 2018-11-04 01:24:24 +01:00
Ondřej Lysoněk
6413b80847 Fix stale links
Fixes #8

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2018-09-01 19:38:55 +02:00
Andrew Lunn
dcf23676cc sensors: Add support for power min, lcrit, min_alarm, lcrit_alarm
SFP modules measure the transmit power of the lazer. The sensor has
expected minimum values, and alarms when these minimams are reached.
Add support to sensors to print these.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
2018-06-29 12:29:46 -07:00
Ondřej Lysoněk
40aa494c02 Remove superfluous call to get_input_value()
It is already called in the line above.
Discovered thanks to a Coverity Scan warning.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2018-05-14 08:49:01 -07:00
Ondřej Lysoněk
3b548b74ae Fix a use after free()
The issue was reported by Coverity Scan.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2018-05-14 08:49:01 -07:00
Matthew Tiffany
1b36ea4299 Added feature to sensors to allow json output.
* Added -j option to sensors that outputs json.
* -j option overrides raw option

Signed-off-by: Matthew SL Tiffany <shadethedemon@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-14 08:03:49 -07:00
Jean Delvare
991c8d5f9a sensors.1: Add reference to sensors-detect
Contributed by Aurelien Jarno.
2015-08-10 08:23:41 +00:00
Jean Delvare
69b3b10fa6 sensors: Add support for temp[1-*]_min_hyst and temp[1-*]_lcrit_hyst 2014-04-22 08:09:29 +00:00
Jean Delvare
eb5cf8b2ec Update my e-mail address and copyright years 2014-03-20 10:23:35 +00:00
Jean Delvare
da18d98522 Spelling fixes from Ville Skyttä 2014-01-19 15:59:11 +00:00
Jean Delvare
f915436019 sensors: Clarify what option -u is good for.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6090 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-11-12 09:35:59 +00:00
Jean Delvare
717e87b4d2 Fix % in format.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6086 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-11-06 19:44:01 +00:00
Jean Delvare
6a2798ccc0 sensors/man - missing long switches
Patch from Jaromir Capik.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6076 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-10-22 11:51:27 +00:00
Guenter Roeck
4726e44ab8 sensors: add humidity data to output of sensors command
Patch provided by Iain Paton.



git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6070 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-09-11 19:05:10 +00:00
Jean Delvare
69eb49cb7f sensors: Fix libiconv linkage need detection in rare corner case.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6044 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-04-19 13:13:27 +00:00
Guenter Roeck
107829d11d Fix power interval output
Power interval is measured in seconds, not Watt.



git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6030 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-03-07 16:12:56 +00:00
Jean Delvare
a3e40509e0 Add support for fan[1-*]_max, fan[1-*]_min_alarm and fan[1-*]_max_alarm
attributes. These are defined in the standard sysfs interface for quite
some time, and at least three drivers (max6650, lm63 and applesmc)
implement them so we should support them.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6029 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-03-06 07:34:13 +00:00
Jean Delvare
ffa146909c sensors: Align power values better.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6011 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-01-13 09:41:36 +00:00
Jean Delvare
cd2ff28d7b sensors: Report thermal sensor type 1 as CPU diode.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6010 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-01-13 08:48:55 +00:00
Guenter Roeck
f8b6670e56 sensors: Display both instantaneous and average power
Some sensor chips report both instantaneous and average power.
Add support to display both.



git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6008 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-01-09 18:24:03 +00:00
Guenter Roeck
273102f2c9 Add support for additional sysfs attributes to libsensors and to sensors command
inX_average
inX_lowest
inX_highest
tempX_lowest
tempX_highest
currX_average
currX_lowest
currX_highest




git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6007 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-01-09 17:30:10 +00:00
Guenter Roeck
19fd8481b7 sensors: Use defines for array sizes
Use defines for array sizes. For alarm attributes, take into account that both
the generic alarm flag as well as individual alarm attributes may be provided
by a driver (even though that should not be the case).

Remove overflow checks from get_sensor_limit_data(), as overflows should
no longer happen.



git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6006 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-01-09 17:21:08 +00:00
Jean Delvare
5b0c174640 Ensure that hysteresis and the limit it relates to are always
printed on the same line.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5944 7894878c-1315-0410-8ee3-d5d059ff63e0
2011-03-16 21:31:25 +00:00
Guenter Roeck
57815ea1c7 sensors: Added support for additional sensor attributes
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5943 7894878c-1315-0410-8ee3-d5d059ff63e0
2011-03-16 17:23:33 +00:00
Guenter Roeck
aea4b6cbe8 sensors: If an attribute value is 0, display the value with its base unit,
not with the minumum supported unit.



git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5942 7894878c-1315-0410-8ee3-d5d059ff63e0
2011-03-16 14:55:04 +00:00
Jean Delvare
db88ea2698 sensors: Add support for intrusion detection.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5880 7894878c-1315-0410-8ee3-d5d059ff63e0
2010-11-03 13:01:38 +00:00
Jean Delvare
2a0c688cb8 sensors: Display 3 decimal places in raw output.
This will make it easier for us to help users find out correct scaling
factors when needed. Instead of telling them to go read the raw sysfs
attributes, they can just report the output of "sensors -u -c /dev/null".


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5877 7894878c-1315-0410-8ee3-d5d059ff63e0
2010-11-03 11:59:55 +00:00
Jean Delvare
41a0981e28 Ensure there's at least one space between the label and the value.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5872 7894878c-1315-0410-8ee3-d5d059ff63e0
2010-11-02 12:37:35 +00:00
Jean Delvare
51e4710815 Properly handle read errors from sensor inputs. Report them as "N/A".
This happens with a couple drivers for devices with inputs which
can come and go.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5836 7894878c-1315-0410-8ee3-d5d059ff63e0
2010-05-23 09:04:13 +00:00
Jean Delvare
8416f31add Fix a build warning in set_degstr. The prototype of iconv() is
stupid but won't change so we have to live with it.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5801 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-11-28 12:26:44 +00:00
Jean Delvare
78f496ca62 libsensors: New method to free the memory allocated for the internal
representation of chip names.
sensord, sensors: Fix a memory leak when one or more chip names are
provided on the command line.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5740 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-06-20 10:04:52 +00:00
Jean Delvare
e675ad35c9 Removed trailing semicolon in error string. Patch from Andre Prendel.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5632 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-01-29 09:45:25 +00:00
Jean Delvare
6ed5aa3a0a Consistently use "err" as the variable name to carry error codes.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5628 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-01-28 13:16:17 +00:00
Jean Delvare
496b15a644 Fix exit code in error case (for example no sensors found.) Patch from
Andre Prendel.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5627 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-01-28 13:10:21 +00:00
Jean Delvare
51a621be43 Add support for current sensors.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5379 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-10-24 09:04:26 +00:00
Jean Delvare
d766935c47 Add support for instantaneous power sensors.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5378 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-10-24 09:03:18 +00:00
Darrick J. Wong
f4e4fcd8c1 Subject: [PATCH 3/3 v3]: sensors: Automatically scale energy/power units
Automatically scale energy and power values when printing them in cooked
mode.  Fixed all the warnings and warts that were brought up by Jean in
the previous thread.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>



git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5185 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-04-17 01:30:37 +00:00
Darrick J. Wong
4c93dffd4f Subject: [PATCH 3/4 v2] sensors: Print energy and power meters
Display power and energy meters in sensors.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>



git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5184 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-04-17 01:28:51 +00:00
Jean Delvare
f2e518511d Patch from Aurelien Jarno:
I have just noticed that the FSF address is the old one in all files
except COPYING. Please find a patch below to fix that.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5163 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-03-26 13:37:12 +00:00
Jean Delvare
7a2649483e Fix error path on library initialization error. Only call fclose() if
we have actually opened a configuration file before.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5090 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-01-05 09:14:28 +00:00
Jean Delvare
5b5b1bb3dc Install sensors as sensors again.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4991 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-10-25 10:57:14 +00:00
Jean Delvare
35a5a7dbce Use /etc/sensors3.conf as the default configuration file. If it can't
be found, fallback to /etc/sensors.conf. This allows for an old
libsensors and a new libsensors to be installed in parallel, and each
one has its own configuration file.

One important change here is that the default configuration file will
be installed as /etc/sensors3.conf by "make install".


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4990 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-10-25 09:59:05 +00:00
Jean Delvare
f17e1cf5a8 "sensors" no longer needs a default configuration file name. If no
file name is provided on the command line, use the libsensors default.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4986 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-10-25 09:49:34 +00:00