Пример #1
0
        public string ToConfig()
        {
            StringBuilder configVarXml = new StringBuilder();

            configVarXml.AppendLine("<configVars>");
            foreach (ConfigVariable cv in ConfigVariables)
            {
                configVarXml.AppendLine(cv.ToXml());
            }
            configVarXml.AppendLine("</configVars>");
            string config = string.Format(Properties.Resources.NotifierEntryXml,
                                          Name.EscapeXml(),
                                          NotifierRegistrationName,
                                          Enabled,
                                          Enum.GetName(typeof(QuickMon.AlertLevel), this.AlertLevel),
                                          Enum.GetName(typeof(QuickMon.DetailLevel), this.DetailLevel),
                                          AttendedOptionOverride.ToString(),
                                          InitialConfiguration,
                                          ServiceWindows.ToConfig(),
                                          AlertForCollectorsConfig(),
                                          configVarXml.ToString()
                                          );

            return(config);
        }
Пример #2
0
        /// <summary>
        /// Export current CollectorEntry config as XML string
        /// </summary>
        /// <returns>XML config string</returns>
        public string ToConfig()
        {
            string        collectorConfig = (InitialConfiguration == null || InitialConfiguration.Length == 0) && (Collector != null) && (Collector.AgentConfig != null) ? Collector.AgentConfig.ToConfig() : InitialConfiguration;
            StringBuilder configVarXml    = new StringBuilder();

            configVarXml.AppendLine("<configVars>");
            foreach (ConfigVariable cv in ConfigVariables)
            {
                configVarXml.AppendLine(cv.ToXml());
            }
            configVarXml.AppendLine("</configVars>");
            string config = ToConfig(UniqueId,
                                     Name.EscapeXml(),
                                     Enabled,
                                     ExpandOnStart,
                                     IsFolder,
                                     CollectorRegistrationName,
                                     ParentCollectorId,
                                     CollectOnParentWarning,
                                     RepeatAlertInXMin, AlertOnceInXMin, DelayErrWarnAlertForXSec,
                                     RepeatAlertInXPolls, AlertOnceInXPolls, DelayErrWarnAlertForXPolls,
                                     CorrectiveScriptDisabled,
                                     CorrectiveScriptOnWarningPath,
                                     CorrectiveScriptOnErrorPath,
                                     RestorationScriptPath,
                                     CorrectiveScriptsOnlyOnStateChange,
                                     EnableRemoteExecute,
                                     ForceRemoteExcuteOnChildCollectors,
                                     RemoteAgentHostAddress,
                                     RemoteAgentHostPort,
                                     BlockParentOverrideRemoteAgentHostSettings,
                                     RunLocalOnRemoteHostConnectionFailure,

                                     EnabledPollingOverride,
                                     OnlyAllowUpdateOncePerXSec,
                                     EnablePollFrequencySliding,
                                     PollSlideFrequencyAfterFirstRepeatSec,
                                     PollSlideFrequencyAfterSecondRepeatSec,
                                     PollSlideFrequencyAfterThirdRepeatSec,
                                     AlertsPaused,

                                     collectorConfig,
                                     ServiceWindows.ToConfig(),
                                     configVarXml.ToString()
                                     );

            return(config);
        }
Пример #3
0
        public string ToConfig()
        {
            string config = string.Format(Properties.Resources.CollectorEntryXml,
                                          UniqueId,
                                          Name.EscapeXml(),
                                          Enabled,
                                          IsFolder,
                                          CollectorRegistrationName,
                                          ParentCollectorId,
                                          CollectOnParentWarning,
                                          RepeatAlertInXMin,
                                          AlertOnceInXMin,
                                          DelayErrWarnAlertForXSec,
                                          CorrectiveScriptDisabled,
                                          CorrectiveScriptOnWarningPath,
                                          CorrectiveScriptOnErrorPath,
                                          Configuration,
                                          ServiceWindows.ToConfig());

            return(config);
        }