--- projects/cms/source/server/uk/org/iscream/cms/server/client/monitors/Disk__Monitor.java 2001/03/14 23:25:29 1.3 +++ projects/cms/source/server/uk/org/iscream/cms/server/client/monitors/Disk__Monitor.java 2001/03/18 00:54:04 1.4 @@ -15,8 +15,8 @@ import uk.org.iscream.componentmanager.*; /** * This Monitor watches the Disks for all machines * - * @author $Author: tdb $ - * @version $Id: Disk__Monitor.java,v 1.3 2001/03/14 23:25:29 tdb Exp $ + * @author $Author: ajm $ + * @version $Id: Disk__Monitor.java,v 1.4 2001/03/18 00:54:04 ajm Exp $ */ public class Disk__Monitor extends MonitorSkeleton { @@ -25,7 +25,7 @@ public class Disk__Monitor extends MonitorSkeleton { /** * The current CVS revision of this class */ - public final String REVISION = "$Revision: 1.3 $"; + public final String REVISION = "$Revision: 1.4 $"; public final String DESC = "Monitors all host disks."; @@ -109,9 +109,30 @@ public class Disk__Monitor extends MonitorSkeleton { // don't try to continue and process, try next disk break; } - - // percentage of memory in use - double diskInUse = (1 - (diskAvail / diskTotal)) * 100; + + boolean useValue = false; + try { + String option = _cp.getProperty("Host." + source, "Monitor." + _name + ".thresholdMeasure"); + if (option.equals("VALUE")) { + useValue = true; + } + } catch (PropertyNotFoundException e) { + // we default to percentage + } + + // this bit determines if the disk check is a % check + // or a kb check + double diskInUse; + if(useValue) { + // kb disk in use + diskInUse = diskTotal - diskAvail; + } else { + // kb disk in use + diskInUse = (1 - (diskAvail / diskTotal)) * 100; + } + + + int newThreshold = checkAttributeThreshold(diskInUse, reg); // format the memoryInUse to a String