public WebCollector(DBParamter paramter) : base(paramter) { _connStr = $"Database={paramter.DBName};Data Source={paramter.Host};User Id={paramter.Username};Password={paramter.Password};pooling=false;CharSet=utf8;port={paramter.Port}"; _business = new Collector1.CollectorBusiness(_connStr); Paramter = paramter; }
public bool EditMonitorItem(string collectorHost, DBParamter paramter) { try { string url = UrlHelper.GetInstance().GetCollectUrl(collectorHost, $"Collect/EditDBMonitor"); WebApiClient client = new WebApiClient(); return(client.Post <bool, DBParamter>(url, paramter)); } catch (WebApiClientException ex) { throw new Exception(ex.Message); } }
public bool AddDBMonitor(DBParamter paramter) { try { CollectorCenter.GetInstance().Add(CollectorType.Web, paramter); return(true); } catch (Exception ex) { throw new HttpResponseException(new HttpResponseMessage() { StatusCode = System.Net.HttpStatusCode.InternalServerError, Content = new StringContent(ex.Message) }); } }
public EnvCollector(DBParamter parameter) : base(parameter) { }