Show CPU model info on system information page
authorJamie Cameron <jcameron@webmin.com>
Sun, 15 Nov 2009 19:07:35 +0000 (11:07 -0800)
committerJamie Cameron <jcameron@webmin.com>
Sun, 15 Nov 2009 19:07:35 +0000 (11:07 -0800)
blue-theme/lang/en
blue-theme/right.cgi
proc/proc-lib.pl

index 902c4a9..8f58acd 100644 (file)
@@ -16,6 +16,8 @@ right_from=Logged in from
 right_webmin=Webmin version
 right_usermin=Usermin Version
 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_real=Real memory
 right_virt=Virtual memory
index 244b3e4..7f9bf38 100755 (executable)
@@ -69,6 +69,15 @@ if ($level == 0) {
                                   $info->{'kernel'}->{'arch'}),"</td> </tr>\n";
                }
 
+       # CPU type and cores
+       if ($info->{'load'}) {
+               @c = @{$info->{'load'}};
+               if (@c > 3) {
+                       print "<tr> <td><b>$text{'right_cpuinfo'}</b></td>\n";
+                       print "<td>",&text('right_cputype', @c),"</td> </tr>\n";
+                       }
+               }
+
        # System uptime
        &foreign_require("proc");
        my $uptime;
index c7da981..e27d006 100755 (executable)
@@ -492,7 +492,8 @@ return &pty_backquote(@_);
 }
 
 # get_cpu_info()
-# Returns a list containing the 5, 10 and 15 minute load averages
+# Returns a list containing the 5, 10 and 15 minute load averages, and possibly
+# the CPU mhz, model, vendor, cache and count
 sub get_cpu_info
 {
 if (defined(&os_get_cpu_info)) {