Exemplo n.º 1
0
        public static void AddAgentListView(CommonLib.InnerMsgAgentStatus agentStatus)
        {
            var lvi = new System.Windows.Forms.ListViewItem(agentStatus.connectID);

            lvi.SubItems.Add(agentStatus.IP);
            lvi.SubItems.Add(agentStatus.AppServerName);
            lvi.SubItems.Add(agentStatus.AppServerFullPath);
            lvi.SubItems.Add("N");
            lvi.SubItems.Add(agentStatus.전체_CPU_사용량);
            lvi.SubItems.Add(agentStatus.프로세스_CPU_사용량);
            lvi.SubItems.Add(agentStatus.AppServer메모리_사용량);
            lvi.SubItems.Add("모름");

            ListViewAgent.Items.Add(lvi);
            ListViewAgent.Refresh();
        }
Exemplo n.º 2
0
        static public bool AddAgent(CommonLib.InnerMsgAgentStatus status)
        {
            var agent = new Agent()
            {
                connectionID = status.connectID, IPAddress = status.IP
            };

            if (AgentMap.TryAdd(status.connectID, agent))
            {
                agent.SetAgentStatus(status);
                CommonLib.DevLog.Write(string.Format("Agent:{0}. 추가", status.connectID), CommonLib.LOG_LEVEL.INFO);
            }
            else
            {
                CommonLib.DevLog.Write(string.Format("Agent:{0}. 추가 실패", status.connectID), CommonLib.LOG_LEVEL.ERROR);
                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
        //////////////////////////////////////////////////////////////////////////////////////////
        //<<< 받는 메시지 정의
        public void Agent로부터_정보통보(string jsonFormatMsg)
        {
            string connectionID = Context.ConnectionId;
            var    agentInfo    = JsonConvert.DeserializeObject <CommonLib.MsgAgentInfo>(jsonFormatMsg);

            CommonLib.DevLog.Write(string.Format("Agent:{0}. AppServerName:{1}", connectionID, agentInfo.appServerName), CommonLib.LOG_LEVEL.INFO);


            var agentStatus = new CommonLib.InnerMsgAgentStatus()
            {
                connectID              = connectionID,
                에이전트_허트비트_문제발생         = false,
                IP                     = agentInfo.ipAddress,
                AppServerName          = agentInfo.appServerName,
                AppServerFullPath      = agentInfo.appServerFullPathDir,
                AppServer실행중           = false,
                전체_CPU_사용량             = "0",
                프로세스_CPU_사용량           = "0",
                AppServer메모리_사용량       = "0",
                Agent와AppServer통신가능_여부 = false,
                AppServer접속인원수         = "0",
            };


            string json = JsonConvert.SerializeObject(agentStatus, Formatting.Indented);

            CommonLib.InnerMessageManager.AddMsg(new CommonLib.InnerMsg()
            {
                type         = CommonLib.InnerMsgType.AGENT_CONNECT,
                connectionID = connectionID,
                value1       = json
            });

            //System.Threading.Thread.Sleep(10000);
            //CommonLib.DevLog.Write("호출 완료");
        }
Exemplo n.º 4
0
 public void SetAgentStatus(CommonLib.InnerMsgAgentStatus status)
 {
     agentStatus = status;
 }