]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/scripts/makegraphs
Padlock und DMA Patch fuer die VIA Boards hinzugefuegt.
[ipfire-2.x.git] / src / scripts / makegraphs
index 8343b33df97c82db1503133639f9a8398b06f2fb..c6b94ec93db6243a0473b609d257980331b2e039 100644 (file)
@@ -38,6 +38,8 @@ my %mbmon_settings = ();
 use Encode 'from_to';
 my %tr=();
 
+system("chmod 777 /srv/web/ipfire/html/graphs");
+
 # Force language back to English (ugly hack!)
 # Modified to only force if we are unable to convert charset 
 # from utf-8
@@ -115,10 +117,11 @@ sub gettraffic {
 sub updatecpudata {
         if ( ! -e "$rrdlog/cpu.rrd") {
                 RRDs::create ("$rrdlog/cpu.rrd", "--step=300",
-                        "DS:user:GAUGE:600:0:100",
-                        "DS:system:GAUGE:600:0:100",
-                        "DS:idle:GAUGE:600:0:100",
-                        "DS:iowait:GAUGE:600:0:100",
+                        "DS:user:COUNTER:600:0:500000000",
+                        "DS:system:COUNTER:600:0:500000000",
+                        "DS:idle:COUNTER:600:0:500000000",
+                        "DS:iowait:COUNTER:600:0:500000000",
+                        "DS:irq:COUNTER:600:0:500000000",
                         "RRA:AVERAGE:0.5:1:576",
                         "RRA:AVERAGE:0.5:6:672",
                         "RRA:AVERAGE:0.5:24:732",
@@ -127,15 +130,23 @@ sub updatecpudata {
                 print "Error in RRD::create for cpu: $ERROR\n" if $ERROR;
         }
 
-        my ($cpu, $user, $nice, $system, $idle, $trash, $iowait);
+        my ($cpu, $user, $nice, $system, $idle, $iowait, $irq, $softirq);
 
-        my $Zeilen = `/usr/bin/iostat -c | tail -2 | head -1`;
-        ($trash, $user, $nice, $system, $iowait, $trash, $idle) = split(/\s+/,$Zeilen);
+        open STAT, "/proc/stat";
+        while(<STAT>) {
+                chomp;
+                /^cpu\s/ or next;
+                ($cpu, $user, $nice, $system, $idle, $iowait, $irq, $softirq) = split /\s+/;
+                last;
+        }
+        close STAT;
         $user += $nice;
+        $irq += $softirq;
+        
 
         RRDs::update ("$rrdlog/cpu.rrd",
-                "-t", "user:system:idle:iowait", 
-                "N:$user:$system:$idle:$iowait");
+                "-t", "user:system:idle:iowait:irq", 
+                "N:$user:$system:$idle:$iowait:$irq");
         $ERROR = RRDs::error;
         print "Error in RRD::update for cpu: $ERROR\n" if $ERROR;