Example #1
0
  /** Task run() implementation. */
  public void run() {

    PMData pmData = null;
    try {
      pmData = getPMData(pmparams, pmflags);
    } catch (Exception e) {
      IsmMonAgentUtil.debug(e.getMessage(), IsmMonAgentUtil.CRITICAL);
      IsmMonAgentUtil.trace(e);
    }
    if (pmData != null) {
      if (listenerList != null && listenerList.size() > 0) {
        TaskEvent taskEvent = new TaskEvent(this, getLastExecutionTime(), pmData);
        for (Enumeration en = listenerList.elements(); en.hasMoreElements(); ) {
          ((TaskListener) en.nextElement()).taskExecuted(taskEvent);
        }
      }
    }
  }
Example #2
0
  private static void addParams(
      Vector paramlist,
      String fsName,
      float totalVal,
      float usedVal,
      float freeVal,
      String capacity,
      String mountFS) {

    for (Enumeration en = logSpaceList.keys(); en.hasMoreElements(); ) {
      String logSpaceName = (String) en.nextElement();
      String[] logDirList = (String[]) logSpaceList.get(logSpaceName);
      for (int i = 0; i < logDirList.length; i++) {
        String logDirPath = logDirList[i];

        // Get actual filesystem name for the directory
        String fs = (String) filesystemMap.get(logDirPath) + "/";

        if (fs != null && fs.equals(mountFS)) {
          String modifier = logSpaceName + "=" + logDirPath;
          paramlist.addElement(
              new PmMeasurement(
                  DIRPATHUSEDSPACENAME,
                  String.valueOf(getDirDiskSpace(logDirPath)),
                  true,
                  modifier));
          paramlist.addElement(new PmMeasurement(FILESYSTEMNAME, fsName, true, modifier));
          paramlist.addElement(
              new PmMeasurement(TOTALSPACENAME, String.valueOf(totalVal), true, modifier));
          paramlist.addElement(
              new PmMeasurement(USEDSPACENAME, String.valueOf(usedVal), true, modifier));
          paramlist.addElement(
              new PmMeasurement(AVAILSPACENAME, String.valueOf(freeVal), true, modifier));
          paramlist.addElement(new PmMeasurement(USEDCAPACITYNAME, capacity, true, modifier));
        }
      }
    }
  }