Show collected CPU averages
authorJamie Cameron <jcameron@webmin.com>
Thu, 25 Feb 2010 02:24:55 +0000 (18:24 -0800)
committerJamie Cameron <jcameron@webmin.com>
Thu, 25 Feb 2010 02:24:55 +0000 (18:24 -0800)
blue-theme/lang/en
blue-theme/right.cgi

index 8f58acd..3afbb0d 100644 (file)
@@ -19,6 +19,8 @@ right_cpu=CPU load averages
 right_cpuinfo=Processor information
 right_cputype=$5, $8 cores
 right_load=$1 (1 min) $2 (5 mins) $3 (15 mins)
+right_cpuuse=CPU usage
+right_cpustats=$1% user, $2% kernel, $4% IO, $3% idle
 right_real=Real memory
 right_virt=Virtual memory
 right_procs=Running processes
index 7f9bf38..d8adfd5 100755 (executable)
@@ -107,13 +107,24 @@ if ($level == 0) {
                print "<td>$pr</td> </tr>\n";
                }
 
-       # Load and memory info
+       # Load averages
        if ($info->{'load'}) {
                @c = @{$info->{'load'}};
                if (@c) {
                        print "<tr> <td><b>$text{'right_cpu'}</b></td>\n";
                        print "<td>",&text('right_load', @c),"</td> </tr>\n";
                        }
+               }
+
+       # CPU usage
+       if ($info->{'cpu'}) {
+               @c = @{$info->{'cpu'}};
+               print "<tr> <td><b>$text{'right_cpuuse'}</b></td>\n";
+               print "<td>",&text('right_cpustats', @c),"</td> </tr>\n";
+               }
+
+       # Memory usage
+       if ($info->{'mem'}) {
                @m = @{$info->{'mem'}};
                if (@m && $m[0]) {
                        print "<tr> <td><b>$text{'right_real'}</b></td>\n";