[rrd-users] Beginner problems
Mathias Koerber
mathias at koerber.org
Thu Dec 13 06:13:46 MET 2001
Hi,
I am just beginning with RRDtool, trying to monitor and graph certain
system parameters (here: lm_sensors).
I have set up lm_sensors, and the command '$ sensors' returns this:
# sensors
as99127f-i2c-0-2d
Adapter: SMBus Via Pro adapter at e800
Algorithm: Non-I2C SMBus adapter
VCore1: +1.79 V (min = +1.74 V, max = +1.93 V)
VCore2: +0.09 V (min = +1.74 V, max = +1.93 V) ALARM
3p3V: +3.34 V (min = +3.13 V, max = +3.45 V)
5V: +5.04 V (min = +4.72 V, max = +5.24 V)
12V: +12.20 V (min = +10.79 V, max = +13.19 V)
m12V: -10.40 V (min = -10.78 V, max = -13.18 V) ALARM
m5V: -3.87 V (min = -4.74 V, max = -5.24 V) ALARM
fan1: 6887 RPM (min = 3000 RPM, div = 2)
fan2: 0 RPM (min = 4500 RPM, div = 2)
temp1: +36°C (limit = +60°C, hysteresis = +50°C)
temp2: +43.1°C (limit = +67°C, hysteresis = +60°C) (beep)
temp3: +112.2°C (limit = +60°C, hysteresis = +50°C)
vid: +1.85 V
alarms: Chassis intrusion detection
beep_enable:
Sound alarm enabled
I wrote a matching perl script to call this and update the .rrdfile:
# cat readsensors
#!/usr/bin/perl
use lib "/usr/local/rrdtool/lib/perl";
use RRDs;
$sensors = "lm_sensors.rrd";
$step = 300;
$debug = 1;
if ($ARGV[0] =~ /create/i) {
RRDs::create ($sensors, "--step", $step,
"DS:vcore1:GAUGE:600:U:U",
"DS:vcore2:GAUGE:600:U:U",
"DS:3p3v:GAUGE:600:U:U",
"DS:5v:GAUGE:600:U:U",
"DS:12v:GAUGE:600:U:U",
"DS:m12v:GAUGE:600:U:U",
"DS:m5v:GAUGE:600:U:U",
"DS:fan1:GAUGE:600:U:U",
"DS:fan2:GAUGE:600:U:U",
"DS:temp1:GAUGE:600:U:U",
"DS:temp2:GAUGE:600:U:U",
"DS:temp3:GAUGE:600:U:U",
"DS:vid:GAUGE:600:U:U",
"RRA:AVERAGE:0.5:1:1200",
"RRA:MIN:0.5:12:2400",
"RRA:MAX:0.5:12:2400",
"RRA:AVERAGE:0.5:12:2400",
);
my $ERR=RRDs::error;
die "ERROR while updating $sensors: $ERR\n" if $ERR;
exit 0;
}
open(SENSORS," sensors|") || die " could not run sensors. $!";
while (<SENSORS>) {
if (/(.+):\s*\+?(\-?\d+\.?\d*)/i) {
$value{lc($1)}=$2;
print lc($1) . " = $2\n" if $debug;
};
}
close(SENSORS);
$t = join(':',keys %value);
$v = join(':',values %value);
print "$t\n$v\n" if $debug;
RRDs::update ($sensors, "-t", $t, "N:".$v);
my $ERR=RRDs::error;
die "ERROR while updating $sensors: $ERR\n" if $ERR;
exit 0;
Callin this script (with debug =1), I get:
# ./readsensors
vcore1 = 1.79
vcore2 = 0.09
3p3v = 3.34
5v = 5.04
12v = 12.20
m12v = -10.40
m5v = -3.87
fan1 = 6887
fan2 = 5720
temp1 = 36
temp2 = 43.1
temp3 = 112.2
vid = 1.85
temp2:temp3:vid:3p3v:vcore1:fan1:12v:vcore2:fan2:5v:m12v:temp1:m5v
43.1:112.2:1.85:3.34:1.79:6887:12.20:0.09:5720:5.04:-10.40:36:-3.87
yes, after calling this several times over 20 minutes or so I cannot graph
the date:
# rrdtool graph *rrd -a PNG
ERROR: can't make a graph without contents
Dumping the data reveals wrong values (they are all changing wildly after
each update though
the values in each update stay mostly the same), and all archive data is
NaN.
What am I doing wrong?
--
Mathias Körber |2385 Bay Road |Tel:+1-650-381.6044|Fax:+1-650-381.6055
Sr. Consult. Engr. |Redwood City |Direct Fax/Voicemail:+1-240-368.1170
Nominum, Inc. |CA 94063, USA |Private: Mobile:+65-9815.7807
mathias at nominum.com|www.nominum.com|E:mathias at koerber.org|Fax/Vmail:+1-801-6
50.9591
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the rrd-users
mailing list