39 |
|
if (packet.getParam("packet.attributes.type").equals("data")) { |
40 |
|
String source = packet.getParam("packet.attributes.machine_name"); |
41 |
|
if (!_hosts.containsKey(source)) { |
42 |
< |
_hosts.put(source, new Register(source, _name, 1)); |
42 |
> |
_hosts.put(source, new HashMap()); |
43 |
|
} |
44 |
|
|
45 |
< |
Register reg = (Register) _hosts.get(source); |
45 |
> |
HashMap diskRegisters = (HashMap) _hosts.get(source); |
46 |
|
|
47 |
|
// a tempory holder for all the disk attributes we find |
48 |
|
ArrayList disks = new ArrayList(); |
86 |
|
|
87 |
|
// *** now process this disk *** |
88 |
|
|
89 |
+ |
// check if we've seen this disk before on a previous run |
90 |
+ |
// if not, we need to create a register for it |
91 |
+ |
if(!diskRegisters.containsKey(diskNumber)) { |
92 |
+ |
diskRegisters.put(diskNumber, new Register(source, _name)); |
93 |
+ |
} |
94 |
+ |
|
95 |
+ |
// get the register for this disk |
96 |
+ |
Register reg = (Register) diskRegisters.get(diskNumber); |
97 |
+ |
|
98 |
|
// get the packet data |
99 |
|
double diskTotal, diskAvail; |
100 |
|
try { |
123 |
|
// say which disk had the problem |
124 |
|
String attributeName = "Disk in use % on " + mount + " (" + device + ")"; |
125 |
|
|
126 |
< |
processAlert(newThreshold, 0, attributeName, reg, source, strDiskInUse); |
126 |
> |
processAlert(newThreshold, attributeName, reg, source, strDiskInUse); |
127 |
|
} |
128 |
|
} |
129 |
|
} |