55 |
|
// key prefix |
56 |
|
String keyPrefix = "packet.disk.p"; |
57 |
|
|
58 |
< |
// a tempory holder for all the disk attributes we find |
58 |
> |
// a temporary holder for all the disk attributes we find |
59 |
|
ArrayList disks = new ArrayList(); |
60 |
|
|
61 |
|
// unfortunatly we need to check the whole packet |
99 |
|
|
100 |
|
// check if we've seen this disk before on a previous run |
101 |
|
// if not, we need to create a register for it |
102 |
< |
if(!diskRegisters.containsKey(diskNumber)) { |
103 |
< |
diskRegisters.put(diskNumber, new Register(source, _name, mount)); |
102 |
> |
// nb. use the device as the key as this is unlikely to change, |
103 |
> |
// unlike diskNumber which could easily change |
104 |
> |
// (diskNumber is based on the order of df's output!) |
105 |
> |
if(!diskRegisters.containsKey(device)) { |
106 |
> |
diskRegisters.put(device, new Register(source, _name, mount)); |
107 |
|
} |
108 |
|
|
109 |
|
// get the register for this disk |
110 |
< |
Register reg = (Register) diskRegisters.get(diskNumber); |
110 |
> |
Register reg = (Register) diskRegisters.get(device); |
111 |
|
|
112 |
|
// get the packet data |
113 |
|
double diskTotal, diskAvail; |