Пример #1
0
 public String getPropertyName(StringProperty stringproperty) {
   String s = stringproperty.getName();
   String s1 = TextUtils.getValue(getLabels(), stringproperty.getLabel());
   if (s1.length() == 0) {
     s1 = s;
   }
   return s1;
 }
Пример #2
0
 public String GetPropertyLabel(StringProperty stringproperty, boolean flag) {
   String s = stringproperty.printString();
   String s1 = TextUtils.getValue(getLabels(), s);
   if (s1.length() != 0) {
     return s1;
   }
   if (flag) {
     return "";
   } else {
     return s;
   }
 }
Пример #3
0
 protected void updateStats(double ad[], String as[], Monitor monitor, int i) {
   Enumeration enumeration = monitor.getStatePropertyObjects();
   do {
     if (!enumeration.hasMoreElements()) {
       break;
     }
     StringProperty stringproperty = (StringProperty) enumeration.nextElement();
     if (stringproperty.getName().equals("snmpValue")
         || stringproperty.getName().equals("result")
         || stringproperty.getName().equals("value")
         || stringproperty.getName().equals("value0")
         || stringproperty.getName().equals("column1")) {
       String s = monitor.getProperty(stringproperty);
       if (!s.equals("n/a")) {
         ad[i] = TextUtils.toDouble(s);
       } else {
         ad[i] = -999D;
       }
       as[i] = monitor.getProperty("_name");
     }
   } while (true);
 }
Пример #4
0
 static {
   pPercentFull = new PercentProperty("percentFull");
   pPercentFull.setLabel("percent used");
   pPercentFull.setStateOptions(1);
   pFreeSpace = new NumericProperty("freeSpace", "0", "MB");
   pFreeSpace.setLabel("MB free");
   pFreeSpace.setStateOptions(2);
   pPageFaultsPerSecond = new RateProperty("pageFaultsPerSecond", "0", "pages", "seconds");
   pPageFaultsPerSecond.setLabel("pages/sec");
   pPageFaultsPerSecond.setStateOptions(3);
   pLastMeasurement = new NumericProperty("lastMeasurement");
   pLastPageFaults = new NumericProperty("lastPageFaults");
   StringProperty astringproperty[] = {
     pPercentFull, pFreeSpace, pPageFaultsPerSecond, pLastMeasurement, pLastPageFaults
   };
   addProperties("COM.dragonflow.StandardMonitor.MemoryMonitor", astringproperty);
   addClassElement(
       "COM.dragonflow.StandardMonitor.MemoryMonitor",
       Rule.stringToClassifier("percentFull > 90\terror", true));
   addClassElement(
       "COM.dragonflow.StandardMonitor.MemoryMonitor",
       Rule.stringToClassifier("percentFull > 80\twarning", true));
   addClassElement(
       "COM.dragonflow.StandardMonitor.MemoryMonitor",
       Rule.stringToClassifier("percentFull == n/a\terror"));
   addClassElement(
       "COM.dragonflow.StandardMonitor.MemoryMonitor", Rule.stringToClassifier("always\tgood"));
   setClassProperty(
       "COM.dragonflow.StandardMonitor.MemoryMonitor",
       "description",
       "Measure virtual memory usage");
   setClassProperty("COM.dragonflow.StandardMonitor.MemoryMonitor", "help", "MemoryMon.htm");
   setClassProperty("COM.dragonflow.StandardMonitor.MemoryMonitor", "title", "Memory");
   setClassProperty("COM.dragonflow.StandardMonitor.MemoryMonitor", "class", "MemoryMonitor");
   setClassProperty("COM.dragonflow.StandardMonitor.MemoryMonitor", "classType", "server");
   setClassProperty("COM.dragonflow.StandardMonitor.MemoryMonitor", "topazName", "Memory");
   setClassProperty(
       "COM.dragonflow.StandardMonitor.MemoryMonitor", "topazType", "System Resources");
 }
Пример #5
0
 static {
   pItems = new ScalarProperty("_item", "");
   ((ScalarProperty) pItems).multiple = true;
   ((ScalarProperty) pItems).listSize = 3;
   pItems.setDisplayText(
       "Items",
       "Select two SNMP, Script, or Database monitors to be checked and their results calculated.");
   pItems.setParameterOptions(true, 1, false);
   pOperation = new ScalarProperty("_opertaion", "");
   pOperation.setDisplayText(
       "Operation", "Select the operation to be performed on the results of the above monitors. ");
   pOperation.setParameterOptions(true, 2, false);
   pRunMonitors = new BooleanProperty("_checkSequentially", "");
   pRunMonitors.setDisplayText("Run Monitors", "Run each monitor before performing calculation.");
   pRunMonitors.setParameterOptions(true, 3, true);
   pDelay = new NumericProperty("_delay", "0");
   pDelay.setDisplayText(
       "Monitor Delay", "If running each monitor, delay in seconds between monitor runs.");
   pDelay.setParameterOptions(true, 4, true);
   pStatic = new StringProperty("_static", "");
   pStatic.setDisplayText(
       "Constant",
       "Operate a constant on the Operation result. For example entering *8 will multiply the Operation result by 8.");
   pStatic.setParameterOptions(true, 5, true);
   pValueLabels = new StringProperty("_valeLabels", "");
   pValueLabels.setDisplayText(
       "Result Label", "Optional label for the result of the formula calculation.");
   pValueLabels.setParameterOptions(true, 6, true);
   pResult = new NumericProperty("result");
   pResult.setLabel("Result");
   pResult.setStateOptions(1);
   pStatus = new StringProperty("status");
   StringProperty astringproperty[] = {
     pItems, pRunMonitors, pDelay, pOperation, pResult, pStatus, pStatic, pValueLabels
   };
   addProperties("com.dragonflow.StandardMonitor.BandwidthMonitor", astringproperty);
   addClassElement(
       "com.dragonflow.StandardMonitor.BandwidthMonitor",
       Rule.stringToClassifier("status == 'n/a'\terror", true));
   addClassElement(
       "com.dragonflow.StandardMonitor.BandwidthMonitor", Rule.stringToClassifier("always\tgood"));
   setClassProperty(
       "com.dragonflow.StandardMonitor.BandwidthMonitor",
       "description",
       "Monitor two SNMP, Script, or Database monitors and perform an arithmetic operation on the results.");
   setClassProperty("com.dragonflow.StandardMonitor.BandwidthMonitor", "help", "BandwidthMon.htm");
   setClassProperty(
       "com.dragonflow.StandardMonitor.BandwidthMonitor", "title", "Formula Composite");
   setClassProperty(
       "com.dragonflow.StandardMonitor.BandwidthMonitor", "class", "BandwidthMonitor");
   setClassProperty("com.dragonflow.StandardMonitor.BandwidthMonitor", "topazName", "Bandwidth");
   setClassProperty(
       "com.dragonflow.StandardMonitor.BandwidthMonitor", "topazType", "System Resources");
   setClassProperty("com.dragonflow.StandardMonitor.BandwidthMonitor", "target", "_opertaion");
   setClassProperty("com.dragonflow.StandardMonitor.BandwidthMonitor", "loadable", "true");
 }