mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-27 20:48:22 +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
|
# Edit the following for your setup
|
||||||
#
|
#
|
||||||
USER=apache
|
USER=apache
|
||||||
|
# CRONTAB not used
|
||||||
#CRONTAB=/var/spool/cron/tabs/$(USER)
|
#CRONTAB=/var/spool/cron/tabs/$(USER)
|
||||||
RRDPATH=/usr/local/rrdtool/bin
|
RRDPATH=/usr/local/rrdtool/bin
|
||||||
BINPATH=/usr/local/bin
|
BINPATH=/usr/local/bin
|
||||||
RRDDIR=/var/lib/sensors-rrd
|
RRDDIR=/var/lib/sensors-rrd
|
||||||
APACHE=/var/www/html
|
APACHE=/var/www/html
|
||||||
APACHDIR=$(APACHE)/senspix
|
APACHDIR=$(APACHE)/senspix
|
||||||
SENSDEV=bmc-ipmi-0000
|
|
||||||
MACH=`uname -n`
|
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
|
# Everything below here should be fine
|
||||||
#
|
#
|
||||||
RRDB=$(RRDDIR)/sensors.rrd
|
RRDB=$(RRDDIR)/sensors.rrd
|
||||||
SENSDIR=/proc/sys/dev/sensors/$(SENSDEV)
|
|
||||||
|
|
||||||
all: sens_day.cgi sens_week.cgi summ_week.cgi $(SENSDIR)
|
all: sens_day.cgi sens_week.cgi summ_week.cgi $(SENSDIR)
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -63,7 +63,8 @@ INSTALLATION INSTRUCTIONS
|
|||||||
APACHDIR=$(APACHE)/senspix
|
APACHDIR=$(APACHE)/senspix
|
||||||
The sensor device in your system
|
The sensor device in your system
|
||||||
(isa recommended over i2c if both are available)
|
(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
|
- make
|
||||||
- (as root) make install, which does the following.
|
- (as root) make install, which does the following.
|
||||||
If you don't want it to do this, install by hand!!!
|
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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -29,53 +29,100 @@
|
|||||||
if [ $# -ne 2 ]
|
if [ $# -ne 2 ]
|
||||||
then
|
then
|
||||||
echo "usage: $0 database.rrd sensor"
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
RRDPATH=/usr/local/rrdtool/bin
|
RRDPATH=/usr/local/rrdtool/bin
|
||||||
RRDB=$1
|
RRDB=$1
|
||||||
#
|
|
||||||
SENSDIR=/proc/sys/dev/sensors
|
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
|
SENSDEV=$2
|
||||||
SENS=$SENSDIR/$SENSDEV
|
SENS=$SENSDIR/$SENSDEV
|
||||||
if [ ! -r $SENS ]
|
if [ ! -r $SENS ]
|
||||||
then
|
then
|
||||||
|
echo $0: 'No sensors found! (modprobe sensor modules?)'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
STRING=N
|
STRING=N
|
||||||
#
|
if [ "$SYSFS" = "1" ]
|
||||||
# Get the second value from these sensor files
|
then
|
||||||
#
|
#
|
||||||
SENSORS="fan1 fan2 fan3"
|
# Get the value from these sensor files (/sys)
|
||||||
for i in $SENSORS
|
#
|
||||||
do
|
SENSORS="fan1 fan2 fan3"
|
||||||
V="`cat $SENSDIR/$SENSDEV/$i 2> /dev/null`"
|
for i in $SENSORS
|
||||||
if [ $? -ne 0 ]
|
do
|
||||||
then
|
V="`cat $SENSDIR/$SENSDEV/${i}_input 2> /dev/null`"
|
||||||
STRING="${STRING}:U"
|
if [ $? -ne 0 ]
|
||||||
else
|
then
|
||||||
V="`echo $V | cut -d ' ' -f 2`"
|
STRING="${STRING}:U"
|
||||||
STRING="${STRING}:${V}"
|
else
|
||||||
fi
|
STRING="${STRING}:${V}"
|
||||||
done
|
fi
|
||||||
#
|
done
|
||||||
# Get the third value from these sensor files
|
#
|
||||||
#
|
# 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
|
SENSORS="temp1 temp2 temp3 in0 in1 in2 in3 in4 in5 in6"
|
||||||
do
|
for i in $SENSORS
|
||||||
V="`cat $SENSDIR/$SENSDEV/$i 2> /dev/null`"
|
do
|
||||||
if [ $? -ne 0 ]
|
V="`cat $SENSDIR/$SENSDEV/${i}_input 2> /dev/null`"
|
||||||
then
|
if [ $? -ne 0 ]
|
||||||
STRING="${STRING}:U"
|
then
|
||||||
else
|
STRING="${STRING}:U"
|
||||||
V="`echo $V | cut -d ' ' -f 3`"
|
else
|
||||||
STRING="${STRING}:${V}"
|
V=`echo "3k0 ${V/-/_} 1000/p"|dc`
|
||||||
fi
|
STRING="${STRING}:${V}"
|
||||||
done
|
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
|
# Get the first value from these /proc files
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in new issue
Block a user