| 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); |