Examples of ServerStatus


Examples of com.gitblit.models.ServerStatus

  }

  public MockRuntimeManager(IStoredSettings settings) {
    this.settings = settings;

    this.serverStatus = new ServerStatus();
    this.serverStatus.servletContainer = "MockServer";

    this.serverSettings = new ServerSettings();
  }
View Full Code Here

Examples of com.l2jfrozen.gameserver.network.gameserverpackets.ServerStatus

              AuthResponse aresp = new AuthResponse(decrypt);
              _serverID = aresp.getServerId();
              _serverName = aresp.getServerName();
              Config.saveHexid(_serverID, hexToString(_hexID));
              _log.info("Registered on login as Server " + _serverID + " : " + _serverName);
              ServerStatus st = new ServerStatus();
              if(Config.SERVER_LIST_BRACKET)
              {
                st.addAttribute(ServerStatus.SERVER_LIST_SQUARE_BRACKET, ServerStatus.ON);
              }
              else
              {
                st.addAttribute(ServerStatus.SERVER_LIST_SQUARE_BRACKET, ServerStatus.OFF);
              }
              if(Config.SERVER_LIST_CLOCK)
              {
                st.addAttribute(ServerStatus.SERVER_LIST_CLOCK, ServerStatus.ON);
              }
              else
              {
                st.addAttribute(ServerStatus.SERVER_LIST_CLOCK, ServerStatus.OFF);
              }
              if(Config.SERVER_LIST_TESTSERVER)
              {
                st.addAttribute(ServerStatus.TEST_SERVER, ServerStatus.ON);
              }
              else
              {
                st.addAttribute(ServerStatus.TEST_SERVER, ServerStatus.OFF);
              }
              if(Config.SERVER_GMONLY)
              {
                st.addAttribute(ServerStatus.SERVER_LIST_STATUS, ServerStatus.STATUS_GM_ONLY);
              }
              else
              {
                st.addAttribute(ServerStatus.SERVER_LIST_STATUS, ServerStatus.STATUS_AUTO);
              }
              sendPacket(st);
              if(L2World.getAllPlayersCount() > 0)
              {
                FastList<String> playerList = new FastList<String>();
View Full Code Here

Examples of com.l2jfrozen.loginserver.network.gameserverpackets.ServerStatus

    {
      if(Config.DEBUG)
      {
        _log.info("ServerStatus received");
      }
      /*ServerStatus ss = */new ServerStatus(data, getServerId()); //server status
    }
    else
    {
      forceClose(LoginServerFail.NOT_AUTHED);
    }
View Full Code Here

Examples of com.lanyuan.entity.ServerStatus

   */
  @ResponseBody
  @RequestMapping(value = "info")
  public Map<String, Object> serverBaseInfo() throws Exception {
    Map<String, Object> dataMap = new HashMap<String, Object>();
    ServerStatus status = Common.getServerStatus();
    dataMap.put("data", status);
    return dataMap;
  }
View Full Code Here

Examples of com.lanyuan.entity.ServerStatus

   * @throws Exception
   */
  @ResponseBody
  @RequestMapping("/warnInfo")
  public Map<String, Object> warnInfo(HttpServletRequest request) throws Exception {
    ServerStatus status = Common.getServerStatus();
    Map<String, Object> dataMap = new HashMap<String, Object>();

    String cpuUsage = status.getCpuUsage();
    long FreeMem = status.getFreeMem();
    long useMem = status.getUsedMem();
    long TotalMem = status.getTotalMem();
    String serverUsage = Common.fromUsage(useMem, TotalMem);
    dataMap.put("cpuUsage", cpuUsage);
    dataMap.put("FreeMem", FreeMem);
    dataMap.put("TotalMem", TotalMem);
    dataMap.put("serverUsage", serverUsage);
    long JvmFreeMem = status.getJvmFreeMem();
    long JvmTotalMem = status.getJvmTotalMem();
    String JvmUsage = Common.fromUsage(JvmTotalMem - JvmFreeMem, JvmTotalMem);
    dataMap.put("JvmFreeMem", JvmFreeMem);
    dataMap.put("JvmTotalMem", JvmTotalMem);
    dataMap.put("JvmUsage", JvmUsage);
    dataMap.put("cpu", PropertiesUtils.findPropertiesKey("cpu"));
    dataMap.put("jvm", PropertiesUtils.findPropertiesKey("jvm"));
    dataMap.put("ram", PropertiesUtils.findPropertiesKey("ram"));
    dataMap.put("toEmail", PropertiesUtils.findPropertiesKey("toEmail"));
    dataMap.put("diskInfos", status.getDiskInfos());
    return dataMap;
  }
View Full Code Here

Examples of com.lanyuan.entity.ServerStatus

  /**
   * 返回服务系统信息
   * @throws Exception
   */
  public static ServerStatus getServerStatus() throws Exception {
    ServerStatus status = new ServerStatus();
    status.setServerTime(DateFormatUtils.format(Calendar.getInstance(), "yyyy-MM-dd HH:mm:ss"));
    status.setServerName(System.getenv().get("COMPUTERNAME"));

    Runtime rt = Runtime.getRuntime();
    //status.setIp(InetAddress.getLocalHost().getHostAddress());
    status.setJvmTotalMem(rt.totalMemory() / (1024 * 1024));
    status.setJvmFreeMem(rt.freeMemory() / (1024 * 1024));
    status.setJvmMaxMem(rt.maxMemory()/ (1024 * 1024));
    Properties props = System.getProperties();
    status.setServerOs(props.getProperty("os.name") + " " + props.getProperty("os.arch") + " " + props.getProperty("os.version"));
    status.setJavaHome(props.getProperty("java.home"));
    status.setJavaVersion(props.getProperty("java.version"));
    status.setJavaTmpPath(props.getProperty("java.io.tmpdir"));

    Sigar sigar = new Sigar();
    getServerCpuInfo(sigar, status);
    getServerDiskInfo(sigar, status);
    getServerMemoryInfo(sigar, status);
View Full Code Here

Examples of com.lanyuan.entity.ServerStatus

   *
   * @throws Exception
   */
  @Scheduled(cron = "1 * *  * * ? ")
  public void task() throws Exception {
    ServerStatus status = Common.getServerStatus();
    String cpuUsage = status.getCpuUsage();// CPU使用率
    String serverUsage = Common.fromUsage(status.getUsedMem(), status.getTotalMem());// 系统内存使用率
    String JvmUsage = Common.fromUsage(status.getJvmFreeMem(), status.getJvmTotalMem());// 计算JVM内存使用率
    Properties prop = PropertiesUtils.getProperties();
    String cpu = prop.getProperty("cpu");
    String jvm = prop.getProperty("jvm");
    String ram = prop.getProperty("ram");
    String email = prop.getProperty("toEmail");
View Full Code Here

Examples of com.netflix.exhibitor.core.entities.ServerStatus

    private ServerStatus getStatus(ServerSpec spec)
    {
        if ( spec.equals(us) )
        {
            InstanceStateTypes state = exhibitor.getMonitorRunningInstance().getCurrentInstanceState();
            return new ServerStatus(spec.getHostname(), state.getCode(), state.getDescription(), exhibitor.getMonitorRunningInstance().isCurrentlyLeader());
        }

        try
        {
            RemoteInstanceRequest           request = new RemoteInstanceRequest(exhibitor, spec.getHostname());
            RemoteInstanceRequest.Result    result = request.makeRequest(exhibitor.getRemoteInstanceRequestClient(), "getStatus");

            ObjectMapper                    mapper = new ObjectMapper();
            JsonNode                        value = mapper.readTree(mapper.getJsonFactory().createJsonParser(result.remoteResponse));
            if ( value.size() == 0 )
            {
                return new ServerStatus(spec.getHostname(), InstanceStateTypes.DOWN.getCode(), InstanceStateTypes.DOWN.getDescription(), false);
            }

            int                             code = value.get("state").getValueAsInt();
            String                          description = value.get("description").getTextValue();
            return new ServerStatus(spec.getHostname(), code, description, value.get("isLeader").getBooleanValue());
        }
        catch ( IOException e )
        {
            log.error("Getting remote server status", e);
            throw new RuntimeException(e);
View Full Code Here

Examples of l2p.gameserver.loginservercon.gspackets.ServerStatus

    attributes.add(new Attribute(Attribute.SERVER_LIST_SQUARE_BRACKET, Config.SERVER_LIST_BRACKET ? Attribute.ON : Attribute.OFF));
    attributes.add(new Attribute(Attribute.SERVER_LIST_CLOCK, Config.SERVER_LIST_CLOCK ? Attribute.ON : Attribute.OFF));
    attributes.add(new Attribute(Attribute.TEST_SERVER, Config.SERVER_LIST_TESTSERVER ? Attribute.ON : Attribute.OFF));
    attributes.add(new Attribute(Attribute.SERVER_LIST_STATUS, Config.SERVER_GMONLY ? Attribute.STATUS_GM_ONLY : Attribute.STATUS_AUTO));
    getLoginServer().setAuthResponsed(true);
    sendPacket(new ServerStatus(attributes));
    if(L2ObjectsStorage.getAllPlayersCount() > 0)
    {
      GArray<String> playerList = new GArray<String>();
      for(L2Player player : L2ObjectsStorage.getAllPlayers())
      {
View Full Code Here

Examples of l2p.loginserver.gameservercon.gspackets.ServerStatus

          break;
        case 0x05:
          packet = new PlayerAuthRequest(data, gameserver);
          break;
        case 0x06:
          packet = new ServerStatus(data, gameserver);
          break;
        case 0x07:
          packet = new BanIP(data, gameserver);
          break;
        case 0x08:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.