예제 #1
0
        //---------------------------------------------------------------------
        private static List <MPOverride> GenerateEffectiveOverrrideList(
            PartialMonitoringObject monitoringObject,
            ReadOnlyCollection <ManagementPackMonitor> monitors,
            Dictionary <Guid, MonitoringClass> typeLookupTable
            )
        {
            List <MPOverride> overrides = new List <MPOverride>();

            foreach (ManagementPackMonitor monitor in monitors)
            {
                // if we do this check which I commented out, it only works for Windows computer, not for linux ones...
                // I am not sure why the check was done in the first place... what was it preventing from doing?
                // was it just an optimization to speed things up, or was it protecting the UI from dealing with some weird monitors?

                //if (!DoesMonitorHaveNonCategoryOverride(monitor))
                //{
                //    continue;
                //}

                MonitorResultantOverrideSet overrideSet = monitoringObject.GetResultantOverrides(monitor);

                MPWorkflow workflow = new MPWorkflow(monitor);

                foreach (ResultantOverride <MonitorConfigurationOverride> monitorOverride in overrideSet.ResultantConfigurationOverrides.Values)
                {
                    MonitoringClass target = typeLookupTable[monitor.Target.Id];

                    workflow.AddOverride(monitorOverride.EffectiveOverride);

                    MPOverride mpOverride = new MPOverride(monitorOverride.EffectiveOverride,
                                                           workflow,
                                                           new MPClass(target));
                    overrides.Add(mpOverride);
                }

                foreach (ResultantOverride <ManagementPackOverride> monitorOverride in overrideSet.ResultantPropertyOverrides.Values)
                {
                    MonitoringClass target = typeLookupTable[monitor.Target.Id];

                    workflow.AddOverride(monitorOverride.EffectiveOverride);

                    MPOverride mpOverride = new MPOverride(monitorOverride.EffectiveOverride,
                                                           workflow,
                                                           new MPClass(target));
                    overrides.Add(mpOverride);
                }
            }

            return(overrides);
        }
예제 #2
0
        //---------------------------------------------------------------------
        private static List <MPOverride> GenerateEffectiveOverrrideList(
            PartialMonitoringObject monitoringObject,
            ReadOnlyCollection <MonitoringDiscovery> discoveries,
            Dictionary <Guid, MonitoringClass> typeLookupTable
            )
        {
            List <MPOverride> overrides = new List <MPOverride>();

            foreach (MonitoringDiscovery discovery in discoveries)
            {
                MonitoringDiscoveryResultantOverrideSet overrideSet = monitoringObject.GetResultantOverrides(discovery);

                MPWorkflow workflow = new MPWorkflow(discovery);

                foreach (ResultantOverride <MonitoringDiscoveryConfigurationOverride> discoveryOverride in overrideSet.ResultantConfigurationOverrides.Values)
                {
                    MonitoringClass target = typeLookupTable[discovery.Target.Id];

                    workflow.AddOverride(discoveryOverride.EffectiveOverride);

                    MPOverride mpOverride = new MPOverride(discoveryOverride.EffectiveOverride,
                                                           workflow,
                                                           new MPClass(target));
                    overrides.Add(mpOverride);
                }

                foreach (ResultantOverride <ManagementPackOverride> discoveryOverride in overrideSet.ResultantPropertyOverrides.Values)
                {
                    MonitoringClass target = typeLookupTable[discovery.Target.Id];

                    workflow.AddOverride(discoveryOverride.EffectiveOverride);

                    MPOverride mpOverride = new MPOverride(discoveryOverride.EffectiveOverride,
                                                           workflow,
                                                           new MPClass(target));
                    overrides.Add(mpOverride);
                }
            }

            return(overrides);
        }
예제 #3
0
        //---------------------------------------------------------------------
        private static List<MPOverride> GenerateEffectiveOverrrideList(
            PartialMonitoringObject                         monitoringObject,
            ReadOnlyCollection<MonitoringDiscovery>         discoveries,
            Dictionary<Guid, MonitoringClass>               typeLookupTable
            )
        {
            List<MPOverride> overrides = new List<MPOverride>();

            foreach (MonitoringDiscovery discovery in discoveries)
            {
                MonitoringDiscoveryResultantOverrideSet overrideSet = monitoringObject.GetResultantOverrides(discovery);

                MPWorkflow workflow = new MPWorkflow(discovery);

                foreach (ResultantOverride<MonitoringDiscoveryConfigurationOverride> discoveryOverride in overrideSet.ResultantConfigurationOverrides.Values)
                {
                    MonitoringClass target = typeLookupTable[discovery.Target.Id];

                    workflow.AddOverride(discoveryOverride.EffectiveOverride);

                    MPOverride mpOverride = new MPOverride(discoveryOverride.EffectiveOverride,
                                                           workflow,
                                                           new MPClass(target));
                    overrides.Add(mpOverride);
                }

                foreach (ResultantOverride<ManagementPackOverride> discoveryOverride in overrideSet.ResultantPropertyOverrides.Values)
                {
                    MonitoringClass target = typeLookupTable[discovery.Target.Id];

                    workflow.AddOverride(discoveryOverride.EffectiveOverride);

                    MPOverride mpOverride = new MPOverride(discoveryOverride.EffectiveOverride,
                                                           workflow,
                                                           new MPClass(target));
                    overrides.Add(mpOverride);
                }
            }

            return (overrides);
        }
예제 #4
0
        //---------------------------------------------------------------------
        private static List<MPOverride> GenerateEffectiveOverrrideList(
            PartialMonitoringObject                     monitoringObject,
            ReadOnlyCollection<ManagementPackMonitor>   monitors,
            Dictionary<Guid, MonitoringClass>           typeLookupTable
            )
        {
            List<MPOverride> overrides = new List<MPOverride>();

            foreach (ManagementPackMonitor monitor in monitors)
            {
                // if we do this check which I commented out, it only works for Windows computer, not for linux ones...
                // I am not sure why the check was done in the first place... what was it preventing from doing?
                // was it just an optimization to speed things up, or was it protecting the UI from dealing with some weird monitors?

                //if (!DoesMonitorHaveNonCategoryOverride(monitor))
                //{
                //    continue;
                //}

                MonitorResultantOverrideSet overrideSet = monitoringObject.GetResultantOverrides(monitor);

                MPWorkflow workflow = new MPWorkflow(monitor);

                foreach (ResultantOverride<MonitorConfigurationOverride> monitorOverride in overrideSet.ResultantConfigurationOverrides.Values)
                {
                    MonitoringClass target = typeLookupTable[monitor.Target.Id];

                    workflow.AddOverride(monitorOverride.EffectiveOverride);

                    MPOverride mpOverride = new MPOverride(monitorOverride.EffectiveOverride,
                                                           workflow,
                                                           new MPClass(target));
                    overrides.Add(mpOverride);
                }

                foreach (ResultantOverride<ManagementPackOverride> monitorOverride in overrideSet.ResultantPropertyOverrides.Values)
                {
                    MonitoringClass target = typeLookupTable[monitor.Target.Id];

                    workflow.AddOverride(monitorOverride.EffectiveOverride);

                    MPOverride mpOverride = new MPOverride(monitorOverride.EffectiveOverride,
                                                           workflow,
                                                           new MPClass(target));
                    overrides.Add(mpOverride);
                }
            }

            return (overrides);
        }