Ejemplo n.º 1
0
        public ServerStatusDTO GetServerStatus()
        {
            ServerStatusDTO dto = new ServerStatusDTO();

            dto.connectCount       = ServerContext.ConnectCount;
            dto.totalReceivedBytes = ServerContext.TotalReceivedBytes;
            dto.totalSentBytes     = ServerContext.TotalSentBytes;
            return(dto);
        }
Ejemplo n.º 2
0
        public ServerStatusDTO GetServerStatus()
        {
            ServerStatusDTO dto = new ServerStatusDTO
            {
                connectCount       = ServerContext.ConnectCount,
                totalReceivedBytes = ServerContext.TotalReceivedBytes,
                totalSentBytes     = ServerContext.TotalSentBytes
            };

            return(dto);
        }
Ejemplo n.º 3
0
        public IActionResult GetSystemStatus()
        {
            var server = new ServerStatusDTO();


            try { server.drives = GetDriveStatus(); }
            catch (Exception e) { server.errors += "Drives: " + e.Message + ' '; }

            try { server.vpn = GetVpnStatus(); }
            catch (Exception e) { server.errors += "VPN: " + e.Message + ' '; }

            try { server.processes = GetProcessStats(); }
            catch (Exception e) { server.errors += "Processes: " + e.Message + ' '; }

            try { server.resources = GetServerResources(); }
            catch (Exception e) { server.errors += "Resources: " + e.Message + ' '; }


            return(Ok(server));
        }