Пример #1
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");
 }
Пример #2
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");
 }
Пример #3
0
  static {
    pLogFile = new StringProperty("_logFile");
    pLogFile.setDisplayText(
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "_logFile", MonitorIniValueReader.LABEL),
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "_logFile", MonitorIniValueReader.DESCRIPTION));
    // pLogFile.setDisplayText("Log File Pathname", "the pathname of the log file to monitor\n<p> In
    // order to monitor remote Unix files choose the 'Choose Server' link above.  For NT, you must
    // specify the UNC path to the file.  For example,
    // \\\\machinename\\sharename\\filename.log.\n<p>Optionally, use a <a
    // href=/SiteView/docs/regexp.htm>regular expression</a> to insert date and time variables
    // <br>(e.g s/ex$shortYear$$0month$$0day$.log/ to match IIS log files)");
    pLogFile.setParameterOptions(true, 1, false);

    pResetFile = new ScalarProperty("_resetFile");
    pResetFile.setDisplayText(
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "_resetFile", MonitorIniValueReader.LABEL),
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "_resetFile", MonitorIniValueReader.DESCRIPTION));
    // pResetFile.setDisplayText("Check from Beginning", "Select file checking option as follows:\n
    // <br><b>Never</b> - Check only newly added records (default)\n<br><b>First Time Only</b> -
    // Check the whole file once, then only new records\n<br><b>Always</b> - Always check the whole
    // file\n");
    pResetFile.setValue("none");
    pResetFile.setParameterOptions(true, 2, false);

    pAlerting = new ScalarProperty("_alerting", "");
    pAlerting.setDisplayText(
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "_alerting", MonitorIniValueReader.LABEL),
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "_alerting", MonitorIniValueReader.DESCRIPTION));
    // pAlerting.setDisplayText("Run Alerts", "How alerts for this monitor are triggered by the
    // following options:  <TR><TD>(1) For <b>'for each log entry matched and report status'</b> the
    // monitor triggers alerts for every matching entry found based on the <b>Error If</b> and
    // <b>Warning If</b> thresholds defined for the monitor. </TD></TR>\n<TR><TD>(2) For <b>'once,
    // after all log entries have been checked'</b>, the monitor counts up the number of matches and
    // then triggers alerts based on the <b>Error If</b> and <b>Warning If</b> thresholds defined
    // for the monitor. </TD></TR>\n");
    pAlerting.setParameterOptions(true, 3, false);

    pMatch = new StringProperty("_match");
    pMatch.setDisplayText(
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "_match", MonitorIniValueReader.LABEL),
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "_match", MonitorIniValueReader.DESCRIPTION));
    // pMatch.setDisplayText("Content Match", "enter the text to match in a log entry or a <a
    // href=/SiteView/docs/regexp.htm>regular expression</a>. By default successful match makes
    // monitor alert or error.");
    pMatch.setParameterOptions(true, 4, false);

    pRulesFile = new StringProperty("_rulesFile");
    pRulesFile.setParameterOptions(true, 4, true);
    String rulesfile_description =
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "_rulesFile", MonitorIniValueReader.DESCRIPTION);
    rulesfile_description = rulesfile_description.replaceAll("1%", ruleFileDisplayText);
    pRulesFile.setDisplayText(
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "_match", MonitorIniValueReader.LABEL),
        rulesfile_description);
    // pRulesFile.setDisplayText("Rules File Pathname", ruleFileDisplayText);

    pNoFileCheckExist = new BooleanProperty("_noFileCheckExist");
    pNoFileCheckExist.setDisplayText(
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "_noFileCheckExist", MonitorIniValueReader.LABEL),
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "_noFileCheckExist", MonitorIniValueReader.DESCRIPTION));
    // pNoFileCheckExist.setDisplayText("No Error on File Not Found.", "if the file is not found
    // then don't error.");
    pNoFileCheckExist.setParameterOptions(true, 5, true);

    pValueLabels = new StringProperty("_valeLabels", "");
    pValueLabels.setDisplayText(
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "_valeLabels", MonitorIniValueReader.LABEL),
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "_valeLabels", MonitorIniValueReader.DESCRIPTION));
    // pValueLabels.setDisplayText("Match Value Labels", "Labels for the values matched on the
    // script output, separated by a \",\"");
    pValueLabels.setParameterOptions(true, 6, true);

    pLines = new NumericProperty("lineCount");
    pLines.setLabel(
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "lineCount", MonitorIniValueReader.LABEL));
    // pLines.setLabel("lines");
    pLines.setIsThreshold(true);

    pMatches = new NumericProperty("matchCount");
    pMatches.setLabel(
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "matchCount", MonitorIniValueReader.LABEL));
    // pMatches.setLabel("matches");
    pMatches.setIsThreshold(true);

    pLogName = new StringProperty("logName");
    pLogName.setDisplayText(
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "logName", MonitorIniValueReader.LABEL),
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "logName", MonitorIniValueReader.DESCRIPTION));
    // pLogName.setDisplayText("Don't use in Templates", "this is the path to the log file. However,
    // it <b>should not be used</b>, because it is not loaded all of the time. It depends on the
    // state of the monitor");
    pMatchDetails = new StringProperty("matchDetails");

    pLastAlertsPerMinute =
        new RateProperty(
            "lastAlertsPerMinute",
            "0",
            MonitorIniValueReader.getValue(
                LogMonitor.class.getName(), "lastAlertsPerMinute", MonitorIniValueReader.UNIT));
    // pLastAlertsPerMinute = new RateProperty("lastAlertsPerMinute", "0", "lines", "minutes");
    pLastAlertsPerMinute.setLabel(
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "lastAlertsPerMinute", MonitorIniValueReader.LABEL));
    // pLastAlertsPerMinute.setLabel("matches/min");
    pLastAlertsPerMinute.setStateOptions(1);

    pLastLinesPerMinute =
        new RateProperty(
            "lastLinesPerMinute",
            "0",
            MonitorIniValueReader.getValue(
                LogMonitor.class.getName(), "lastLinesPerMinute", MonitorIniValueReader.UNIT));
    // pLastLinesPerMinute = new RateProperty("lastLinesPerMinute", "0", "lines", "minutes");
    pLastLinesPerMinute.setLabel(
        MonitorIniValueReader.getValue(
            LogMonitor.class.getName(), "lastAlertsPerMinute", MonitorIniValueReader.LABEL));
    // pLastLinesPerMinute.setLabel("lines/min");
    pLastLinesPerMinute.setStateOptions(2);

    pLastModDate = new NumericProperty("lastModDate");

    pLastFilePosition = new NumericProperty("lastFilePosition", "-1");

    pStartSearchPosition = new NumericProperty("startSearchPosition", "-1");

    pLastMeasurement = new NumericProperty("lastMeasurement", "0");

    pMessage = new StringProperty("message");

    pValue = new NumericProperty("value");
    pValue.setStateOptions(3);
    pValue2 = new NumericProperty("value2");
    pValue2.setStateOptions(4);
    pValue3 = new NumericProperty("value3");
    pValue3.setStateOptions(5);
    pValue4 = new NumericProperty("value4");
    pValue4.setStateOptions(6);
    StringProperty astringproperty[] = {
      pLogFile, pResetFile, pRulesFile, pNoFileCheckExist, pAlerting, pMatch, pMatches, pLines,
          pMatchDetails, pLastAlertsPerMinute,
      pLastLinesPerMinute, pLogName, pLastFilePosition, pStartSearchPosition, pLastModDate,
          pLastMeasurement, pMessage, pValue, pValue2, pValue3,
      pValue4, pValueLabels
    };
    String s = (com.dragonflow.StandardMonitor.LogMonitor.class).getName();
    addProperties(s, astringproperty);
    addClassElement(s, Rule.stringToClassifier("matchCount > 0\terror", true));
    addClassElement(s, Rule.stringToClassifier("matchCount == 'n/a'\terror"));
    addClassElement(s, Rule.stringToClassifier("always\tgood"));
    setClassProperty(
        s,
        "description",
        MonitorTypeValueReader.getValue(
            LogMonitor.class.getName(), MonitorTypeValueReader.DESCRIPTION));
    // setClassProperty(s, "description", "Scans log files for specific log entries.");

    setClassProperty(s, "help", "LogFileMon.htm");

    setClassProperty(
        s,
        "title",
        MonitorTypeValueReader.getValue(LogMonitor.class.getName(), MonitorTypeValueReader.TITLE));
    // setClassProperty(s, "title", "Log File");

    setClassProperty(s, "class", "LogMonitor");

    setClassProperty(
        s,
        "target",
        MonitorTypeValueReader.getValue(LogMonitor.class.getName(), MonitorTypeValueReader.TARGET));
    // setClassProperty(s, "target", "_logFile");

    setClassProperty(
        s,
        "topazName",
        MonitorTypeValueReader.getValue(
            LogMonitor.class.getName(), MonitorTypeValueReader.TOPAZNAME));
    // setClassProperty(s, "topazName", "Log Monitor");

    setClassProperty(
        s,
        "topazType",
        MonitorTypeValueReader.getValue(
            LogMonitor.class.getName(), MonitorTypeValueReader.TOPAZTYPE));
    // setClassProperty(s, "topazType", "System Resources");

    setClassProperty(
        s,
        "classType",
        MonitorTypeValueReader.getValue(
            LogMonitor.class.getName(), MonitorTypeValueReader.CLASSTYPE));
    // setClassProperty(s, "classType", "advanced");
  }
Пример #4
0
  static {
    maxNumberOfMatches = 30;
    ArrayList arraylist = new ArrayList();
    pScript = new ScalarProperty("_script", "");
    if (Platform.isWindows()) {
      pScript.setDisplayText(
          "Script",
          "the script from the scripts directory to run (example: scriptTest.bat), or choose <a href=\"\\SiteView\\docs\\ScriptMon.htm#script\" TARGET=Help>USE COMMAND </a>for the command file below.");
    } else {
      pScript.setDisplayText(
          "Script",
          "the script from the scripts directory to run (example: scriptTest.sh),  or choose <a href=\"\\SiteView\\docs\\ScriptMon.htm#script\" TARGET=Help>USE COMMAND </a>for the command file below.");
    }
    pScript.setParameterOptions(true, 2, false);
    arraylist.add(pScript);
    pParameters = new StringProperty("_parameters", "");
    pParameters.setDisplayText(
        "Parameters",
        "additional parameters to pass to the script. Optionally, use a <a href=/SiteView/docs/regexp.htm>regular expression</a> to insert date and time variables into the parameters <br>(e.g s/$month$ $day$ $year$/)");
    pParameters.setParameterOptions(true, 3, false);
    arraylist.add(pParameters);
    pLocalScriptLocation = new StringProperty("_localScriptLocation", "scripts");
    pLocalScriptLocation.setParameterOptions(false, true, 4, false);
    arraylist.add(pLocalScriptLocation);
    pRemoteScript = new ScalarProperty("_remotescript", "none");
    pRemoteScript.setDisplayText(
        "USE COMMAND Script File",
        "The file that contains a command to be run on the remote UNIX machine.");
    pRemoteScript.setParameterOptions(true, 4, true);
    arraylist.add(pRemoteScript);
    pCacheLife = new NumericProperty("_cacheLife", "0", "seconds");
    pCacheLife.setDisplayText(
        "Cache Life",
        "The lifetime, in seconds, of the cache, each monitor run will check if the cache life has expired, if it has not then the cache data will be used, otherwise the script will be executed to update the cache.");
    pCacheLife.setParameterOptions(true, 5, true);
    arraylist.add(pCacheLife);
    pExpression = new StringProperty("_expression");
    pExpression.setDisplayText(
        "Match Expression",
        "optional Perl regular expression to match against the output of the script or the command from the command file, to extract values (example: /(\\d*) File.*([\\d,]*) bytes/).");
    pExpression.setParameterOptions(true, 6, true);
    arraylist.add(pExpression);
    pMaxMeasurement = new NumericProperty("_maxMeasurement", "0", "milleseconds");
    pMaxMeasurement.setDisplayText(
        "Maximum for Measurement",
        "optional value to specify as maximum for gauge display in milleseconds (example: if the runtime of the script is 4 seconds and this value is set at 8 seconds (8000ms) than the gauge will show at 50%");
    pMaxMeasurement.setParameterOptions(true, 7, true);
    arraylist.add(pMaxMeasurement);
    pValueLabels = new StringProperty("_valeLabels", "");
    pValueLabels.setDisplayText(
        "Match Value Labels",
        "Labels for the values matched on the script output, separated by a \",\"");
    pValueLabels.setParameterOptions(true, 3, true);
    arraylist.add(pValueLabels);
    pTimeout = new NumericProperty("_timeout", "-1", "seconds");
    pTimeout.setDisplayText(
        "Timeout",
        "The total time, in seconds, to wait for a successful script run. Default value is -1 (no timeout).");
    pTimeout.setParameterOptions(false, 2, true);
    arraylist.add(pTimeout);
    int i = 1;
    pRoundTripTime = new NumericProperty("roundTripTime", "0", "milliseconds");
    pRoundTripTime.setLabel("round trip time");
    pRoundTripTime.setStateOptions(i++);
    arraylist.add(pRoundTripTime);
    pStatus = new StringProperty("status");
    pStatus.setIsThreshold(true);
    arraylist.add(pStatus);
    pStatusLabel = new StringProperty("_statusLabel", "status");
    pStatusLabel.setParameterOptions(false, 3, true);
    arraylist.add(pStatusLabel);
    pScriptOutput = new StringProperty("scriptOutput");
    arraylist.add(pScriptOutput);
    HashMap hashmap = MasterConfig.getMasterConfig();
    if (hashmap != null) {
      int j = TextUtils.toInt(TextUtils.getValue(hashmap, "_maxNumScriptMatches"));
      if (j > 0) {
        maxNumberOfMatches = j;
      }
    }
    pMatchValue = new NumericProperty[maxNumberOfMatches];
    int k = TextUtils.toInt(TextUtils.getValue(hashmap, "_defaultPrecision"));
    for (int l = 0; l < pMatchValue.length; l++) {
      String s = getNameFromIndex(l);
      pMatchValue[l] = new NumericProperty(s);
      pMatchValue[l].setStateOptions(i++);
      pMatchValue[l].setIsThreshold(true);
      if (k > 0) {
        pMatchValue[l].defaultPrecision = k;
      }
      arraylist.add(pMatchValue[l]);
    }

    StringProperty astringproperty[] = new StringProperty[arraylist.size()];
    for (int i1 = 0; i1 < arraylist.size(); i1++) {
      astringproperty[i1] = (StringProperty) arraylist.get(i1);
    }

    String s1 = (COM.dragonflow.StandardMonitor.ScriptMonitor.class).getName();
    addProperties(s1, astringproperty);
    addClassElement(s1, Rule.stringToClassifier("status != 0\terror"));
    addClassElement(s1, Rule.stringToClassifier("status == 0\tgood"));
    setClassProperty(
        s1,
        "description",
        "Verifies that a script or batch file can be run. Can also be used to automatically run scripts.");
    setClassProperty(s1, "help", "ScriptMon.htm");
    setClassProperty(s1, "title", "Script");
    setClassProperty(s1, "class", "ScriptMonitor");
    setClassProperty(s1, "target", "_script");
    setClassProperty(s1, "classType", "advanced");
    setClassProperty(s1, "loadable", "true");
    setClassProperty(s1, "topazName", "Script");
    setClassProperty(s1, "topazType", "System Resources");
  }