2 # Check if the system load exceeds some level
6 local @u = &uptime_output();
10 elsif ($u[$_[0]->{'time'}] >= $_[0]->{'max'}) {
15 'desc' => "Load is $u[$_[0]->{'time'}]" };
21 print &ui_table_row($text{'load_time'},
22 &ui_radio("time", int($_[0]->{'time'}),
23 [ [ 0, $text{'load_1'} ],
24 [ 1, $text{'load_5'} ],
25 [ 2, $text{'load_15'} ] ]));
27 print &ui_table_row($text{'load_max'},
28 &ui_textbox("max", $_[0]->{'max'}, 6));
33 &has_command("uptime") || &error($text{'load_ecmd'});
34 scalar(&uptime_output()) || &error($text{'load_efmt'});
35 $in{'max'} =~ /^[0-9\.]+$/ || &error($text{'load_emax'});
36 $_[0]->{'time'} = $in{'time'};
37 $_[0]->{'max'} = $in{'max'};
42 local $out = `uptime 2>&1`;
43 return $out =~ /average(s)?:\s+([0-9\.]+),?\s+([0-9\.]+),?\s+([0-9\.]+)/i ?