pipelines_list = []
for pipeline in stats['pipelines']:
-
- result += stats['host'] + " events.duration_in_millis[" + pipeline + "] " + str(stats['pipelines'][pipeline]['events']['duration_in_millis']) + "\n"
- result += stats['host'] + " events.in[" + pipeline + "] " + str(stats['pipelines'][pipeline]['events']['in']) + "\n"
- result += stats['host'] + " events.out[" + pipeline + "] " + str(stats['pipelines'][pipeline]['events']['out']) + "\n"
- result += stats['host'] + " events.filtered[" + pipeline + "] " + str(stats['pipelines'][pipeline]['events']['filtered']) + "\n"
- result += stats['host'] + " events.queue_push_duration_in_millis[" + pipeline + "] " + str(stats['pipelines'][pipeline]['events']['queue_push_duration_in_millis']) + "\n"
-
-
- if "capacity" in stats['pipelines'][pipeline]['queue']:
- result += stats['host'] + " queue.capacity.max_queue_size_in_bytes[" + pipeline + "] " + str(stats['pipelines'][pipeline]['queue']['capacity']['max_queue_size_in_bytes']) + "\n"
- result += stats['host'] + " queue.capacity.max_unread_events[" + pipeline + "] " + str(stats['pipelines'][pipeline]['queue']['capacity']['max_unread_events']) + "\n"
- result += stats['host'] + " queue.capacity.page_capacity_in_bytes[" + pipeline + "] " + str(stats['pipelines'][pipeline]['queue']['capacity']['page_capacity_in_bytes']) + "\n"
- result += stats['host'] + " queue.capacity.queue_size_in_bytes[" + pipeline + "] " + str(stats['pipelines'][pipeline]['queue']['capacity']['queue_size_in_bytes']) + "\n"
- result += stats['host'] + " queue.events[" + pipeline + "] " + str(stats['pipelines'][pipeline]['queue']['events']) + "\n"
- result += stats['host'] + " queue.type[" + pipeline + "] " + str(stats['pipelines'][pipeline]['queue']['type']) + "\n"
+ if stats['pipelines'][pipeline]['events'] != None:
- else:
- result += stats['host'] + " queue.type[" + pipeline + "] " + str(stats['pipelines'][pipeline]['queue']['type']) + "\n"
+ result += stats['host'] + " events.duration_in_millis[" + pipeline + "] " + str(stats['pipelines'][pipeline]['events']['duration_in_millis']) + "\n"
+ result += stats['host'] + " events.in[" + pipeline + "] " + str(stats['pipelines'][pipeline]['events']['in']) + "\n"
+ result += stats['host'] + " events.out[" + pipeline + "] " + str(stats['pipelines'][pipeline]['events']['out']) + "\n"
+ result += stats['host'] + " events.filtered[" + pipeline + "] " + str(stats['pipelines'][pipeline]['events']['filtered']) + "\n"
+ result += stats['host'] + " events.queue_push_duration_in_millis[" + pipeline + "] " + str(stats['pipelines'][pipeline]['events']['queue_push_duration_in_millis']) + "\n"
- result += stats['host'] + " reloads.failures[" + pipeline + "] " + str(stats['pipelines'][pipeline]['reloads']['failures']) + "\n"
- result += stats['host'] + " reloads.last_failure_timestamp[" + pipeline + "] " + str(stats['pipelines'][pipeline]['reloads']['last_failure_timestamp']) + "\n"
- result += stats['host'] + " reloads.last_success_timestamp[" + pipeline + "] " + str(stats['pipelines'][pipeline]['reloads']['last_success_timestamp']) + "\n"
- result += stats['host'] + " reloads.successes[" + pipeline + "] " + str(stats['pipelines'][pipeline]['reloads']['successes']) + "\n"
+
+ if "capacity" in stats['pipelines'][pipeline]['queue']:
+
+ result += stats['host'] + " queue.capacity.max_queue_size_in_bytes[" + pipeline + "] " + str(stats['pipelines'][pipeline]['queue']['capacity']['max_queue_size_in_bytes']) + "\n"
+ result += stats['host'] + " queue.capacity.max_unread_events[" + pipeline + "] " + str(stats['pipelines'][pipeline]['queue']['capacity']['max_unread_events']) + "\n"
+ result += stats['host'] + " queue.capacity.page_capacity_in_bytes[" + pipeline + "] " + str(stats['pipelines'][pipeline]['queue']['capacity']['page_capacity_in_bytes']) + "\n"
+ result += stats['host'] + " queue.capacity.queue_size_in_bytes[" + pipeline + "] " + str(stats['pipelines'][pipeline]['queue']['capacity']['queue_size_in_bytes']) + "\n"
+ result += stats['host'] + " queue.events[" + pipeline + "] " + str(stats['pipelines'][pipeline]['queue']['events']) + "\n"
+ result += stats['host'] + " queue.type[" + pipeline + "] " + str(stats['pipelines'][pipeline]['queue']['type']) + "\n"
+
+ else:
+ result += stats['host'] + " queue.type[" + pipeline + "] " + str(stats['pipelines'][pipeline]['queue']['type']) + "\n"
+
+ result += stats['host'] + " reloads.failures[" + pipeline + "] " + str(stats['pipelines'][pipeline]['reloads']['failures']) + "\n"
+ result += stats['host'] + " reloads.last_failure_timestamp[" + pipeline + "] " + str(stats['pipelines'][pipeline]['reloads']['last_failure_timestamp']) + "\n"
+ result += stats['host'] + " reloads.last_success_timestamp[" + pipeline + "] " + str(stats['pipelines'][pipeline]['reloads']['last_success_timestamp']) + "\n"
+ result += stats['host'] + " reloads.successes[" + pipeline + "] " + str(stats['pipelines'][pipeline]['reloads']['successes']) + "\n"
return result
#
for proxy in zabbix_proxy:
-
- command = zabbix_sender + ' -z ' + proxy + ' -i ' + tmp_stat_file.name + ' > /dev/null 2>&1'
+ command = zabbix_sender + ' -z ' + proxy + ' -i ' + tmp_stat_file.name + ' > /dev/null 2>&1'
+
proc = subprocess.Popen([command],shell=True)
proc.wait()
-
+
if proc.returncode == 0:
break
-
+
# Delete temp file with zabbix_sender data
os.remove(tmp_stat_file.name)