The

KLM

Manual

Copyright (C) 1998 Brendon Humphrey
brendy@swipnet.se

This software is released under the GPL, see the file COPYING for details.


This simple manual refers to klm 0.5.0



 

Introduction


Klm is a KDE application that can be used to display and configure the hardware health monitoring sensors that are present in most modern PCs. Klm uses the lm sensors kernel module to access these sensors. Klm supports sensors readouts from any of the sensors supported by lm_sensors.

The lm_sensors module is available from http://www.netroedge.com/~lm78 and is maintained by the following people:

Alexander Larsson (alla@lysator.liu.se)
Frodo Looijaard (frodol@dds.nl)
Philip Edelbrock (phil@netroedge.com)

Thanks for such a great sensor package guys.

KLM Home Page


The Klm homepage is http://synergy.linuxbox.com/klm_home.html


Starting KLM

Klm is started by clicking the icon in the utilities menu as shown in Figure 1. Klm is launched as a docked application - no main window will be displayed until you click in on the docked temperature readout in the KDE panel. KDE recognizes klm as a restorable application, so if klm is running when you log out, it will be automatically restarted next time that you log in.



Dock Widget

Figure 1: Dock Widget in normal operation.



Figure 2: Dock widget reporting fault.



KLM maintains a small widget docked into your panel. The number displayed in the dock widget is the output of one of the temperature sensors on your motherboard. If you have more than one temperature sensor in your machine, every five seconds klm will shift to displaying a different temperature sensor. If you place the mouse over the dock widget, then after a short delay a tool tip will appear, containing the name of the sensor being displayed.

Normally, when no alarms are being reported by klm, the dock widget will be displayed as per Figure 1. If an error has been detected by klm, the dock widget will look like Figure 2. You computer will also beep every five seconds.



Main Window




Figure 3. Default klm display (all detected sensors)



The first time you start klm, the main window will look similar to Figure 3. You may have more or less sensors displayed, depending on the health monitoring hardware that is present in your PC. In the shot below (taken on my machine which has an ABIT BH6 motherboard) there are twelve sensors visible. All of these are read from the single LM79 chip on my motherboard. Most other machines have at least one LM75 temperature sensor in addition to an LM78/LM79. The presence of one or more LM75 chips will result in more temperature outputs being displayed.


 

Figure 4. Brendons standard klm configuration


Normally I am only interested in seeing the temperature of my motherboard and the RPM performance of the only monitored Fan that I have in my machine. All sensors that I do not wish to view or monitor are turned off, resulting in the much smaller display at Figure 4.


Sensor Display

Figure 5. Two Sensors - one fault, one normal.



Each bar graph in the klm window represents a single hardware health monitoring sensor output from your motherboard.

Typically a sensor has a 'normal' zone which is denoted by a minimum and maximum figure. The 'normal' zone is represented in the background of the bar graph. The faint red area is outside of the 'normal' zone, and the green area is inside the normal zone.

Each sensor graph is updated every five seconds when the klm window is visible. Every time that klm reads a sensors status, the normal zone is redefined using data from the lm_sensors module. Sensor output value is then plotted on the bar graph. If the bar graph falls within the normal zone it is plotted in green, otherwise it is plotted in red. A numeric representation of the sensor reading is displayed above the bar graph. At the bottom of the bar graph the sensors name is displayed.

Figure 5 contains a sensor that is reporting an error and one which is operating normally.



Configuring Sensors



Figure 6. Sensor in configuration mode.
 

Sensor displays have two modes of operation - normal mode (as seen in previous examples) and configuration mode, as shown by figure 6. Each sensor is completely independent of its peers, meaning that multiple sensors can be in configuration mode at the same time. Sensors are toggled between normal operation and configuration mode by clicking on the graph with the middle mouse button.

Configuration mode is only available if klm is running with sufficient permissions to successfully modify kernel parameters using sysctl(). For most of us this means klm must be installed setuid root.

Depending on the type of sensor that a graph represents, there are up to six configurable items per graph.

The single most important thing to remember when configuring sensors through klm, is that for every change you attempt to make, klm submits the change to lm_sensors, and then reads back the configuration and presents it to you. If you try to change something and it does not, then lm_sensors has rejected the change or klm is not running as root.

Using the arrows to the left of the graph, you can raise and lower the range of the Y axis. Clicking the up arrow will cause the range to be increased, thereby causing the bar graph height to be reduced. Clicking the down arrow has the opposite effect. The up and down buttons auto repeat. The results of the scaling operation are reported in the status bar.

The lower set of arrows to the right of the graph are used to alter the scaling values for the sensors that support such configuration items. Temperature units cannot be scaled. Fans have discrete divider settings - 1, 2, 4, and 8. Voltage inputs can be scaled from a factor of 1 to 5 in steps of 0.001. The up and down buttons auto repeat. The results of each change in the scale are reported in the status bar. All of the tool buttons around the graph have hints so if you are unsure what the button is for, just leave the mouse over the button until the tip is displayed.

The upper right set of arrows are used to add a constant offset to the sensor temperature reading. The offset value can be in the range -20C to +20C. The offset can not be used to generate a negative temperature reading. The Offset is also added the alarm limits to keep the lm_sensors alarm status and the klm alarm reporting consistency - klm does not use the alarm output of lm_sensors in determining alarms.

The normal zone of a sensor can be altered by moving the red bars up and down. The results of each move are reported in the status bar.

In configuration mode, the sensor data is still plotted every five seconds, but only half of the graph width is used.

On my machine the fan sensors have some strange rules on what values they can be configured to; you can set the lower limit to 0 RPM, then the next accepted value is 2689 RPM. After that it seems to go in small jumps. So, I can move the low limit alarm bar down to 2689 RPM, and then if I move the mouse slowly down, the bar stays 'stuck'. When the mouse hits the bottom of the graph, the bar jumps to 0 RPM.  There is a similar but reverse behavior as you increase the fan limit from 0 RPM. This behavior is coming directly from my hardware.

Each sensor graph can be disabled by clicking on the 'x' button to the left of the graph. The sensor will disappear instantly on pressing the button. The disabled sensor can be enabled by resetting klm with the reset button on the toolbar. Disabling sensors saves screen space, and saves some memory (but not as much as I thought it would!). A sensor that is disabled, will not generate and alarm (as far as klm is concerned).

Each sensor graph has a (hopefully!) descriptive label at the bottom of the bar graph. These labels can be changed by clicking in the entry field, entering a new name up to six characters long, with no spaces, and pressing enter when done.



Temperature Sensors : A special case

Figure 7: Configuration of a Temperature Sensor

Figure 7 shows a temperature sensor in configuration mode. The difference between temperature sensors and all other sensors is that they do not have a minimum and maximum value, rather an offset and hysteresis value. If the sensor reading goes above the offset value then an alarm is detected. The alarm remains activated until the temperature falls below the hysteresis value. In a klm sensor, the offset value is represented by the upper of the two drag bars, and the hysteresis value by the lower. Klm draws the area between the offset and hysteresis values 'the hysteresis zone' in yellow.

In Figure 7, the settings are silly because, assuming that 35C is a normal operating temperature, the temperature will never fall below the hysteresis value, so if the temperature rises to the point that an alarm is activated, it will probably never shut off without reconfiguring klm.

There is one exception in the implementation of temperature sensors, the temperature readouts for the ADM 1021 are bounded by minimum and maximum temperatures i.e. You can generate and alarm if the temperature of your computer becomes too low.

KLM Settings, Configuration of lm_sensors clear as mud

Klm is nearly entirely driven by the output and state of the lm_sensors kernel module while it is running. Consequently, if you or another program alters the configuration of lm_sensors, within five seconds, klm will read the change in configuration and display the results.

When you exit from klm, and when a sensor is toggled from configuration mode into normal mode, the sensor configuration is saved to the klm configuration file. So, when you exit from klm, klm saves a snapshot of the current configuration of lm_sensors. The next time you run klm, it reads the stored configuration data and attempts to restore the lm_sensors module to the stored state. For this to succeed, klm must be running as root. If klm is not running as root, restoring settings will fail and klm will start to run using the current configuration of klm. In this situation, if you were to exit klm, the old, presumably desirable settings stored in the klm configuration file will be overwritten.

Klm has the ability to remember which sensors are disabled, so once a sensor is disabled, it will not be back until klm is reset.

It is possible to set the sensor refresh rate for Klm to values between 5 and 180 seconds by using the Klm Settings dialog (settings menu item). It is also possible to enable or disable the alarm beeping.

As of version 0.5.0 it is also possible to specify that a program be executed whenever an alarm is detected. To do this, turn on "Execute Script" in the Klm Settings dialog, and enter the name of the command to be executed along with any command line parameters into the entry field. If you enter %s as a parameter, klm will expand this to be a list of space separated failed sensor names. The program will be executed every refresh interval that an alarm is detected. The program is executed at the privelege that klm is running. This means that you can make a machine shut itself down on sensor failure if klm is running as root.

Known Bugs

There are some bugs: