Ejemplo n.º 1
0
        static DashboardData()
        {
            _dataProviders = new List <DashboardDataProvider>();
            if (!Current.Settings.Dashboard.Enabled)
            {
                _singleDataProvider = new EmptyDataProvider("EmptyDataProvider");
                return;
            }
            var providers = Current.Settings.Dashboard.Providers;

            foreach (var p in providers)
            {
                switch (p.Type.IsNullOrEmptyReturn("").ToLower())
                {
                case "orion":
                    _dataProviders.Add(new OrionDataProvider(p));
                    break;
                    // moar providers, feed me!
                }
            }
            _dataProviders.ForEach(p => p.TryAddToGlobalPollers());
            if (_dataProviders.Count == 1)
            {
                _singleDataProvider = _dataProviders[0];
            }
        }
Ejemplo n.º 2
0
        static DashboardData()
        {
            _dataProviders = new List <DashboardDataProvider>();
            if (!Current.Settings.Dashboard.Enabled)
            {
                _singleDataProvider = new EmptyDataProvider("EmptyDataProvider");
                return;
            }
            var providers = Current.Settings.Dashboard.Providers;

            foreach (var p in providers.All)
            {
                p?.Normalize();
            }

            // Add each provider type here
            if (providers.Bosun != null)
            {
                _dataProviders.Add(new BosunDataProvider(providers.Bosun));
            }
            if (providers.Orion != null)
            {
                _dataProviders.Add(new OrionDataProvider(providers.Orion));
            }
            if (providers.WMI != null)
            {
                _dataProviders.Add(new WmiDataProvider(providers.WMI));
            }


            _dataProviders.ForEach(p => p.TryAddToGlobalPollers());
            if (_dataProviders.Count == 1)
            {
                _singleDataProvider = _dataProviders[0];
            }
        }