ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/statgrab/statgrab-make-mrtg-config.in
(Generate patch)

Comparing projects/libstatgrab/src/statgrab/statgrab-make-mrtg-config.in (file contents):
Revision 1.6 by ats, Tue Aug 10 19:07:02 2004 UTC vs.
Revision 1.10 by tdb, Thu Mar 13 10:29:18 2008 UTC

# Line 158 | Line 158 | sub main () {
158  
159          foreach my $net (sort keys %nets) {
160                  my $name = $stats{"net.$net.interface_name"};
161 <                # FIXME should be able to discover interface speed
162 <                entry("Network interface $name IO", "net.$net.rx", "net.$net.tx", 100*$mib, "Network IO", "KiB/s", "rx", "tx", 0, $KIBIBYTES);
161 >                my $speed = int($stats{"net.$net.speed"});
162 >                $speed = 100 if $speed == 0;
163 >
164 >                # The speed is reported in Mbit/s; we want KiB/s.
165 >                $speed = int(($speed * 1000000) / (8 * $kib));
166 >
167 >                entry("Network interface $name IO", "net.$net.rx", "net.$net.tx", $speed, "Network IO", "KiB/s", "rx", "tx", 0, $KIBIBYTES);
168          }
169  
170          if (exists $toplevel{"page"}) {
# Line 179 | Line 184 | sub main () {
184  
185          if (exists $toplevel{"swap"}) {
186                  my $swapsize = $stats{"swap.total"};
187 <                entry("Swap usage", "swap.used", undef, $swapsize, "Swap usage", "KiB", "used", undef, 1, $KIBIBYTES);
187 >                if ($swapsize ne "0") {
188 >                        entry("Swap usage", "swap.used", undef, $swapsize, "Swap usage", "KiB", "used", undef, 1, $KIBIBYTES);
189 >                }
190          }
191  
192          if (exists $toplevel{"user"}) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines