Package: munin-node
Version: 1.2.6-6
Severity: normal

On systems with HZ value different than the 100 (ie. ia64
with HZ=1024), the graphs look incorrect - values are too
big or not displayed at all.

Attached is a patch for cpu plugin that scales the values
down to the assumed HZ=100. Value of HZ is acquired using
getconf CLK_TCK.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages munin-node depends on:
ii  adduser                 3.110            add and remove users and groups
ii  gawk                    1:3.1.5.dfsg-4.1 GNU awk, a pattern scanning and pr
ii  libnet-server-perl      0.97-1           An extensible, general perl server
ii  lsb-base                3.2-20           Linux Standard Base 3.2 init scrip
ii  perl                    5.10.0-14        Larry Wall's Practical Extraction 
ii  procps                  1:3.2.7-9        /proc file system utilities

Versions of packages munin-node recommends:
ii  libnet-snmp-perl              5.2.0-1    Script SNMP connections

Versions of packages munin-node suggests:
pn  acpi | lm-sensors             <none>     (no description available)
pn  ethtool                       <none>     (no description available)
ii  libdbd-pg-perl                2.10.7-1   Perl DBI driver for the PostgreSQL
pn  liblwp-useragent-determined-p <none>     (no description available)
pn  libnet-irc-perl               <none>     (no description available)
ii  libwww-perl                   5.813-1    WWW client/server library for Perl
pn  munin                         <none>     (no description available)
pn  munin-plugins-extra           <none>     (no description available)
ii  mysql-client-5.0 [mysql-clien 5.0.51a-15 MySQL database client binaries
ii  python                        2.5.2-2    An interactive high-level object-o
pn  smartmontools                 <none>     (no description available)

-- no debconf information
--- cpu.dist    2008-09-26 10:29:36.000000000 +0200
+++ cpu 2008-09-26 10:21:02.000000000 +0200
@@ -117,10 +117,12 @@
        exit 0
 fi
 
+HZ=`getconf CLK_TCK`
 
 if [ ! -z "$extinfo" ]
 then
-       awk '/^cpu / { print "user.value " $2 "\nnice.value " $3 
"\nsystem.value " $4 "\nidle.value " $5 "\niowait.value " $6 "\nirq.value " $7 
"\nsoftirq.value " $8 }' < /proc/stat
+       awk -v HZ=$HZ 'BEGIN { factor=100/HZ } /^cpu / { for (i=2; i<=8; i++) { 
$i = int($i * factor) }; print "user.value " $2 "\nnice.value " $3 
"\nsystem.value " $4 "\nidle.value " $5 "\niowait.value " $6 "\nirq.value " $7 
"\nsoftirq.value " $8 }' < /proc/stat
+
 else
-       awk '/^cpu / { print "user.value " $2 "\nnice.value " $3 
"\nsystem.value " $4 "\nidle.value " $5 }' < /proc/stat
+       awk -v HZ=$HZ 'BEGIN { factor=100/HZ } /^cpu / { for (i=2; i<=5; i++) { 
$i = int($i * factor) }; print "user.value " $2 "\nnice.value " $3 
"\nsystem.value " $4 "\nidle.value " $5 }' < /proc/stat
 fi

Reply via email to