예제 #1
0
 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);
     }
 }
예제 #2
0
 protected override void EndReport(string contextName)
 {
     base.EndReport(contextName);
     ZabbixSender.Send(_sendQueue);
     _sendQueue.Clear();
 }