- $ENV{COLUMNS} = 250;
- my $secs;
- my $f = new IO::File "ps ax -ocputime,args |";
- # dbg("$f");
- if ($f) {
- while (<$f>) {
- chomp;
- my $l = $_;
- # dbg($l);
- next unless $l =~ m{cluster\.pl$};
- next if $l =~ m{bash\s+\-c};
- my @f = split /\s+/, $l;
- # dbg("$f[9]");
- my ($d, $h, $m, $s) = $f[0] =~ /(?:(\d+)-)?(\d+):(\d\d):(\d\d)$/;
- $d ||= 0;
- $secs = ($d * 86400) + ($h * 3600) + ($m * 60) + $s;
- last;
- }
- $f->close;
- }
- if ($secs) {
- $mc->cfgprint('proc', [qw(noo perminute)], 5*60,
- "Processor Usage",
- 'Proc Secs / min', 'Proc Secs', 'Proc Secs') unless $want{dataonly};
- $mc->data('proc', $secs, $secs, "Processor Usage") unless $want{cfgonly};
- }
+ my $secs = $main::clssecs + $main::cldsecs;
+
+ dbg "mrtg: proc: cluster=$main::clssecs children=$main::cldsecs clock=$secs" if isdbg('mrtg');
+
+ $mc->cfgprint('proc', [qw(unknaszero withzeroes perminute)], 600,
+ "CPU Usage of <font color=#00cc00>node</font> and its <font color=#0000ff>children</font> in seconds",
+ 'CPU Secs/min', 'Node Secs 10ths', 'Child Secs 10ths', 0.1) unless $want{dataonly};
+ $mc->data('proc', int($main::clssecs*10+0.5), int($main::cldsecs*10+0.5), "Processor Usage") unless $want{cfgonly};