Beispiel #1
0
        public IrcBotManager()
        {
            this.configuration = CreateConfiguration();
            this.bot = new IrcBot(this.configuration);

            this.teamCityFeedUri = ConfigurationManager.AppSettings["feed"];
            this.productionElb = ConfigurationManager.AppSettings["productionElbName"];
            this.uatElb = ConfigurationManager.AppSettings["uatElbName"];
            this.statusPageBucketName = ConfigurationManager.AppSettings["statusPageBucket"];

            // report build status
            if (!string.IsNullOrWhiteSpace(this.teamCityFeedUri))
                this.bot.AddTask(new IrcTeamCityBuildStatusTask(
                    new Uri(this.teamCityFeedUri),
                    "Insight TeamCity Build Status Task"
                ));

            if (!string.IsNullOrWhiteSpace(productionElb))
            {
                // report production aws elb status
                this.bot.AddTask(new IrcElbStatusTask(
                    productionElb,
                    "Insight Production ELB Status Task"
                ));

                // reboot unhealthy ec2 instances on production elb
                this.bot.AddTask(new InsightInstanceMonitor(
                    productionElb,
                    "Insight Production Unhealthy EC2 Instance Monitor Task"
                ));
            }

            if (!string.IsNullOrWhiteSpace(uatElb))
            {
                // report uat aws elb status
                this.bot.AddTask(new IrcElbStatusTask(
                    uatElb,
                    "Insight UAT ELB Status Task"
                ));

                // reboot unhealthy ec2 instances on uat elb
                this.bot.AddTask(new InsightInstanceMonitor(
                    uatElb,
                    "Insight UAT Unhealthy EC2 Instance Monitor Task"
                ));
            }

            // upload aws elb status page to s3
            if (!string.IsNullOrEmpty(productionElb) && !string.IsNullOrEmpty(this.statusPageBucketName))
                this.bot.AddTask(new InsightInstanceUrlUploadTask(productionElb, this.statusPageBucketName));

            //this.bot.AddTask(new InsightInstanceStatsMonitorTask("healthcheck/stats"));
        }
Beispiel #2
0
        public IrcBot(IrcBotConfiguration configuration)
        {
            this.tasks = new List<IIrcTask>();
            this.users = new ConcurrentDictionary<string, IrcBotUser>();

            configuration.UserName = configuration.UserName ?? configuration.NickName;
            configuration.RealName = configuration.RealName?? configuration.NickName;

            this.Configuration = configuration;

            this.commandPrefix = string.Format("{0}", this.Configuration.NickName.ToLower());

            this.client = new IrcClient();
        }
Beispiel #3
0
 public CommandOrchestratorRule(IOptions <IrcBotConfiguration> options, ICommandOrchestratorBuilder builder, ICommandProcessorProvider processorProvider)
 {
     configuration          = options.Value;
     this.builder           = builder;
     this.processorProvider = processorProvider;
 }
Beispiel #4
0
 public HelloRule(IOptions <IrcBotConfiguration> options)
 {
     config = options.Value;
 }
Beispiel #5
0
 public ExceptionLoggingRule(IOptions <IrcBotConfiguration> options)
 {
     config = options.Value;
 }
Beispiel #6
0
 public CommandAliasRule(IOptions <IrcBotConfiguration> options, IServiceProvider serviceProvider)
 {
     Configuration   = options.Value;
     ServiceProvider = serviceProvider;
 }
Beispiel #7
0
 public HelpCommandProcessor(ICommandOrchestratorBuilder builder, IOptions <IrcBotConfiguration> options)
 {
     this.builder     = builder;
     botConfiguration = options.Value;
 }