@Override
  public State getRunningState(String hostName, String componentName) {
    String serviceName = getServiceName(componentName);
    if (serviceName != null) {
      String[] cmdStrings = {"sc", "\\\\" + hostName, "query", "\"" + serviceName + "\""}; // Windows specific command

      java.lang.Process process = runProcess(cmdStrings);

      if (process.exitValue() == 0) {

        String response = getProcessResponse(process.getInputStream());

        int i = response.indexOf(STATE_PREFIX);
        if (i >= 0) {
          int state = Integer.parseInt(response.substring(i + STATE_PREFIX.length(), i + STATE_PREFIX.length() + 1));
          switch (state) {
            case (1): // service stopped
              return State.Stopped;
            case (4): // service started
              return State.Running;
          }
        }
      }
    }
    return State.Unknown;
  }
Provider module used to install PropertyProviders required for ambari-scom.
contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/scom/SQLProviderModule.java