ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/host/ihost-perl/plugins/perl/i-scream_disk.pl
(Generate patch)

Comparing projects/cms/source/host/ihost-perl/plugins/perl/i-scream_disk.pl (file contents):
Revision 1.1 by tdb, Mon Nov 19 21:42:11 2001 UTC vs.
Revision 1.2 by tdb, Sun Nov 25 20:33:18 2001 UTC

# Line 83 | Line 83 | sub include_disk() {
83      
84      # Go through each line of the program, looking for each thing we want.
85      my($partition_no) = 0;
86 <    for (my($i) = 0; $i < $#df; $i++) {
86 >    for (my($i) = 0; $i <= $#df; ++$i) {
87          my($line) = $df[$i];
88 <        $line =~ /^([^\s]*)\s*([0-9]*)\s*([0-9]*)\s*([0-9]*)\s*[^\s]*\s*(\/[^\s]*)\s*/;
89 <        # $4 will not match unless everything before it does...
90 <        if (defined $5) {
88 >        if ($line =~ /^[^\s]+\s*$/) {
89 >            ++$i;
90 >            $line .= $df[$i] if defined $df[$i];
91 >        }
92 >        if ($line =~ /^([^\s]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+[^\s]+\s+(\/[^\s]*)\s*/) {
93              my ($filesystem, $kbytes, $used, $avail, $mount) = ($1, $2, $3, $4, $5);
94              &print_pair("unknown", "packet.disk.p$partition_no.attributes.name", $filesystem);
95              &print_pair(0, "packet.disk.p$partition_no.attributes.kbytes", $kbytes);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines