]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
Fixed CPU Graph should now work fine
authorManiacikarus <maniacikarus@ipfire.org>
Sun, 28 Sep 2008 10:48:26 +0000 (12:48 +0200)
committerManiacikarus <maniacikarus@ipfire.org>
Sun, 28 Sep 2008 10:48:26 +0000 (12:48 +0200)
config/cfgroot/graphs.pl

index 15965e3630db5d3c143bebc5d0ed0b4871efe559..1df8d45e55babeccc31c3a3bb79ac57f56f202fd 100644 (file)
@@ -162,16 +162,20 @@ sub updatecpugraph {
                $addstring .= "+,";
        }
 
-       $addstring .= "+";
-
-       push(@command,$nice.$addstring
-               ,$interrupt.$addstring
-               ,$steal.$addstring
-               ,$user.$addstring
-               ,$system.$addstring
-               ,$idle.$addstring
-               ,$iowait.$addstring
-               ,$irq.$addstring);
+       if ( $cpucount > 1){
+               $addstring .= "+";
+               push(@command,$nice.$addstring
+                       ,$interrupt.$addstring
+                       ,$steal.$addstring
+                       ,$user.$addstring
+                       ,$system.$addstring
+                       ,$idle.$addstring
+                       ,$iowait.$addstring
+                       ,$irq.$addstring);
+       }else{
+               chop($nice),chop($interrupt),chop($steal),chop($user),chop($system),chop($idle),chop($iowait),chop($irq);
+               push(@command,$nice,$interrupt,$steal,$user,$system,$idle,$iowait,$irq);
+       }
 
        push(@command,"CDEF:total=user,system,idle,iowait,irq,nice,interrupt,steal,+,+,+,+,+,+,+"
                        ,"CDEF:userpct=100,user,total,/,*"