source:
de.wigbels.ruby/hothotread/archiv/lastupdate.rb
Last change on this file was 8cc14b9, checked in by , 9 years ago | |
---|---|
|
|
File size: 256 bytes |
Line | |
---|---|
1 | def last_rrd_count |
2 | val = 0.0 |
3 | handle = IO.popen("rrdtool lastupdate power.rrd") |
4 | handle.each_line do |line| |
5 | m = line.match("^[0-9]*: ([0-9.]*) [0-9.]*") |
6 | if m |
7 | val = m[1].to_f |
8 | break |
9 | end |
10 | end |
11 | return val |
12 | end |
13 | |
14 | puts last_rrd_count |
Note:
See TracBrowser
for help on using the repository browser.