Author |
Message |
graysky
|
Posted: Tue Jul 15, 2008 5:12 pm |
|
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location:
/dev/null
|
Can someone help me debug my rrd_HDtemp.pl?
Code: # rrd_HDtemp.pl /dev/hdb: open: No such file or directory
/dev/sda: open: No such file or directory
hda: 38, hdb: 0, sda: 0 hdt1:hdt2:hdt3 N:38:0:0 Error: RRDs::update for 'HDtemp' : tmplt contains more DS definitions than RRD Error: RRDs::graph failed for 'day' : No DS called 'hdt2' in '/myth/rrd/log/HDtemp.rrd' Error: RRDs::graph failed for 'week' : No DS called 'hdt2' in '/myth/rrd/log/HDtemp.rrd' Error: RRDs::graph failed for 'month' : No DS called 'hdt2' in '/myth/rrd/log/HDtemp.rrd' Error: RRDs::graph failed for 'year' : No DS called 'hdt2' in '/myth/rrd/log/HDtemp.rrd' Seems to be correctly reading the temp of the sole drive (/dev/hda) at 38 °C, but any ideas about the string of errors? Also, here is a screenshot of the output:  Also, if I use hddtemp it agrees (38 °C): Code: # hddtemp /dev/hda /dev/hda: WDC WD5000AAKB-00YSA0: 38 C The data displayed as well as the drive name is from my old R5F27. I installed a new HD when I installed R5.5 and copied my /myth (with backup) to the new drive. Anyway, rrd isn't seeing the new drive at all. Thoughts are welcome. In case someone asks, here in my /etc/rrd.config (I only modded the MB and CPU temp lines): Code: #!/usr/bin/perl # # Configuration file for the KnoppMyth rrd data collection routines. # ######################################################################## # Global Configuration - config used by all the rrd_XXX.pl scripts: #======================================================================= $log = '/myth/rrd/log'; # location of the database (log) files $png = '/myth/rrd/png'; # location of graph (png) files #----------------------------------------------------------------------- $color = '#EAE9EE'; # background color used in the graphs $Gwd = 600; # graph width in pixels $Ght = 100; # graph height in pixels ######################################################################## # Individual Configuration for each collection type: #======================================================================= # rrd_CPU.pl configuration: # cpu utilization #----------------------------------------------------------------------- $color_cpuS = '#FF0000'; # color of 'System' area of the graph $color_cpuU = '#0000FF'; # color of 'User' area of the graph $color_cpuN = '#00FF00'; # color of 'Nice' area of the graph $color_cpuI = '#EEEE00'; # color of 'Idle' area of the graph #======================================================================= # rrd_Mem.pl configuration: # memory utilization #----------------------------------------------------------------------- $color_memU = '#0000FF'; # color of 'Used' area of the graph $color_memB = '#FF00FF'; # color of 'Buffered' area of the graph $color_memC = '#FFFF00'; # color of 'Cached' area of the graph $color_memF = '#00FF00'; # color of 'Free' area of the graph #======================================================================= # rrd_Swap.pl configuration: # swap utilization #----------------------------------------------------------------------- $color_swpU = '#0000FF'; # color of 'Used' area of the graph $color_swpF = '#00FF00'; # color of 'Free' area of the graph #======================================================================= # rrd_Net.pl configuration: # network utilization #----------------------------------------------------------------------- $color_netO = '#FFFF00'; # color of 'Outgoing' area of the graph $color_netT = '#888800'; # color of 'Outgoing' border $color_netI = '#00FF00'; # color of 'Incoming' area of the graph $color_netB = '#008800'; # color of 'Incoming' border #======================================================================= # rrd_Disk.pl configuration: # disk reads/writes #----------------------------------------------------------------------- $color_dskR = '#0000FF'; # color of 'Read' line of the graph $color_dskW = '#FF0000'; # color of 'Write' line of the graph #======================================================================= # rrd_MythFS.pl configuration: # mount point space/inodes utilization #----------------------------------------------------------------------- $mnt_dir = '/myth'; # mount point to check $color_mntS = '#0000FF'; # color of 'Space' line of the graph $color_mntI = '#008800'; # color of 'Inodes' line of the graph #======================================================================= # rrd_Count.pl configuration: # count of files in a directory #----------------------------------------------------------------------- $CNT_dir = '/myth/tv'; # directory in which to count $CNT_ex1 = '*.mpg'; # glob expression for first count $CNT_ex2 = '*.nuv'; # glob expression for second count $color_cnt1 = '#0000FF'; # color of 'First' count graph line $color_cnt2 = '#008800'; # color of 'Second' count graph line $CNT_prog = 'rrd_file_count'; # program to do the actual counting #======================================================================= # rrd_Load.pl configuration: # 1, 5, 15 minute load averages #----------------------------------------------------------------------- $color_avg1 = '#FF0000'; # color of '1' minute graph line $color_avg2 = '#00FF00'; # color of '5' minute graph line $color_avg3 = '#0000FF'; # color of '15' minute graph line #======================================================================= # rrd_HDtemp.pl config: # hard disk temperature #----------------------------------------------------------------------- $dev = 'hda'; # device to measure $color_hdt1 = '#0000FF'; # color of temperature graph line #======================================================================= # rrd_MBtemp.pl configuration: # Motherboard / CPU temperature #----------------------------------------------------------------------- $color_mbt1 = '#00FF00'; # color of 'motherboard' graph line $color_mbt2 = '#FF0000'; # color of 'CPU' graph line $color_mbt3 = '#0000FF'; # color of case 'Ambient' graph line $MBT_prog = 'sensors'; # program & args to gather the data #======================================================================= # rrd_MBtemp.pl configuration: # Motherboard / CPU temperature #----------------------------------------------------------------------- $color_mbf1 = '#00FF00'; # color of 'motherboard' graph line $color_mbf2 = '#FF0000'; # color of 'CPU' graph line $color_mbf3 = '#0000FF'; # color of case 'Ambient' graph line $MBF_prog = 'sensors'; # program & args to gather the data ######################################################################## # vim: sw=4 ts=8 # End
_________________ Retired KM user (R4 - R6.04); friend to LH users.
|
|
Top |
|
 |
tjc
|
Posted: Tue Jul 15, 2008 6:31 pm |
|
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location:
Arlington, MA
|
I'll give you a hint....
Quote: 6.2) The /usr/local/bin/rrd_HDtemp.pl script currently only has provisions for 3 disks. You may want to edit the list of devices on line 8 to match your hard drives.
Unfortunately you need to do this in the script until I get a chance to publish the versions which use /etc/rrd.config properly.
|
|
Top |
|
 |
graysky
|
Posted: Wed Jul 16, 2008 1:09 pm |
|
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location:
/dev/null
|
After backing up my current /etc/rrd.config and /usr/local/bin/rrd* I replaced them with the ones from the file you emailed to me.
Here is the output when I try to query the HDtemp.pl
Code: # rrd_HDtemp.pl /dev/hdb: open: No such file or directory
hda: 35, hdb: 0 hdt1:hdt2 N:35:0 Error: RRDs::update for 'HDtemp' : tmplt contains more DS definitions than RRD Error: RRDs::graph failed for 'day' : No DS called 'hdt2' in '/myth/rrd/log/HDtemp.rrd' Error: RRDs::graph failed for 'week' : No DS called 'hdt2' in '/myth/rrd/log/HDtemp.rrd' Error: RRDs::graph failed for 'month' : No DS called 'hdt2' in '/myth/rrd/log/HDtemp.rrd' Error: RRDs::graph failed for 'year' : No DS called 'hdt2' in '/myth/rrd/log/HDtemp.rrd'
_________________ Retired KM user (R4 - R6.04); friend to LH users.
|
|
Top |
|
 |
graysky
|
Posted: Wed Jul 16, 2008 4:37 pm |
|
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location:
/dev/null
|
It's working now!
I simply used your /etc/rrd.config (modded to use sensors for my MBtemps and I removed the "hdb" from the devices to measure line
Code: $HDT_dev = 'hda'; # devices to measure I also overwrote the R5.5 out-of-the-box /usr/local/bin/rrd_HDtemp.pl with the one you supplied. I didn't overwrite any of the other ones. Also had to mod my rrd_MBtemp.pl as described in this thread to get it to work with my old hardware. Anyway, thanks! Hell, here it is in its entirety: Code: #!/usr/bin/perl # # rrd_MBtemp.pl # Motherboard Temperature data collection routine for KnoppMyth # ######################################################################## # Configuration: my $dbf = 'MBtemp'; my $configfile = '/etc/rrd.config'; ######################################################################## use RRDs;
if (! -d "/myth") { $configfile = "./D_rrd.config"; } # DEBUG do $configfile;
sub create { # $_[0] = filename if (! -e "$log/$_[0].rrd") { print "Create db for $_[0] => $log/$_[0].rrd\n"; RRDs::create( "$log/$_[0].rrd", "-s 300", "DS:mbt1:GAUGE:600:0:U", "DS:mbt2:GAUGE:600:0:U", "DS:mbt3:GAUGE:600:0:U", "RRA:AVERAGE:0.5:1:576", "RRA:AVERAGE:0.5:6:672", "RRA:AVERAGE:0.5:24:732", "RRA:AVERAGE:0.5:144:1460"); $ERROR = RRDs::error; print "Error: RRDs::create failed for '$_[0]' : $ERROR\n" if $ERROR; } }
my ($mbt1, $mbt2);
sub gather { $mbt1 = `$MBT_prog | grep "M/B Temp" | cut -c 15-17`; $mbt2 = `$MBT_prog | grep "CPU Temp" | cut -c 15-17`; $mbt3 = `$MBT_prog|grep -i "aux temp" |cut -c 13-17`; $mbt1 =~ s/[\n ]//g; $mbt2 =~ s/[\n ]//g; $mbt3 =~ s/[\n ]//g; print "$dbf: motherboard $mbt1, CPU $mbt2, case $mbt3, °C\n"; # The motherboard sensor occasionally returns nonsense values. # This should keep the spurious peaks from roaching the graph... if ($mbt1 > 100.0) { $mbt1 = $mbt2 } print "$dbf: motherboard $mbt1, CPU $mbt2, case $mbt3, °C\n"; }
sub update { # $_[0] = filename RRDs::update( "$log/$_[0].rrd", "-t", "mbt1:mbt2:mbt3", "N:$mbt1:$mbt2:$mbt3"); $ERROR = RRDs::error; print "Error: RRDs::update for '$_[0]' : $ERROR\n" if $ERROR; }
#° sub graph { # $_[0] = time interval (ie: day...) # $_[1] = filename suffix. RRDs::graph( "$png/$dbf-$_[1].png", "-s -1$_[0]", "-aPNG", "-w $Gwd", "-h $Ght", "-E", "-l 20", "-M", "--color", "SHADEA$color", "--color", "SHADEB$color", "--color", "BACK$color", "-t Motherboard & CPU temperature degrees C :: $_[0]", "DEF:mbt1=$log/$dbf.rrd:mbt1:AVERAGE", "DEF:mbt2=$log/$dbf.rrd:mbt2:AVERAGE", "LINE1:mbt1$color_mbt1: MB temp\\:", "GPRINT:mbt1:MIN:Minimum\\: % 5.1lf", "GPRINT:mbt1:MAX:Maximum\\: % 5.1lf", "GPRINT:mbt1:AVERAGE:Average\\: % 5.1lf", "GPRINT:mbt1:LAST:Current\\: % 5.1lf °C\\j", "LINE1:mbt2$color_mbt2:CPU temp\\:", "GPRINT:mbt2:MIN:Minimum\\: % 5.1lf", "GPRINT:mbt2:MAX:Maximum\\: % 5.1lf", "GPRINT:mbt2:AVERAGE:Average\\: % 5.1lf", "GPRINT:mbt2:LAST:Current\\: % 5.1lf °C\\j"); $ERROR = RRDs::error; print "Error: RRDs::graph failed for '$_[0]' : $ERROR\n" if $ERROR; } ######################################################################## create "$dbf"; gather; update "$dbf"; graph 'day', 'Daily'; graph 'week', 'Weekly'; graph 'month', 'Monthly'; graph 'year', 'Yearly'; graph '2hour', '12hourly'; ######################################################################## # vim: sw=4 ts=8 # End
_________________ Retired KM user (R4 - R6.04); friend to LH users.
|
|
Top |
|
 |
tjc
|
Posted: Wed Jul 16, 2008 6:49 pm |
|
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location:
Arlington, MA
|
graysky wrote: It's working now! I simply used your /etc/rrd.config (modded to use sensors for my MBtemps and I removed the "hdb" from the devices to measure line Code: $HDT_dev = 'hda'; # devices to measure Well that was kind of the idea of those fixes, moving all the configuration to the /etc/rrd.config file... In that set there are about 4-5 files I changed along those lines. Things like fan and temperature sensor ordering, actual disk drives (up to 6), and even the command and argument for the MBTemp and MBFan without hacking the script directly. There are a couple ways you could do this. For example a trivial script which you can use as your $MBT_prog: Code: #!/bin/bash case $1 in 1) sensors | grep "M/B Temp" | cut -c 15-17 ;; 2) sensors | grep "CPU Temp" | cut -c 15-17 ;; *) ;; esac
The key is that the more generic we can make the scripts and the less you have to fiddle with them scripts in a custom way and can just set in the config file the better.
OBTW - For anyone else who want to try these they're available here: rrd_updates.tar.gz
|
|
Top |
|
 |
graysky
|
Posted: Thu Jul 17, 2008 1:58 am |
|
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location:
/dev/null
|
That is a more elegant solution. I just have no experience writing .pl files and as such, next to no understanding of what needs to happen for them to work. Thanks again, tjc. 
_________________ Retired KM user (R4 - R6.04); friend to LH users.
|
|
Top |
|
 |
tjc
|
Posted: Thu Jul 17, 2008 7:43 am |
|
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location:
Arlington, MA
|
graysky wrote: I just have no experience writing .pl files and as such,
Well definitely back up your old rrd_*.pl and rrd.config and give those a shot. You can drop that little shell script below in /usr/local/bin as something like sensors_temp.sh and adjust rrd.conf as needed. It should be trivial since they're just variable settings... Those work for me but I need to get some other people trying them.
BTW - Does mbmon not work for your motherboard at all? What happens if you run
Code: mbmon -d
|
|
Top |
|
 |
graysky
|
Posted: Thu Jul 17, 2008 1:50 pm |
|
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location:
/dev/null
|
@tjc -
Code: # mbmon -d SMBus[NVidia nForce2] found, but No HWM available on it!! No Hardware Monitor found!! InitMBInfo: Success In contrast, lm-sensors gives: Code: # sensors it8712-isa-0d00 Adapter: ISA adapter VCore 1: +1.74 V (min = +0.00 V, max = +4.08 V) VCore 2: +4.08 V (min = +0.00 V, max = +4.08 V) +3.3V: +3.36 V (min = +0.00 V, max = +4.08 V) +5V: +5.05 V (min = +0.00 V, max = +6.85 V) +12V: +12.22 V (min = +0.00 V, max = +16.32 V) -12V: +3.93 V (min = -27.36 V, max = +3.93 V) -5V: +4.03 V (min = -13.64 V, max = +4.03 V) Stdby: +6.85 V (min = +0.00 V, max = +6.85 V) VBat: +4.08 V fan1: 3245 RPM (min = 0 RPM, div = 2) fan2: 2556 RPM (min = 0 RPM, div = 4) M/B Temp: +18.0 C (low = -1.0 C, high = +127.0 C) sensor = thermal diode CPU Temp: +34.0 C (low = -1.0 C, high = +127.0 C) sensor = transistor Temp3: -1.0 C (low = -1.0 C, high = +127.0 C) sensor = disabled cpu0_vid: +1.750 V
I know mbmon works, perhaps I'm missing a kernel mod? In any case, when it did work in the past, the CPU/MB temps were mixed up.
_________________ Retired KM user (R4 - R6.04); friend to LH users.
|
|
Top |
|
 |
tjc
|
Posted: Thu Jul 17, 2008 6:30 pm |
|
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location:
Arlington, MA
|
You might try sending it directly to ISA and that chip...
Code: mbmon -d -I -p it87
This thread has the full walk through: http://knoppmyth.net/phpBB2/viewtopic.php?t=18536
As for being mixed up, thats why the new configurable script let you juggle sensor order. I'm "lucky" that my production and test boxes are rather different on this count, which inspired me to sort it out and let me test that it worked.
|
|
Top |
|
 |
AndySocial
|
Posted: Fri Sep 12, 2008 12:11 pm |
|
Joined: Sat Feb 04, 2006 12:19 pm
Posts: 17
Location:
Texas
|
TJC,
I am using your updated scripts now, and I modified the rrd.config to use hda and sda as the two monitored drives. Here's the output:
Code: hda: 41, sda: 37 hdt1:hdt2 N:41:37 Error: RRDs::update for 'HDtemp' : tmplt contains more DS definitions than RRD Error: RRDs::graph failed for 'day' : No DS called 'hdt2' in '/myth/rrd/log/HDtemp.rrd' Error: RRDs::graph failed for 'week' : No DS called 'hdt2' in '/myth/rrd/log/HDtemp.rrd' Error: RRDs::graph failed for 'month' : No DS called 'hdt2' in '/myth/rrd/log/HDtemp.rrd' Error: RRDs::graph failed for 'year' : No DS called 'hdt2' in '/myth/rrd/log/HDtemp.rrd'
Update: Deleting the existing HDtemp.rrd file allowed the new code to run. Tetchy thing, this RRD...[/b]
|
|
Top |
|
 |
tjc
|
Posted: Fri Sep 12, 2008 7:58 pm |
|
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location:
Arlington, MA
|
|
Top |
|
 |
goonzo
|
Posted: Wed Oct 22, 2008 8:33 am |
|
Joined: Sun Jan 08, 2006 5:13 pm
Posts: 67
Location:
Göteborg - Sweden
|
tjc wrote: I'll give you a hint.... Quote: 6.2) The /usr/local/bin/rrd_HDtemp.pl script currently only has provisions for 3 disks. You may want to edit the list of devices on line 8 to match your hard drives.  Unfortunately you need to do this in the script until I get a chance to publish the versions which use /etc/rrd.config properly.
since I have four hard drives installed i tried to add all hdds in the $dev array in rrd_HDtemp.pl. if I use only three devices in the list it works ok, but if I use more than that(ie 4) the script fails:
Code: #!/usr/bin/perl # # rrd_HDtemp.pl # Disk temperature data collection routine for KnoppMyth # ######################################################################## # Configuration: #my $dev = 'hda hdb sda'; my $dev = 'hda hdb sda sdb'; my $dbf = "HDtemp"; my $configfile = '/etc/rrd.config'; my @temps; my @colors = ('#0000FF', '#00FF00', '#FF0000', '#00FFFF', '#FF00FF', '#FFFF00'); ########################################################################
Code: root@server# rrd_HDtemp.pl hda: 37, hdb: 37, sda: 29, sdb: 26 hdt1:hdt2:hdt3:hdt4 N:37:37:29:26 Error: RRDs::update for 'HDtemp' : tmplt contains more DS definitions than RRD Error: RRDs::graph failed for 'day' : No DS called 'hdt4' in '/myth/rrd/log/HDtemp.rrd' Error: RRDs::graph failed for 'week' : No DS called 'hdt4' in '/myth/rrd/log/HDtemp.rrd' Error: RRDs::graph failed for 'month' : No DS called 'hdt4' in '/myth/rrd/log/HDtemp.rrd' Error: RRDs::graph failed for 'year' : No DS called 'hdt4' in '/myth/rrd/log/HDtemp.rrd' root@server#
I connot find anything in the script that limits the array to three elements?
I use R5.5
|
|
Top |
|
 |
goonzo
|
Posted: Wed Oct 22, 2008 9:00 am |
|
Joined: Sun Jan 08, 2006 5:13 pm
Posts: 67
Location:
Göteborg - Sweden
|
tjc wrote: OBTW - For anyone else who want to try these they're available here: rrd_updates.tar.gz
I even tried the new version of rrd_HDtemp.pl and added the array in rrd.config:
Code: $HDT_dev = 'hda hdb sda sdb'; # devices to measure @HDT_colors = ('#0000FF', '#00FF00', '#FF0000', '#FF00FF', '#00FFFF', '#FFFF00'$
but still i get the same error message(see previous post) when executing rrd_HDtemp.pl
|
|
Top |
|
 |
tjc
|
Posted: Wed Oct 22, 2008 8:41 pm |
|
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location:
Arlington, MA
|
You may need to purge the DB for that and start fresh.
|
|
Top |
|
 |
goonzo
|
Posted: Thu Oct 23, 2008 12:54 am |
|
Joined: Sun Jan 08, 2006 5:13 pm
Posts: 67
Location:
Göteborg - Sweden
|
tjc wrote: You may need to purge the DB for that and start fresh.
ah, now it works!
thanx a lot!
|
|
Top |
|
 |