jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [trunk/] [modules/] [system/] [platform/] [linux.pm] - Diff between revs 26 and 27

Show entire file Ignore whitespace

Rev 26 Rev 27
Line 260... Line 260...
# #
sub read_uptime { sub read_uptime {
my %args=@_; my %args=@_;
open(IN,"/proc/uptime"); ($up,$idle)=split(/ /,<IN>); close(IN); open(IN,"/proc/uptime"); ($up,$idle)=split(/ /,<IN>); close(IN);
$up/=86400; $up/=86400;
$idle/=86400; $idle/=1036800;
   
if ( ! -e "rrd/uptime.rrd" ) { system("./makerrd","uptime") } if ( ! -e "rrd/uptime.rrd" ) { system("./makerrd","uptime") }
RRDs::update "rrd/uptime.rrd", time.":".$up.":".$idle; RRDs::update "rrd/uptime.rrd", time.":".$up.":".$idle;
if ($ERROR = RRDs::error) { print time," ",$args{MODNAME},": unable to update uptime.rrd: $ERROR\n"; } if ($ERROR = RRDs::error) { print time," ",$args{MODNAME},": unable to update uptime.rrd: $ERROR\n"; }
} }

Powered by WebSVN 2.2.1