Skip to contentSkip to conversation

sensord: rrd database and timeslots

DISCUSSION Aurelien Jarno 5 participants 13 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw

Hi all !

I received a bug report via the Debian BTS concerning sensord and rrd. I already started to discuss about it on IRC with Jean Delvare. So let's start with a summary of the problem.

sensord has an option to log regularly the values of all the sensors into a round robin database using rrd. The polling interval could be set using the --rrd-interval option. rrd stores data at fixed interval, or to be more precised at fixed time slots. For example if you are using a 5 minutes interval it uses the time slots 21:00:00, 21:05:00, 21:10:00, 21:15:00, etc.

sensord feeds the data every 5 minutes, however not on the time slots used by rrd (or you are very lucky ;). In that case rrd interpolates the values that are read, and thus the values in the database don't correspond to the read values.

(the full history could be found on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug$4034)

The user who reported the bug on the Debian BTS proposes a patch, available on:
http://bugs.debian.org/cgi-bin/bugreport.cgi/sensord-rrdslot.patch?bug$4034&msg&att=1

It contains two parts. The first part fakes that the sensors were read exactly on the timeslot even if it is not the case. Without the patch rrd uses "now" as the time value.

The second part modifies the time where sensors are read. Without the patch the sensors are read at regular intervals, whereas with the patch they are read at fixed time slots corresponding to the rrd ones, which also means at regular intervals.

On IRC, Jean Delvare suggests to disable the interpolation function of rrd. After some experiments, I found that in that case rrd stores the last values it received but it still uses fixed time slots. It means that the timestamps don't correspond to the data!

On my side, I suggest to use the second part of the patch only, which means that the sensors are sampled at fixed time slots. It's also the solution given in the examples given with rrd. I don't see why sensord should fake that the sensors were read exactly on the timeslot. In most cases the sensors would be read exactly on the time slot, however if it is not the case (for example on a system with a very high load, if there is a problem on smbus/i2c, etc.) the data would be interpolated.

I attached the second part of the patch.

Please give me your comments!

Bye,
Aurelien

Signature · 43 lines
  .''`.  Aurelien Jarno	              GPG: 1024D/F1BCDB73
 : :' :  Debian GNU/Linux developer | Electrical Engineering Student 
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
-------------- next part --------------
diff -urN lm-sensors-2.8.6.o/prog/sensord/sensord.c lm-sensors-2.8.6/prog/sensord/sensord.c
--- lm-sensors-2.8.6.o/prog/sensord/sensord.c	2002-06-10 19:56:16.000000000 +0200
+++ lm-sensors-2.8.6/prog/sensord/sensord.c	2004-04-20 00:04:46.000000000 +0200
@@ -28,6 +28,7 @@
 #include <signal.h>
 #include <syslog.h>
 #include <unistd.h>
+#include <time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
@@ -75,7 +76,12 @@
 sensord
 (void) {
   int ret = 0;
-  int scanValue = 0, logValue = 0, rrdValue = 0;
+  int scanValue = 0, logValue = 0;
+  /*
+   * First RRD update at next RRD timeslot to prevent failures due
+   * one timeslot updated twice on restart for example.
+   */
+  int rrdValue = rrdTime - time(NULL) % rrdTime;
 
   sensorLog (LOG_INFO, "sensord started");
 
@@ -93,7 +99,11 @@
     }
     if ((ret = 0) && rrdTime && rrdFile && (rrdValue <= 0)) {
       ret = rrdUpdate ();
-      rrdValue += rrdTime;
+      /*
+       * We don't add here, but set because next RRD timeslot starts
+       * exactly then and not sooner!
+       */
+      rrdValue = rrdTime - time(NULL) % rrdTime;
     }
     if (!done && (ret = 0)) {
       int a = logTime ? logValue : INT_MAX;
#1 lore raw

Hi,

(I'm the user who suggested the patch)

Quoted 1 line · Aurelien Jarno

On IRC, Jean Delvare suggests to disable the interpolation function of

Afaik you cannot disable the interpolation of rrd, except you store data exactly at the 'official timeslots'.

Quoted 7 lines

On my side, I suggest to use the second part of the patch only, which means that the sensors are sampled at fixed time slots. It's also the solution given in the examples given with rrd. I don't see why sensord should fake that the sensors were read exactly on the timeslot. In most cases the sensors would be read exactly on the time slot, however if it is not the case (for example on a system with a very high load, if there is a problem on smbus/i2c, etc.) the data would be interpolated.

I'm currently running the modified sensord with both parts of my patch (sampling at fixed timeslots and 'faking' the samle time) on a quite fast machine (P3-1000) with quite low load (something around 0.5). But even there, according to the modification time of the rrd, it happens quite often, that the update happens one second after the official timeslot (for example at 00:00:01 instead of 00:00:00).
This is no big issue, if the RRD update interval is something like 5 minutes: the deviance in this case would be something around 0.3%. However, the issue grows with smaller update
intervals: with 1 minute update interval you get a deviance of 1.6%, which leads to a noticeable interpolation.

That's why I'd suggest to apply the first part of my patch (giving the timeslot to rrd instead of 'N'(ew)) too.

regards,
Mario

Signature · 2 lines
"Why are we hiding from the police, daddy?"      | J. E. Guenther
"Because we use SuSE son, they use SYSVR4."      | de.alt.sysadmin.recovery
#2 lore raw
In reply to Aurelien Jarno
Quoted 1 line · Mario 'BitKoenig' Holbe

Hi,

Hi !

Quoted 7 lines

(I'm the user who suggested the patch)

Quoted 1 line · Aurelien Jarno

On IRC, Jean Delvare suggests to disable the interpolation function of

Afaik you cannot disable the interpolation of rrd, except you store data exactly at the 'official timeslots'.

It is possible to change the option passed to rrd_create from AVERAGE to LAST; it has to be done in sensord. However, it stills keep the date of the official 'timeslots'.

Quoted 4 lines

I'm currently running the modified sensord with both parts of my patch (sampling at fixed timeslots and 'faking' the samle time) on a quite fast machine (P3-1000) with quite low load (something around 0.5). But even there, according to

Quoted 8 lines

the modification time of the rrd, it happens quite often, that the update happens one second after the official timeslot (for example at 00:00:01 instead of 00:00:00).
This is no big issue, if the RRD update interval is something like 5 minutes: the deviance in this case would be something around 0.3%. However, the issue grows with smaller update
intervals: with 1 minute update interval you get a deviance of 1.6%, which leads to a noticeable interpolation.

What is the problem with such an interpolation? I totally agree that it is better that have to be sampled as near as possible from the time slots to get correct values. However, IMHO the values would be more "true" if the sensors are sampled a little to late but corrected than if they are sample to late and not corrected.

Bye,
Aurelien

Signature · 4 lines
  .''`.  Aurelien Jarno	              GPG: 1024D/F1BCDB73
 : :' :  Debian GNU/Linux developer | Electrical Engineering Student 
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
#3 lore raw
In reply to Aurelien Jarno
Quoted 4 lines · Aurelien Jarno

is better that have to be sampled as near as possible from the time slots to get correct values. However, IMHO the values would be more "true" if the sensors are sampled a little to late but corrected than if they are sample to late and not corrected.

Well, this depends a lot on the values you get from the sensors and on the interpretation of them.
For example, I have a machine whose fan is reported with 0 RPM from time to time, while it normally operates around 4200 RPM. With interpolation I get something like 70 RPM stored in the rrd instead of the - real - 0, which shows a very different view in the rrd than in reality.
The question is more or less: does the spotlight that sensord points at one moment say something about the values of the sensors in the past?

Mario

Signature · 4 lines
Independence Day: Fortunately, the alien computer operating system works just
fine with the laptop. This proves an important point which Apple enthusiasts
have known for years. While the evil empire of Microsoft may dominate the
computers of Earth people, more advanced life forms clearly prefer Mac's.
#4 lore raw
In reply to Aurelien Jarno
Quoted 11 lines · Mario 'BitKoenig' Holbe

Well, this depends a lot on the values you get from the sensors and on the interpretation of them.
For example, I have a machine whose fan is reported with 0 RPM from time to time, while it normally operates around 4200 RPM. With interpolation I get something like 70 RPM stored in the rrd instead of the - real - 0, which shows a very different view in the rrd than in reality.

The question is more or less: does the spotlight that sensord points at one moment say something about the values of the sensors in the past?

We have different points of view. For my part values comming from sensors are changing slowly, that's why interpolation is not a problem, and is even better.

You seems that your fan's sensor changes very often. It is surely due to a fan_div not properly configured. Try to multiply the fan_div corresponding to you fan by 2 or 4. For more information, have a look at /usr/share/doc/lm-sensors/doc/fan-divisors

With this problem solved, the interpolation should not be a problem anymore.

Bye,
Aurelien

Signature · 4 lines
  .''`.  Aurelien Jarno	              GPG: 1024D/F1BCDB73
 : :' :  Debian GNU/Linux developer | Electrical Engineering Student 
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
#5 lore raw
In reply to Aurelien Jarno
Quoted 4 lines

even if he increases the fan divisor so he doesn't get 0 anymore, fan readings don't have a lot of resolution, so the values might be 4111, 4221, 4309, etc., so I can see where interpolation could be misleading.

I don't. Who cares about the exact reading (which anyway is already a truncated value)? If rrd averages 4111 and 4221 to, say, 4139, well, this is a relevant value (while averaging 4111 and 0 to, say, 300 wouldn't).

As a side note, the 0 reading cannot be due to a bad fan divisor. Mario set the divisors to 2 and 4200 is no way near the limit for an AS99127F (it is below 3000 if I remember correctly). More likely the fan is broken

I also think that it is possible to tell rrd to ignore values outside of a given range. You could make it so that 0 isn't in the range, so it be taken into account. However, this makes monitoring the fan rather useless, of course. In any case I would consider buying a new, working fan. Trying to work around buggy hardware through software tricks rarely works (and is never the right thing to do).

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#6 lore raw
In reply to Aurelien Jarno
Quoted 6 lines

what I meant is that if the true fan readings are usually 4111,4221, and 4309, for example, you'd expect to see a "stairstep" type of plot where only those values are shown and all the lines are vertical or horizontal; if there were interpolation, however, intermediate values would be plotted, which would make it appear that the fan sensor had more resolution than it actually did.

Oh OK, now I see what you mean. However, I don't see much added value in knowing the resolution of the fan. RRD is meant to average the value, it's a bit silly to use it and then complain about that ;)

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#7 lore raw
In reply to Aurelien Jarno

It seems that the points of view on this problem are very different. Some of us say that the values should be averaged, some other says they should not.

That's why I propose a new patch that let the user choice if the values are average or not. Please also not that with this patch the timeslots are not faked anymore.

Please give me your comments!

Bye,
Aurelien

Signature · 123 lines
  .''`.  Aurelien Jarno	              GPG: 1024D/F1BCDB73
 : :' :  Debian GNU/Linux developer | Electrical Engineering Student 
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
-------------- next part --------------
diff -urN lm_sensors2.orig/prog/sensord/args.c lm_sensors2/prog/sensord/args.c
--- lm_sensors2.orig/prog/sensord/args.c	2002-07-31 16:20:29.000000000 +0200
+++ lm_sensors2/prog/sensord/args.c	2004-05-01 12:44:10.000000000 +0200
@@ -39,6 +39,7 @@
 int scanTime = 60;
 int logTime = 30 * 60;
 int rrdTime = 5 * 60;
+int rrdNoAverage = 0;
 int syslogFacility = LOG_LOCAL4;
 int doScan = 0;
 int doSet = 0;
@@ -98,6 +99,7 @@
   "  -i, --interval <time>     -- interval between scanning alarms (default 60s)\n"
   "  -l, --log-interval <time> -- interval between logging sensors (default 30m)\n"
   "  -t, --rrd-interval <time> -- interval between updating RRD file (default 5m)\n"
+  "  -T, --rrd-no-average      -- switch RRD in non-average mode\n"
   "  -r, --rrd-file <file>     -- RRD file (default <none>)\n"
   "  -c, --config-file <file>  -- configuration file (default sensors.conf)\n"
   "  -p, --pid-file <file>     -- PID file (default /var/run/sensord.pid)\n"
@@ -135,12 +137,13 @@
   "\n"
   "If no chips are specified, all chip info will be printed.\n";
 
-static const char *daemonShortOptions = "i:l:t:f:r:c:p:advhg:";
+static const char *daemonShortOptions = "i:l:Tt:f:r:c:p:advhg:";
 
 static const struct option daemonLongOptions[] = {
   { "interval", required_argument, NULL, 'i' },
   { "log-interval", required_argument, NULL, 'l' },
   { "rrd-interval", required_argument, NULL, 't' },
+  { "rrd-no-average", no_argument, NULL, 'T' },
   { "syslog-facility", required_argument, NULL, 'f' },
   { "rrd-file", required_argument, NULL, 'r' },
   { "config-file", required_argument, NULL, 'c' },
@@ -191,6 +194,9 @@
         if ((rrdTime = parseTime (optarg)) < 0)
           return -1;
         break;
+      case 'T':
+	rrdNoAverage = 1;
+	break;
       case 'f':
         if ((syslogFacility = parseFacility (optarg)) < 0)
           return -1;
diff -urN lm_sensors2.orig/prog/sensord/rrd.c lm_sensors2/prog/sensord/rrd.c
--- lm_sensors2.orig/prog/sensord/rrd.c	2004-03-08 19:03:42.000000000 +0100
+++ lm_sensors2/prog/sensord/rrd.c	2004-05-01 12:44:10.000000000 +0200
@@ -256,7 +256,7 @@
         ret = -num;
       } else {
         sprintf (stepBuff, "%d", rrdTime);
-        sprintf (rraBuff, "RRA:AVERAGE:%f:%d:%d", 0.5 /* fraction of non-unknown samples needed per entry */, 1 /* samples per entry */, 7 * 24 * 60 * 60 / rrdTime /* 1 week */);
+        sprintf (rraBuff, "RRA:%s:%f:%d:%d", rrdNoAverage?"LAST":"AVERAGE", 0.5 /* fraction of non-unknown samples needed per entry */, 1 /* samples per entry */, 7 * 24 * 60 * 60 / rrdTime /* 1 week */);
         argc += num;
         argv[argc ++] = rraBuff;
         argv[argc] = NULL;
diff -urN lm_sensors2.orig/prog/sensord/sensord.8 lm_sensors2/prog/sensord/sensord.8
--- lm_sensors2.orig/prog/sensord/sensord.8	2004-03-14 20:15:55.000000000 +0100
+++ lm_sensors2/prog/sensord/sensord.8	2004-05-01 12:47:36.000000000 +0200
@@ -70,6 +70,9 @@
 a round-robin database is configured.
 
 The time is specified as before; e.g., `5m'.
+.IP "-T, --rrd-no-average"
+Specify that the round-robin database should not be averaged.
+
 .IP "-r, --rrd-file file"
 Specify a round-robin database into which to log all sensor readings;
 e.g., `/var/log/sensord.rrd'. This database will be created if it does
diff -urN lm_sensors2.orig/prog/sensord/sensord.c lm_sensors2/prog/sensord/sensord.c
--- lm_sensors2.orig/prog/sensord/sensord.c	2002-06-10 19:56:16.000000000 +0200
+++ lm_sensors2/prog/sensord/sensord.c	2004-05-01 12:44:10.000000000 +0200
@@ -28,6 +28,7 @@
 #include <signal.h>
 #include <syslog.h>
 #include <unistd.h>
+#include <time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
@@ -75,7 +76,12 @@
 sensord
 (void) {
   int ret = 0;
-  int scanValue = 0, logValue = 0, rrdValue = 0;
+  int scanValue = 0, logValue = 0;
+  /*
+   * First RRD update at next RRD timeslot to prevent failures due
+   * one timeslot updated twice on restart for example.
+   */
+  int rrdValue = rrdTime - time(NULL) % rrdTime;
 
   sensorLog (LOG_INFO, "sensord started");
 
@@ -93,7 +99,11 @@
     }
     if ((ret = 0) && rrdTime && rrdFile && (rrdValue <= 0)) {
       ret = rrdUpdate ();
-      rrdValue += rrdTime;
+      /*
+       * We don't add here, but set because next RRD timeslot starts
+       * exactly then and not sooner!
+       */
+      rrdValue = rrdTime - time(NULL) % rrdTime;
     }
     if (!done && (ret = 0)) {
       int a = logTime ? logValue : INT_MAX;
diff -urN lm_sensors2.orig/prog/sensord/sensord.h lm_sensors2/prog/sensord/sensord.h
--- lm_sensors2.orig/prog/sensord/sensord.h	2002-10-23 16:51:54.000000000 +0200
+++ lm_sensors2/prog/sensord/sensord.h	2004-05-01 12:44:10.000000000 +0200
@@ -36,6 +36,7 @@
 extern int scanTime;
 extern int logTime;
 extern int rrdTime;
+extern int rrdNoAverage;
 extern int syslogFacility;
 extern int doScan;
 extern int doSet;
#8 lore raw
In reply to Aurelien Jarno
Quoted 1 line · Jean Delvare

If it works for Mario, it's OK with me (modulo the few trivial comments

This is okay for me too.

regards,
Mario

Signature · 3 lines
reich sein heisst nicht, einen Ferrari zu kaufen, sondern einen zu
verbrennen
                                               Dietmar Wischmeier
#9 lore raw
In reply to Aurelien Jarno
Quoted 9 lines

It seems that the points of view on this problem are very different. Some of us say that the values should be averaged, some other says they should not.

That's why I propose a new patch that let the user choice if the values are average or not. Please also not that with this patch the timeslots are not faked anymore.

Please give me your comments!

If it works for Mario, it's OK with me (modulo the few trivial comments I formulated over IRC).

Signature · 2 lines
Jean Delvare
http://khali.linux-fr.org/
#10 lore raw
In reply to Aurelien Jarno
Quoted 4 lines · Mario 'BitKoenig' Holbe
Quoted 1 line · Jean Delvare

If it works for Mario, it's OK with me (modulo the few trivial comments

This is okay for me too.

Okay, here is the new patch including the few minor fixes discussed on IRC.

Bye,
Aurelien

Signature · 123 lines
  .''`.  Aurelien Jarno	              GPG: 1024D/F1BCDB73
 : :' :  Debian GNU/Linux developer | Electrical Engineering Student 
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
-------------- next part --------------
diff -urN lm_sensors2.orig/prog/sensord/args.c lm_sensors2/prog/sensord/args.c
--- lm_sensors2.orig/prog/sensord/args.c	2004-05-01 19:43:33.000000000 +0200
+++ lm_sensors2/prog/sensord/args.c	2004-05-01 19:43:55.000000000 +0200
@@ -39,6 +39,7 @@
 int scanTime = 60;
 int logTime = 30 * 60;
 int rrdTime = 5 * 60;
+int rrdNoAverage = 0;
 int syslogFacility = LOG_LOCAL4;
 int doScan = 0;
 int doSet = 0;
@@ -98,6 +99,7 @@
   "  -i, --interval <time>     -- interval between scanning alarms (default 60s)\n"
   "  -l, --log-interval <time> -- interval between logging sensors (default 30m)\n"
   "  -t, --rrd-interval <time> -- interval between updating RRD file (default 5m)\n"
+  "  -T, --rrd-no-average      -- switch RRD in non-average mode\n"
   "  -r, --rrd-file <file>     -- RRD file (default <none>)\n"
   "  -c, --config-file <file>  -- configuration file (default sensors.conf)\n"
   "  -p, --pid-file <file>     -- PID file (default /var/run/sensord.pid)\n"
@@ -135,12 +137,13 @@
   "\n"
   "If no chips are specified, all chip info will be printed.\n";
 
-static const char *daemonShortOptions = "i:l:t:f:r:c:p:advhg:";
+static const char *daemonShortOptions = "i:l:t:Tf:r:c:p:advhg:";
 
 static const struct option daemonLongOptions[] = {
   { "interval", required_argument, NULL, 'i' },
   { "log-interval", required_argument, NULL, 'l' },
   { "rrd-interval", required_argument, NULL, 't' },
+  { "rrd-no-average", no_argument, NULL, 'T' },
   { "syslog-facility", required_argument, NULL, 'f' },
   { "rrd-file", required_argument, NULL, 'r' },
   { "config-file", required_argument, NULL, 'c' },
@@ -191,6 +194,9 @@
         if ((rrdTime = parseTime (optarg)) < 0)
           return -1;
         break;
+      case 'T':
+        rrdNoAverage = 1;
+        break;
       case 'f':
         if ((syslogFacility = parseFacility (optarg)) < 0)
           return -1;
diff -urN lm_sensors2.orig/prog/sensord/rrd.c lm_sensors2/prog/sensord/rrd.c
--- lm_sensors2.orig/prog/sensord/rrd.c	2004-05-01 19:43:33.000000000 +0200
+++ lm_sensors2/prog/sensord/rrd.c	2004-05-01 19:43:55.000000000 +0200
@@ -256,7 +256,7 @@
         ret = -num;
       } else {
         sprintf (stepBuff, "%d", rrdTime);
-        sprintf (rraBuff, "RRA:AVERAGE:%f:%d:%d", 0.5 /* fraction of non-unknown samples needed per entry */, 1 /* samples per entry */, 7 * 24 * 60 * 60 / rrdTime /* 1 week */);
+        sprintf (rraBuff, "RRA:%s:%f:%d:%d", rrdNoAverage?"LAST":"AVERAGE", 0.5 /* fraction of non-unknown samples needed per entry */, 1 /* samples per entry */, 7 * 24 * 60 * 60 / rrdTime /* 1 week */);
         argc += num;
         argv[argc ++] = rraBuff;
         argv[argc] = NULL;
diff -urN lm_sensors2.orig/prog/sensord/sensord.8 lm_sensors2/prog/sensord/sensord.8
--- lm_sensors2.orig/prog/sensord/sensord.8	2004-05-01 19:43:34.000000000 +0200
+++ lm_sensors2/prog/sensord/sensord.8	2004-05-01 19:43:55.000000000 +0200
@@ -70,6 +70,9 @@
 a round-robin database is configured.
 
 The time is specified as before; e.g., `5m'.
+.IP "-T, --rrd-no-average"
+Specify that the round-robin database should not be averaged.
+
 .IP "-r, --rrd-file file"
 Specify a round-robin database into which to log all sensor readings;
 e.g., `/var/log/sensord.rrd'. This database will be created if it does
diff -urN lm_sensors2.orig/prog/sensord/sensord.c lm_sensors2/prog/sensord/sensord.c
--- lm_sensors2.orig/prog/sensord/sensord.c	2004-05-01 19:43:34.000000000 +0200
+++ lm_sensors2/prog/sensord/sensord.c	2004-05-01 19:52:54.000000000 +0200
@@ -28,6 +28,7 @@
 #include <signal.h>
 #include <syslog.h>
 #include <unistd.h>
+#include <time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
@@ -75,7 +76,12 @@
 sensord
 (void) {
   int ret = 0;
-  int scanValue = 0, logValue = 0, rrdValue = 0;
+  int scanValue = 0, logValue = 0;
+  /*
+   * First RRD update at next RRD timeslot to prevent failures due
+   * one timeslot updated twice on restart for example.
+   */
+  int rrdValue = rrdTime - time(NULL) % rrdTime;
 
   sensorLog (LOG_INFO, "sensord started");
 
@@ -93,7 +99,11 @@
     }
     if ((ret = 0) && rrdTime && rrdFile && (rrdValue <= 0)) {
       ret = rrdUpdate ();
-      rrdValue += rrdTime;
+      /*
+       * The amount of time to wait is computed using the same method as
+       * in RRD instead of simply adding the interval.
+       */
+      rrdValue = rrdTime - time(NULL) % rrdTime;
     }
     if (!done && (ret = 0)) {
       int a = logTime ? logValue : INT_MAX;
diff -urN lm_sensors2.orig/prog/sensord/sensord.h lm_sensors2/prog/sensord/sensord.h
--- lm_sensors2.orig/prog/sensord/sensord.h	2004-05-01 19:43:34.000000000 +0200
+++ lm_sensors2/prog/sensord/sensord.h	2004-05-01 19:43:55.000000000 +0200
@@ -36,6 +36,7 @@
 extern int scanTime;
 extern int logTime;
 extern int rrdTime;
+extern int rrdNoAverage;
 extern int syslogFacility;
 extern int doScan;
 extern int doSet;
#11 lore raw
In reply to Aurelien Jarno

even if he increases the fan divisor so he doesn't get 0 anymore, fan readings don't have a lot of resolution, so the values might be 4111, 4221, 4309, etc., so I can see where interpolation could be misleading.

Quoted 31 lines · Aurelien Jarno
Quoted 11 lines · Mario 'BitKoenig' Holbe

Well, this depends a lot on the values you get from the sensors and on the interpretation of them.
For example, I have a machine whose fan is reported with 0 RPM from time to time, while it normally operates around 4200 RPM. With interpolation I get something like 70 RPM stored in the rrd instead of the - real - 0, which shows a very different view in the rrd than in reality.

The question is more or less: does the spotlight that sensord points at one moment say something about the values of the sensors in the past?

We have different points of view. For my part values comming from sensors are changing slowly, that's why interpolation is not a problem, and is even better.

You seems that your fan's sensor changes very often. It is surely due to a fan_div not properly configured. Try to multiply the fan_div corresponding to you fan by 2 or 4. For more information, have a look at /usr/share/doc/lm-sensors/doc/fan-divisors

With this problem solved, the interpolation should not be a problem anymore.

Bye,
Aurelien

#12 lore raw
In reply to Aurelien Jarno

what I meant is that if the true fan readings are usually 4111,4221, and 4309, for example, you'd expect to see a "stairstep" type of plot where only those values are shown and all the lines are vertical or horizontal; if there were interpolation, however, intermediate values would be plotted, which would make it appear that the
fan sensor had more resolution than it actually did.

Quoted 23 lines · Jean Delvare
Quoted 4 lines

even if he increases the fan divisor so he doesn't get 0 anymore, fan readings don't have a lot of resolution, so the values might be 4111, 4221, 4309, etc., so I can see where interpolation could be misleading.

I don't. Who cares about the exact reading (which anyway is already a truncated value)? If rrd averages 4111 and 4221 to, say, 4139, well, this is a relevant value (while averaging 4111 and 0 to, say, 300 wouldn't).

As a side note, the 0 reading cannot be due to a bad fan divisor. Mario set the divisors to 2 and 4200 is no way near the limit for an AS99127F (it is below 3000 if I remember correctly). More likely the fan is broken

I also think that it is possible to tell rrd to ignore values outside of a given range. You could make it so that 0 isn't in the range, so it be taken into account. However, this makes monitoring the fan rather useless, of course. In any case I would consider buying a new, working fan. Trying to work around buggy hardware through software tricks rarely works (and is never the right thing to do).