public static int AddMonitor(ExternalMonitor externalMonitor, OutputType output,bool dnsWithParams=false)
        {
            string testName = "test ping ololo: ololo;" + Common.GenerateRandomString(5);
             string tag = tagNew;
            int[] locationsIds = new int[] { 4, 11 };
            ExternalMonitor.TestType testType = ExternalMonitor.TestType.ping;
            if (dnsWithParams)
                testType = ExternalMonitor.TestType.dns;

            var testparams = new Dictionary<string, string>();
            if (dnsWithParams)
            {
                //testparams.Add("test1", "fffgfygfhgf");
                //testparams.Add("test2", "bbb");
                //testparams.Add("test3", "dddd");
                //testparams.Add("test4", "ffff");
                //testparams.Add("test5", "ffff");

                testparams.Add("server", "google.com");
                testparams.Add("expip", "209.85.148.113");
                testparams.Add("expauth", "A");
            }

            var result = externalMonitor.AddMonitor(
                testType,
                testName,
                url,
                ExternalMonitor.CheckInterval.five,
                tag,
                output: output,
                locationIds: locationsIds,
                testParams: testparams);
            return result.testId;
        }
Пример #2
0
        public void Setup()
        {
            authentication = new Authentication(apiKey: MonitisAccountInformation.ApiKey,
                                                secretKey: MonitisAccountInformation.SekretKey);

            externalMonitor = new ExternalMonitor();
            externalMonitor.SetAuthenticationParams(authentication);
        }
Пример #3
0
        private void AddPageAddNewExternalMonitorAddPageModuleDeleteMonitorDeletePage(OutputType output)
        {
            //add page
            string pageName = "Test api page" + Common.GenerateRandomString(5);
            int    pageId   = layout.AddPage(pageName, 2, output);
            //add external monitor
            ExternalMonitor externalMonitor   = new ExternalMonitor(authentication);
            int             idMonitorToDelete = ExternalMonitorTests.AddMonitor(externalMonitor, output);

            //add module
            int pageModuleId = layout.AddPageModule(Layout.ModulName.External, pageId, 2, 2, idMonitorToDelete,
                                                    output: output);

            //delete page module
            layout.DeletePageModule(pageModuleId, output: output);
            //delete module
            externalMonitor.DeleteMonitors(testId: idMonitorToDelete, output: output);
            //delete page
            layout.DeletePage(pageId, output);
        }
Пример #4
0
        public static int AddMonitor(ExternalMonitor externalMonitor, OutputType output, bool dnsWithParams = false)
        {
            string testName = "test ping ololo: ololo;" + Common.GenerateRandomString(5);
            string tag      = tagNew;

            int[] locationsIds = new int[] { 4, 11 };
            ExternalMonitor.TestType testType = ExternalMonitor.TestType.ping;
            if (dnsWithParams)
            {
                testType = ExternalMonitor.TestType.dns;
            }

            var testparams = new Dictionary <string, string>();

            if (dnsWithParams)
            {
                //testparams.Add("test1", "fffgfygfhgf");
                //testparams.Add("test2", "bbb");
                //testparams.Add("test3", "dddd");
                //testparams.Add("test4", "ffff");
                //testparams.Add("test5", "ffff");

                testparams.Add("server", "google.com");
                testparams.Add("expip", "209.85.148.113");
                testparams.Add("expauth", "A");
            }

            var result = externalMonitor.AddMonitor(
                testType,
                testName,
                url,
                ExternalMonitor.CheckInterval.five,
                tag,
                output: output,
                locationIds: locationsIds,
                testParams: testparams);

            return(result.testId);
        }
        private void AddPageAddNewExternalMonitorAddPageModuleDeleteMonitorDeletePage(OutputType output)
        {
            //add page
            string pageName = "Test api page" + Common.GenerateRandomString(5);
            int pageId = layout.AddPage(pageName, 2, output);
            //add external monitor
            ExternalMonitor externalMonitor = new ExternalMonitor(authentication);
            int idMonitorToDelete = ExternalMonitorTests.AddMonitor(externalMonitor, output);

            //add module
            int pageModuleId = layout.AddPageModule(Layout.ModulName.External, pageId, 2, 2, idMonitorToDelete,
                                                    output: output);
            //delete page module
            layout.DeletePageModule(pageModuleId, output: output);
            //delete module
            externalMonitor.DeleteMonitors(testId: idMonitorToDelete, output: output);
            //delete page
            layout.DeletePage(pageId, output);
        }
 internal HumanUnderstandableExecutionMonitor(Monitor monitor, ExternalMonitor externalMonitor)
 {
     this._monitor         = monitor;
     this._externalMonitor = externalMonitor;
 }
        public void Setup()
        {
            authentication = new Authentication(apiKey: MonitisAccountInformation.ApiKey,
                                                secretKey: MonitisAccountInformation.SekretKey);

            externalMonitor = new ExternalMonitor();
            externalMonitor.SetAuthenticationParams(authentication);
        }