static {
   HashMap hashmap = MasterConfig.getMasterConfig();
   StringProperty astringproperty[] = new StringProperty[0];
   addProperties("COM.dragonflow.StandardMonitor.IPlanetWSMonitor", astringproperty);
   addClassElement(
       "COM.dragonflow.StandardMonitor.IPlanetWSMonitor",
       Rule.stringToClassifier("countersInError > 0\terror"));
   addClassElement(
       "COM.dragonflow.StandardMonitor.IPlanetWSMonitor", Rule.stringToClassifier("always\tgood"));
   setClassProperty(
       "COM.dragonflow.StandardMonitor.IPlanetWSMonitor",
       "description",
       "Monitors IPlanet Web servers using snmp.");
   setClassProperty("COM.dragonflow.StandardMonitor.IPlanetWSMonitor", "help", "IPWSMon.htm");
   setClassProperty(
       "COM.dragonflow.StandardMonitor.IPlanetWSMonitor", "title", "IPlanet Web Server");
   setClassProperty(
       "COM.dragonflow.StandardMonitor.IPlanetWSMonitor", "class", "IPlanetWSMonitor");
   setClassProperty("COM.dragonflow.StandardMonitor.IPlanetWSMonitor", "target", "_server");
   setClassProperty(
       "COM.dragonflow.StandardMonitor.IPlanetWSMonitor", "topazName", "IPlanet Web Server");
   setClassProperty("COM.dragonflow.StandardMonitor.IPlanetWSMonitor", "classType", "application");
   setClassProperty("COM.dragonflow.StandardMonitor.IPlanetWSMonitor", "topazType", "Web Server");
   if (TextUtils.getValue(hashmap, "_allowIPlanet").length() > 0) {
     setClassProperty("COM.dragonflow.StandardMonitor.IPlanetWSMonitor", "loadable", "true");
   } else {
     setClassProperty("COM.dragonflow.StandardMonitor.IPlanetWSMonitor", "loadable", "false");
   }
 }
 private static boolean useStatusAndRoundtrip() {
   if (useStatusAndRoundtrip == 0) {
     useStatusAndRoundtrip =
         TextUtils.getValue(MasterConfig.getMasterConfig(), "_scriptMonitorUseStatusAndRoundtrip")
                 .equalsIgnoreCase("false")
             ? -1
             : 1;
   }
   return useStatusAndRoundtrip != -1;
 }
Exemple #3
0
 static {
   nMaxCounters = 60;
   nMaxCounters =
       TextUtils.toInt(
           TextUtils.getValue(MasterConfig.getMasterConfig(), "_browsableContentMaxCounters"));
   if (nMaxCounters == 0) {
     nMaxCounters = 60;
   }
   pHostName = new StringProperty("_server", "");
   pHostName.setDisplayText("Server name", "the IPMI server name or IP address");
   pHostName.setParameterOptions(false, 1, false);
   pPortNumber = new StringProperty("_port", "623");
   pPortNumber.setDisplayText(
       "Port number", "the port number of the IPMI server (default is 623)");
   pPortNumber.setParameterOptions(false, 2, false);
   pUserName = new StringProperty("_user", "");
   pUserName.setDisplayText("User name", "user name to connect the IPMI server");
   pUserName.setParameterOptions(false, 3, false);
   pPassword = new StringProperty("_password", "");
   pPassword.setDisplayText("Password", "password to connect the IPMI server");
   pPassword.setParameterOptions(false, 4, false);
   pPassword.isPassword = true;
   chassisMericsMap = new Hashtable();
   chassisMericsMap.put("ChassisPowerOn", "Power On");
   chassisMericsMap.put("ChassisPowerOverload", "Power Overload");
   chassisMericsMap.put("ChassisPowerInterlock", "Power Interlock");
   chassisMericsMap.put("ChassisPowerFault", "Power Fault");
   chassisMericsMap.put("ChassisPowerControlFault", "Power Control Fault");
   chassisMericsMap.put("ChassisDriveFault", "Drive Fault");
   chassisMericsMap.put("ChassisCoolingFanFault", "Cooling Fan Fault");
   chassisMericsMap.put("ChassisIntrusion", "Chassis Intrusion");
   chassisMericsMap.put("ChassisFrontPanelLockout", "Front-Panel Lockout");
   pStatus = new StringProperty("status", "n/a");
   String s = (COM.dragonflow.StandardMonitor.IPMIMonitor.class).getName();
   StringProperty astringproperty[] = BrowsableBase.staticInitializer(nMaxCounters, true);
   StringProperty astringproperty1[] = new StringProperty[astringproperty.length + 5];
   System.arraycopy(astringproperty, 0, astringproperty1, 0, astringproperty.length);
   astringproperty1[astringproperty.length] = pHostName;
   astringproperty1[astringproperty.length + 1] = pPortNumber;
   astringproperty1[astringproperty.length + 2] = pUserName;
   astringproperty1[astringproperty.length + 3] = pPassword;
   astringproperty1[astringproperty.length + 4] = pStatus;
   addProperties(s, astringproperty1);
   setClassProperty(s, "description", "Collect IPMI data");
   setClassProperty(s, "help", "IPMIMonitor.htm");
   setClassProperty(s, "title", "IPMI");
   setClassProperty(s, "class", "IPMIMonitor");
   setClassProperty(s, "topazType", "IPMI");
   setClassProperty(s, "classType", "application");
   addClassElement(s, Rule.stringToClassifier("status == 'Error'\terror"));
   addClassElement(s, Rule.stringToClassifier("status == 'Warning'\twarning"));
   addClassElement(s, Rule.stringToClassifier("status == 'OK'\tgood"));
   setClassProperty(s, "target", "_server");
 }
  static {
    HashMap hashmap = MasterConfig.getMasterConfig();
    nMaxCounters = TextUtils.toInt(TextUtils.getValue(hashmap, "_J2EEReportMonitorMaxCounters"));
    if (nMaxCounters <= 0) {
      nMaxCounters = 1000;
    }
    String s = TextUtils.getValue(hashmap, "_J2EEReportMonitorSendZeroCounters");
    if (s.equalsIgnoreCase("false") || s.equalsIgnoreCase("0") || s.length() == 0) {
      sendZeroCounters = false;
    } else {
      sendZeroCounters = true;
    }
    Array array = new Array();
    StringProperty astringproperty[] = new StringProperty[array.size()];
    for (int i = 0; i < array.size(); i++) {
      astringproperty[i] = (StringProperty) array.at(i);
    }

    addProperties("COM.dragonflow.StandardMonitor.J2EEReportMonitor", astringproperty);
    addClassElement(
        "COM.dragonflow.StandardMonitor.J2EEReportMonitor",
        Rule.stringToClassifier("status != OK\terror"));
    addClassElement(
        "COM.dragonflow.StandardMonitor.J2EEReportMonitor",
        Rule.stringToClassifier("always\tgood"));
    setClassProperty(
        "COM.dragonflow.StandardMonitor.J2EEReportMonitor", "description", "Monitor J2EE systems.");
    setClassProperty(
        "COM.dragonflow.StandardMonitor.J2EEReportMonitor", "help", "J2EEReportMon.htm");
    setClassProperty("COM.dragonflow.StandardMonitor.J2EEReportMonitor", "title", "J2EE (Report)");
    setClassProperty(
        "COM.dragonflow.StandardMonitor.J2EEReportMonitor", "class", "J2EEReportMonitor");
    setClassProperty("COM.dragonflow.StandardMonitor.J2EEReportMonitor", "target", "_target");
    setClassProperty(
        "COM.dragonflow.StandardMonitor.J2EEReportMonitor", "topazName", "J2EE (Report)");
    setClassProperty(
        "COM.dragonflow.StandardMonitor.J2EEReportMonitor", "classType", "application");
    setClassProperty(
        "COM.dragonflow.StandardMonitor.J2EEReportMonitor", "topazType", "Web Application Server");
    if (LUtils.isValidSSforXLicense(new J2EEDummyMonitor())) {
      setClassProperty("COM.dragonflow.StandardMonitor.J2EEReportMonitor", "loadable", "true");
    } else {
      setClassProperty("COM.dragonflow.StandardMonitor.J2EEReportMonitor", "loadable", "false");
    }
  }
 public String verify(
     StringProperty stringproperty, String s, HTTPRequest httprequest, HashMap hashmap) {
   if (stringproperty == pFrequency) {
     HashMap hashmap1 = MasterConfig.getMasterConfig();
     int i = TextUtils.toInt(TextUtils.getValue(hashmap1, "_J2EEReportMonitorMinRefreshTime"));
     if (i < 15) {
       i = 300;
     }
     String s1 = httprequest.getValue(stringproperty.getName() + "Units");
     int j = FrequencyProperty.toSeconds(TextUtils.toInt(s), s1);
     if (j < i && j != 0) {
       hashmap.put(stringproperty, j + "  was less than " + i + " seconds");
     }
     return Integer.toString(j);
   } else {
     return super.verify(stringproperty, s, httprequest, hashmap);
   }
 }
 public void setMaxCounters(int i) {
   nMaxCounters = i;
   HashMap hashmap = MasterConfig.getMasterConfig();
   hashmap.put("_J2EEReportMonitorMaxCounters", (new Integer(i)).toString());
   MasterConfig.saveMasterConfig(hashmap);
 }
  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");
  }
Exemple #8
0
 public void setMaxCounters(int i) {
   nMaxCounters = i;
   HashMap hashmap = MasterConfig.getMasterConfig();
   hashmap.put("_browsableContentMaxCounters", (new Integer(i)).toString());
   MasterConfig.saveMasterConfig(hashmap);
 }