Changeset 2982
- Timestamp:
- 04/24/05 21:50:37 (8 years ago)
- Location:
- lm-sensors/trunk/prog/rrd
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/prog/rrd/Makefile
r2335 r2982 3 3 # 4 4 USER=apache 5 # CRONTAB not used 5 6 #CRONTAB=/var/spool/cron/tabs/$(USER) 6 7 RRDPATH=/usr/local/rrdtool/bin … … 9 10 APACHE=/var/www/html 10 11 APACHDIR=$(APACHE)/senspix 11 SENSDEV=bmc-ipmi-000012 12 MACH=`uname -n` 13 # 13 # 2.4 kernels 14 #SENSDEV=w83781d-isa-0290 15 #SENSDIR=/proc/sys/dev/sensors/$(SENSDEV) 16 # 2.6 kernels 17 SENSDEV=0-0290 18 SENSDIR=/sys/bus/i2c/devices/$(SENSDEV) 19 ################################################ 14 20 # Everything below here should be fine 15 21 # 16 22 RRDB=$(RRDDIR)/sensors.rrd 17 SENSDIR=/proc/sys/dev/sensors/$(SENSDEV)18 23 19 24 all: sens_day.cgi sens_week.cgi summ_week.cgi $(SENSDIR) -
lm-sensors/trunk/prog/rrd/README
r1955 r2982 64 64 The sensor device in your system 65 65 (isa recommended over i2c if both are available) 66 SENSDEV=w83781d-isa-0290 66 SENSDEV=w83781d-isa-0290 (2.4 kernel - look in /proc/sys/dev/sensors) 67 SENSDEV=0-0290 (2.6 kernel - look in /sys/i2c/bus/devices) 67 68 - make 68 69 - (as root) make install, which does the following. -
lm-sensors/trunk/prog/rrd/sens_update_rrd
r1052 r2982 9 9 ################################################################# 10 10 # 11 # Copyright 2001 Mark D. Studebaker <mdsxyz123@yahoo.com>11 # Copyright 2001,2005 Mark D. Studebaker <mdsxyz123@yahoo.com> 12 12 # 13 13 # This program is free software; you can redistribute it and/or modify … … 30 30 then 31 31 echo "usage: $0 database.rrd sensor" 32 echo " sensor example: w83781d-isa-0290 "32 echo " sensor example: w83781d-isa-0290 (2.4) or 0-0290 (2.6)" 33 33 exit 1 34 34 fi … … 36 36 RRDPATH=/usr/local/rrdtool/bin 37 37 RRDB=$1 38 # 38 39 39 SENSDIR=/proc/sys/dev/sensors 40 # 40 SDIR=/sys/bus/i2c/devices 41 if [ ! -d $SENSDIR ] 42 then 43 if [ ! -d $SDIR ] 44 then 45 echo $0: 'No sensors found! (modprobe sensor modules?)' 46 exit 1 47 else 48 SYSFS=1 49 SENSDIR=$SDIR 50 fi 51 fi 52 41 53 SENSDEV=$2 42 54 SENS=$SENSDIR/$SENSDEV 43 55 if [ ! -r $SENS ] 44 56 then 57 echo $0: 'No sensors found! (modprobe sensor modules?)' 45 58 exit 1 46 59 fi 47 60 48 61 STRING=N 49 # 50 # Get the second value from these sensor files 51 # 52 SENSORS="fan1 fan2 fan3" 53 for i in $SENSORS 54 do 55 V="`cat $SENSDIR/$SENSDEV/$i 2> /dev/null`" 56 if [ $? -ne 0 ] 57 then 58 STRING="${STRING}:U" 59 else 60 V="`echo $V | cut -d ' ' -f 2`" 61 STRING="${STRING}:${V}" 62 fi 63 done 64 # 65 # Get the third value from these sensor files 66 # 67 SENSORS="temp1 temp2 temp3 in0 in1 in2 in3 in4 in5 in6" 68 for i in $SENSORS 69 do 70 V="`cat $SENSDIR/$SENSDEV/$i 2> /dev/null`" 71 if [ $? -ne 0 ] 72 then 73 STRING="${STRING}:U" 74 else 75 V="`echo $V | cut -d ' ' -f 3`" 76 STRING="${STRING}:${V}" 77 fi 78 done 62 if [ "$SYSFS" = "1" ] 63 then 64 # 65 # Get the value from these sensor files (/sys) 66 # 67 SENSORS="fan1 fan2 fan3" 68 for i in $SENSORS 69 do 70 V="`cat $SENSDIR/$SENSDEV/${i}_input 2> /dev/null`" 71 if [ $? -ne 0 ] 72 then 73 STRING="${STRING}:U" 74 else 75 STRING="${STRING}:${V}" 76 fi 77 done 78 # 79 # Get the value from these sensor files (/sys) and divide by 1000 80 # 81 SENSORS="temp1 temp2 temp3 in0 in1 in2 in3 in4 in5 in6" 82 for i in $SENSORS 83 do 84 V="`cat $SENSDIR/$SENSDEV/${i}_input 2> /dev/null`" 85 if [ $? -ne 0 ] 86 then 87 STRING="${STRING}:U" 88 else 89 V=`echo "3k0 ${V/-/_} 1000/p"|dc` 90 STRING="${STRING}:${V}" 91 fi 92 done 93 else 94 # 95 # Get the second value from these sensor files (/proc) 96 # 97 SENSORS="fan1 fan2 fan3" 98 for i in $SENSORS 99 do 100 V="`cat $SENSDIR/$SENSDEV/$i 2> /dev/null`" 101 if [ $? -ne 0 ] 102 then 103 STRING="${STRING}:U" 104 else 105 V="`echo $V | cut -d ' ' -f 2`" 106 STRING="${STRING}:${V}" 107 fi 108 done 109 # 110 # Get the third value from these sensor files (/proc) 111 # 112 SENSORS="temp1 temp2 temp3 in0 in1 in2 in3 in4 in5 in6" 113 for i in $SENSORS 114 do 115 V="`cat $SENSDIR/$SENSDEV/$i 2> /dev/null`" 116 if [ $? -ne 0 ] 117 then 118 STRING="${STRING}:U" 119 else 120 V="`echo $V | cut -d ' ' -f 3`" 121 STRING="${STRING}:${V}" 122 fi 123 done 124 fi 125 79 126 # 80 127 # Get the first value from these /proc files
