ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/client/monitors/Disk__Monitor.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/client/monitors/Disk__Monitor.java (file contents):
Revision 1.13 by tdb, Thu Nov 15 11:47:30 2001 UTC vs.
Revision 1.15 by tdb, Sat Jan 19 17:54:57 2002 UTC

# Line 99 | Line 99 | public class Disk__Monitor extends MonitorSkeleton {
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 <                    //   nb. use the device as the key as this is unlikely to change,
102 >                    //   nb. use the mount 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));
105 >                    if(!diskRegisters.containsKey(mount)) {
106 >                        diskRegisters.put(mount, new Register(source, _name, mount));
107                      }
108  
109                      // get the register for this disk
110 <                    Register reg = (Register) diskRegisters.get(device);
110 >                    Register reg = (Register) diskRegisters.get(mount);
111  
112                      // get the packet data
113                      double diskTotal, diskAvail;
# Line 216 | Line 216 | public class Disk__Monitor extends MonitorSkeleton {
216       * @param negateCheck whether to negate the check
217       * @return the threshold level breached, if any
218       */
219 <    private int checkAttributeThreshold(double diskInUse, Register reg, boolean negateCheck) {
219 >    private int checkAttributeThreshold(double value, Register reg, boolean negateCheck) {
220          for(int thresholdLevel = Alert.thresholdLevels.length - 1; thresholdLevel >= 0; thresholdLevel--) {
221              if (reg.getThreshold(thresholdLevel) != -1.0) {
222                  if(!negateCheck) {
223                      // normal check - has the value gone *over* the threshold
224 <                    if(((double) reg.getThreshold(thresholdLevel)) < diskInUse) {
224 >                    if(((double) reg.getThreshold(thresholdLevel)) < value) {
225                          return thresholdLevel;
226                      }
227                  }
228                  else {
229                      // negated check - has the value gone *under* the threshold
230 <                    if(((double) reg.getThreshold(thresholdLevel)) > diskInUse) {
230 >                    if(((double) reg.getThreshold(thresholdLevel)) > value) {
231                          return thresholdLevel;
232                      }
233                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines