mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-19 11:19:31 +00:00
support 2.6 kernels
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2982 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
f922d71607
commit
65d7993fc0
3 files changed
+91
-38
No files matched your search
+8
-3
@@ -2,19 +2,24 @@
|
||||
# Edit the following for your setup
|
||||
#
|
||||
USER=apache
|
||||
# CRONTAB not used
|
||||
#CRONTAB=/var/spool/cron/tabs/$(USER)
|
||||
RRDPATH=/usr/local/rrdtool/bin
|
||||
BINPATH=/usr/local/bin
|
||||
RRDDIR=/var/lib/sensors-rrd
|
||||
APACHE=/var/www/html
|
||||
APACHDIR=$(APACHE)/senspix
|
||||
SENSDEV=bmc-ipmi-0000
|
||||
MACH=`uname -n`
|
||||
#
|
||||
# 2.4 kernels
|
||||
#SENSDEV=w83781d-isa-0290
|
||||
#SENSDIR=/proc/sys/dev/sensors/$(SENSDEV)
|
||||
# 2.6 kernels
|
||||
SENSDEV=0-0290
|
||||
SENSDIR=/sys/bus/i2c/devices/$(SENSDEV)
|
||||
################################################
|
||||
# Everything below here should be fine
|
||||
#
|
||||
RRDB=$(RRDDIR)/sensors.rrd
|
||||
SENSDIR=/proc/sys/dev/sensors/$(SENSDEV)
|
||||
|
||||
all: sens_day.cgi sens_week.cgi summ_week.cgi $(SENSDIR)
|
||||
|
||||
|
||||
+2
-1
@@ -63,7 +63,8 @@ INSTALLATION INSTRUCTIONS
|
||||
APACHDIR=$(APACHE)/senspix
|
||||
The sensor device in your system
|
||||
(isa recommended over i2c if both are available)
|
||||
SENSDEV=w83781d-isa-0290
|
||||
SENSDEV=w83781d-isa-0290 (2.4 kernel - look in /proc/sys/dev/sensors)
|
||||
SENSDEV=0-0290 (2.6 kernel - look in /sys/i2c/bus/devices)
|
||||
- make
|
||||
- (as root) make install, which does the following.
|
||||
If you don't want it to do this, install by hand!!!
|
||||
|
||||
+81
-34
@@ -8,7 +8,7 @@
|
||||
#
|
||||
#################################################################
|
||||
#
|
||||
# Copyright 2001 Mark D. Studebaker <mdsxyz123@yahoo.com>
|
||||
# Copyright 2001,2005 Mark D. Studebaker <mdsxyz123@yahoo.com>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -29,53 +29,100 @@
|
||||
if [ $# -ne 2 ]
|
||||
then
|
||||
echo "usage: $0 database.rrd sensor"
|
||||
echo " sensor example: w83781d-isa-0290"
|
||||
echo " sensor example: w83781d-isa-0290 (2.4) or 0-0290 (2.6)"
|
||||
exit 1
|
||||
fi
|
||||
#
|
||||
RRDPATH=/usr/local/rrdtool/bin
|
||||
RRDB=$1
|
||||
#
|
||||
|
||||
SENSDIR=/proc/sys/dev/sensors
|
||||
#
|
||||
SDIR=/sys/bus/i2c/devices
|
||||
if [ ! -d $SENSDIR ]
|
||||
then
|
||||
if [ ! -d $SDIR ]
|
||||
then
|
||||
echo $0: 'No sensors found! (modprobe sensor modules?)'
|
||||
exit 1
|
||||
else
|
||||
SYSFS=1
|
||||
SENSDIR=$SDIR
|
||||
fi
|
||||
fi
|
||||
|
||||
SENSDEV=$2
|
||||
SENS=$SENSDIR/$SENSDEV
|
||||
if [ ! -r $SENS ]
|
||||
then
|
||||
echo $0: 'No sensors found! (modprobe sensor modules?)'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
STRING=N
|
||||
#
|
||||
# Get the second value from these sensor files
|
||||
#
|
||||
SENSORS="fan1 fan2 fan3"
|
||||
for i in $SENSORS
|
||||
do
|
||||
V="`cat $SENSDIR/$SENSDEV/$i 2> /dev/null`"
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
STRING="${STRING}:U"
|
||||
else
|
||||
V="`echo $V | cut -d ' ' -f 2`"
|
||||
STRING="${STRING}:${V}"
|
||||
fi
|
||||
done
|
||||
#
|
||||
# Get the third value from these sensor files
|
||||
#
|
||||
SENSORS="temp1 temp2 temp3 in0 in1 in2 in3 in4 in5 in6"
|
||||
for i in $SENSORS
|
||||
do
|
||||
V="`cat $SENSDIR/$SENSDEV/$i 2> /dev/null`"
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
STRING="${STRING}:U"
|
||||
else
|
||||
V="`echo $V | cut -d ' ' -f 3`"
|
||||
STRING="${STRING}:${V}"
|
||||
fi
|
||||
done
|
||||
if [ "$SYSFS" = "1" ]
|
||||
then
|
||||
#
|
||||
# Get the value from these sensor files (/sys)
|
||||
#
|
||||
SENSORS="fan1 fan2 fan3"
|
||||
for i in $SENSORS
|
||||
do
|
||||
V="`cat $SENSDIR/$SENSDEV/${i}_input 2> /dev/null`"
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
STRING="${STRING}:U"
|
||||
else
|
||||
STRING="${STRING}:${V}"
|
||||
fi
|
||||
done
|
||||
#
|
||||
# Get the value from these sensor files (/sys) and divide by 1000
|
||||
#
|
||||
SENSORS="temp1 temp2 temp3 in0 in1 in2 in3 in4 in5 in6"
|
||||
for i in $SENSORS
|
||||
do
|
||||
V="`cat $SENSDIR/$SENSDEV/${i}_input 2> /dev/null`"
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
STRING="${STRING}:U"
|
||||
else
|
||||
V=`echo "3k0 ${V/-/_} 1000/p"|dc`
|
||||
STRING="${STRING}:${V}"
|
||||
fi
|
||||
done
|
||||
else
|
||||
#
|
||||
# Get the second value from these sensor files (/proc)
|
||||
#
|
||||
SENSORS="fan1 fan2 fan3"
|
||||
for i in $SENSORS
|
||||
do
|
||||
V="`cat $SENSDIR/$SENSDEV/$i 2> /dev/null`"
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
STRING="${STRING}:U"
|
||||
else
|
||||
V="`echo $V | cut -d ' ' -f 2`"
|
||||
STRING="${STRING}:${V}"
|
||||
fi
|
||||
done
|
||||
#
|
||||
# Get the third value from these sensor files (/proc)
|
||||
#
|
||||
SENSORS="temp1 temp2 temp3 in0 in1 in2 in3 in4 in5 in6"
|
||||
for i in $SENSORS
|
||||
do
|
||||
V="`cat $SENSDIR/$SENSDEV/$i 2> /dev/null`"
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
STRING="${STRING}:U"
|
||||
else
|
||||
V="`echo $V | cut -d ' ' -f 3`"
|
||||
STRING="${STRING}:${V}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
#
|
||||
# Get the first value from these /proc files
|
||||
#
|
||||
|
||||
Reference in new issue
Block a user