Esempio n. 1
0
        public string GetServerName(string hostOrIp)
        {
            IPAddress addr;

            if (Current.Settings.Dashboard.Enabled && IPAddress.TryParse(hostOrIp, out addr))
            {
                var nodes = DashboardData.GetNodesByIP(addr).ToList();
                if (nodes.Count == 1)
                {
                    return(nodes[0].PrettyName);
                }
            }
            //System.Net.Dns.GetHostEntry("10.7.0.46").HostName.Split(StringSplits.Period).First()
            //TODO: Redis instance search
            return(AppCache.GetHostName(hostOrIp));
        }