PhpSysInfo: Difference between revisions

From MediaWiki
Jump to navigationJump to search
(How to get temperature and fan speed on phpSysInfo page)
 
 
Line 13: Line 13:
To setup the '''lm_sensors''' service, you will need to:
To setup the '''lm_sensors''' service, you will need to:


* Run the '''setup_sensors''' command (you can typically just press the Enter key and take the default value for each question asked).
* Run the '''sensors-detect''' command (it will ask you many questions, most of which you can take the default answer to by pressing the ''Enter'' key).
 
* Review the tail end of the '''sensors-detect''' output. It may indicate that you need to add something to your: "'''/etc/modules.conf'''" file for proper startup (this you should do). However, you should IGNORE any instructions it may give you about adding a bunch of '''modprobe'''s and invoking: "'''sensor -s'''" to some '''rc.*''' file (this is handled by the '''lm_sensors''' service).


* Start the '''lm_sensors''' service.
* Start the '''lm_sensors''' service.
* Enable the '''lm_sensors''' service so that it will automatically start the next time the system boots.


* Run the '''sensors''' command to verify that everything is working properly.
* Run the '''sensors''' command to verify that everything is working properly.
Line 21: Line 25:
It should look something like the following:
It should look something like the following:


<div class="screen">
  <div class="screenTitle">''Setup and Starting the lm_sensors Service''</div>
  <div class="userInput"><span class="prompt">[root@probe ~]# </span>sensors-detect</div>
<pre class="computerOutput">
# sensors-detect revision 1.393 (2005/08/30 18:51:18)
This program will help you determine which I2C/SMBus modules you need to
load to use lm_sensors most effectively. You need to have i2c and
lm_sensors installed before running this program.
Also, you need to be `root', or at least have access to the /dev/i2c-*
files, for most things.
If you have patched your kernel and have some drivers built in, you can
safely answer NO if asked to load some modules. In this case, things may
seem a bit confusing, but they will still work.
It is generally safe and recommended to accept the default answers to all
questions, unless you know what you're doing.
We can start with probing for (PCI) I2C or SMBus adapters.
You do not need any special privileges for this.
Do you want to probe now? (YES/no):
... Several questions will be asked, you can typically just press the
    Enter key and accept the default answer ...
I will now generate the commands needed to load the I2C modules.
Sometimes, a chip is available both through the ISA bus and an I2C bus.
ISA bus access is faster, but you need to load an additional driver module
for it. If you have the choice, do you want to use the ISA bus or the
I2C/SMBus (ISA/smbus)?
To make the sensors modules behave correctly, add these lines to
/etc/modules.conf:
#----cut here----
# I2C module options
alias char-major-89 i2c-dev
#----cut here----
To load everything that is needed, add this to some /etc/rc* file:
#----cut here----
# I2C adapter drivers
modprobe i2c-piix4
# I2C chip drivers
modprobe w83781d
modprobe eeprom
# sleep 2 # optional
/usr/bin/sensors -s # recommended
#----cut here----
WARNING! If you have some things built into your kernel, the list above
will contain too many modules. Skip the appropriate ones! You really should
try these commands right now to make sure everything is working properly.
Monitoring programs won't work until it's done.
Do you want to generate /etc/sysconfig/lm_sensors? (YES/no):
Copy prog/init/lm_sensors.init to /etc/rc.d/init.d/lm_sensors
for initialization at boot time.
</pre>
  <div class="userInput"><span class="prompt">[root@probe ~]# </span>service lm_sensors start</div>
<pre class="computerOutput">
Starting lm_sensors:                                      [  OK  ]
</pre>
  <div class="userInput"><span class="prompt">[root@probe ~]# </span>chkconfig lm_sensors on</div>
  <div class="userInput"><span class="prompt">[root@probe ~]# </span>sensors</div>
<pre class="computerOutput">
as99127f-i2c-0-2d
Adapter: SMBus PIIX4 adapter at e800
VCore 1:  +1.98 V  (min =  +1.90 V, max =  +2.10 V)
VCore 2:  +2.53 V  (min =  +1.90 V, max =  +2.10 V)
+3.3V:    +3.31 V  (min =  +3.14 V, max =  +3.46 V)
+5V:      +4.97 V  (min =  +4.73 V, max =  +5.24 V)
+12V:    +11.80 V  (min = +10.82 V, max = +13.19 V)
-12V:      -2.67 V  (min = -13.22 V, max = -10.74 V)
-5V:      -1.28 V  (min =  -5.25 V, max =  -4.74 V)
fan1:        0 RPM  (min = 21093 RPM, div = 4)
fan2:    4891 RPM  (min =  -1 RPM, div = 4)
fan3:        0 RPM  (min = 2596 RPM, div = 8)
M/B Temp:    +35°C  (high =    +0°C, hyst =  -96°C)
CPU Temp:  +50.0°C  (high =  +110°C, hyst =  +100°C)
temp3:      -0.5°C  (high =  +80°C, hyst =  +75°C)
vid:      +2.000 V  (VRM Version 8.2)
alarms:
beep_enable:
          Sound alarm enabled
</pre>
  <div class="userInput"><span class="prompt">[root@probe ~]# </span></div>
</div>
<p class="wikiNote">
'''NOTE''': Make sure you review and follow the directions related to the system: '''/etc/modules.conf''' file shown at the end of the output from the '''sensors-detect''' command. However, DO NOT following the set of directions titled: "''To load everything that is needed, add this to some /etc/rc* file:''" (these '''modprobe''' and '''sensor -s''' invocation steps are handled automatically by the '''lm_sensors''' script).
</p>


== '''phpSysInfo''' Configuration ==
== '''phpSysInfo''' Configuration ==

Latest revision as of 09:20, 20 August 2007

Adding Temperature and Fan Speeds

The phpSysInfo page can display temperatures and fan speeds if you configure it to do so. In order for this to work:

  • Your motherboard must be supported.
  • You must setup and start the lm_sensors service.
  • You must edit the: "/etc/phpsysinfo/config.php" file.

Setting Up The lm_sensors Service

To setup the lm_sensors service, you will need to:

  • Run the sensors-detect command (it will ask you many questions, most of which you can take the default answer to by pressing the Enter key).
  • Review the tail end of the sensors-detect output. It may indicate that you need to add something to your: "/etc/modules.conf" file for proper startup (this you should do). However, you should IGNORE any instructions it may give you about adding a bunch of modprobes and invoking: "sensor -s" to some rc.* file (this is handled by the lm_sensors service).
  • Start the lm_sensors service.
  • Enable the lm_sensors service so that it will automatically start the next time the system boots.
  • Run the sensors command to verify that everything is working properly.

It should look something like the following:

Setup and Starting the lm_sensors Service
[root@probe ~]# sensors-detect
# sensors-detect revision 1.393 (2005/08/30 18:51:18)

This program will help you determine which I2C/SMBus modules you need to
load to use lm_sensors most effectively. You need to have i2c and
lm_sensors installed before running this program.
Also, you need to be `root', or at least have access to the /dev/i2c-*
files, for most things.
If you have patched your kernel and have some drivers built in, you can
safely answer NO if asked to load some modules. In this case, things may
seem a bit confusing, but they will still work.

It is generally safe and recommended to accept the default answers to all
questions, unless you know what you're doing.

 We can start with probing for (PCI) I2C or SMBus adapters.
 You do not need any special privileges for this.
 Do you want to probe now? (YES/no):



 ... Several questions will be asked, you can typically just press the
     Enter key and accept the default answer ...



 I will now generate the commands needed to load the I2C modules.
 Sometimes, a chip is available both through the ISA bus and an I2C bus.
 ISA bus access is faster, but you need to load an additional driver module
 for it. If you have the choice, do you want to use the ISA bus or the
 I2C/SMBus (ISA/smbus)?

To make the sensors modules behave correctly, add these lines to
/etc/modules.conf:

#----cut here----
# I2C module options
alias char-major-89 i2c-dev
#----cut here----

To load everything that is needed, add this to some /etc/rc* file:

#----cut here----
# I2C adapter drivers
modprobe i2c-piix4
# I2C chip drivers
modprobe w83781d
modprobe eeprom
# sleep 2 # optional
/usr/bin/sensors -s # recommended
#----cut here----

WARNING! If you have some things built into your kernel, the list above
will contain too many modules. Skip the appropriate ones! You really should
try these commands right now to make sure everything is working properly.
Monitoring programs won't work until it's done.

Do you want to generate /etc/sysconfig/lm_sensors? (YES/no):
Copy prog/init/lm_sensors.init to /etc/rc.d/init.d/lm_sensors
for initialization at boot time.
[root@probe ~]# service lm_sensors start
Starting lm_sensors:                                       [  OK  ]
[root@probe ~]# chkconfig lm_sensors on
[root@probe ~]# sensors
as99127f-i2c-0-2d
Adapter: SMBus PIIX4 adapter at e800
VCore 1:   +1.98 V  (min =  +1.90 V, max =  +2.10 V)
VCore 2:   +2.53 V  (min =  +1.90 V, max =  +2.10 V)
+3.3V:     +3.31 V  (min =  +3.14 V, max =  +3.46 V)
+5V:       +4.97 V  (min =  +4.73 V, max =  +5.24 V)
+12V:     +11.80 V  (min = +10.82 V, max = +13.19 V)
-12V:      -2.67 V  (min = -13.22 V, max = -10.74 V)
-5V:       -1.28 V  (min =  -5.25 V, max =  -4.74 V)
fan1:        0 RPM  (min = 21093 RPM, div = 4)
fan2:     4891 RPM  (min =   -1 RPM, div = 4)
fan3:        0 RPM  (min = 2596 RPM, div = 8)
M/B Temp:    +35°C  (high =    +0°C, hyst =   -96°C)
CPU Temp:  +50.0°C  (high =  +110°C, hyst =  +100°C)
temp3:      -0.5°C  (high =   +80°C, hyst =   +75°C)
vid:      +2.000 V  (VRM Version 8.2)
alarms:
beep_enable:
          Sound alarm enabled

[root@probe ~]#

NOTE: Make sure you review and follow the directions related to the system: /etc/modules.conf file shown at the end of the output from the sensors-detect command. However, DO NOT following the set of directions titled: "To load everything that is needed, add this to some /etc/rc* file:" (these modprobe and sensor -s invocation steps are handled automatically by the lm_sensors script).

phpSysInfo Configuration

Once you have the sensors command working, you can enable the sensor information in the web page rendered by phpSysInfo file, by modifiying the: "/etc/phpsysinfo/config.php" file.

Change the following line:

$sensor_program = ""; 

To:

$sensor_program = "lmsensors";