source: de.wigbels.ruby/hothotread/archiv/lastupdate.rb

Last change on this file was 8cc14b9, checked in by Norbert Wigbels <njw@…>, 9 years ago

Aufraeumen

  • Property mode set to 100644
File size: 256 bytes
Line 
1def 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
12end
13
14puts last_rrd_count
Note: See TracBrowser for help on using the repository browser.