public ZabbixReporter(string zabbixServer, int port = 10051, string user = null, string password = null, string template = null) { template = template ?? GetGlobalContextName(); Hostname = ZabbixConfig.GetLocalHostname(); ZabbixSender = new ZabbixSender(zabbixServer, port); try { ZabbixConfig = new ZabbixConfig(zabbixServer, user, password); ZabbixConfig.TryCreateTemplate(template); } catch (Exception ex) { MetricsErrorHandler.Handle(ex); } }
protected override void EndReport(string contextName) { base.EndReport(contextName); ZabbixSender.Send(_sendQueue); _sendQueue.Clear(); }