{"id":410336,"date":"2024-06-29T21:19:35","date_gmt":"2024-06-29T21:19:35","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=410336"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=410336","title":{"rendered":"<span>\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u0432 Zabbix<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!<\/p>\n<p>\u042f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 \u043a\u0440\u0443\u043f\u043d\u043e\u0439 \u0444\u0435\u0434\u0435\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u043e\u043b\u0435\u0435 2000 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0437\u0430\u0434\u0430\u0447 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u0430\u043d\u0430\u043b \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u043d\u0430 \u044d\u0442\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445, \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u0431\u044b \u043d\u0430\u0441 \u043e\u0431 \u044d\u0442\u043e\u043c. <\/p>\n<p>\u0421\u043e\u0431\u0440\u0430\u0432 \u0432\u0441\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c, \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u043d\u0430 \u0431\u0430\u0437\u0435 Zabbix. \u0414\u043b\u044f \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 iperf3. \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0430 python.<\/p>\n<h2>\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b<\/h2>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0441\u0445\u0435\u043c\u0430 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9a6\/623\/544\/9a6623544a5410d8532a6999f93f1b22.png\" alt=\"\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043a\u0430\u043d\u0430\u043b\u043e\u0432\" title=\"\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043a\u0430\u043d\u0430\u043b\u043e\u0432\" width=\"517\" height=\"238\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9a6\/623\/544\/9a6623544a5410d8532a6999f93f1b22.png\"\/><figcaption>\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043a\u0430\u043d\u0430\u043b\u043e\u0432<\/figcaption><\/figure>\n<p>\u041d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0448\u043b\u044e\u0437\u044b \u043d\u0430 Linux, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u0434\u043d\u044f\u0442 iperf3 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u0444\u0438\u043b\u0438\u0430\u043b\u0435 \u0435\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 Zabbix Proxy, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f iperf3 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0437\u0430\u043c\u0435\u0440\u044f\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430, \u043f\u043e\u0441\u043b\u0435 \u043e\u043d \u0432 Zabbix trap \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043c\u0435\u0440\u0430.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a iperf3 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0435<\/h2>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435, \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0448\u043b\u044e\u0437\u044b \u043d\u0430 Linux. \u041d\u0430 \u043d\u0438\u0445 \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d iperf3 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a iperf3 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0448\u043b\u044e\u0437\u0430. \u0417\u0430\u043f\u0443\u0441\u043a \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439, \u0433\u0434\u0435 &lt;IP_address> \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043c\u0435\u0440 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"bash\">\/usr\/bin\/iperf3 -B &lt;IP_address> -Ds<\/code><\/pre>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 iperf3 \u043d\u0430 Zabbix Proxy \u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b: iperf3, python-pip, python. \u0418\u0437 pip \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c py-zabbix \u0438 protobix.<\/p>\n<pre><code class=\"bash\">apt install iperf3 python-pip python pip install py-zabbix pip install protobix<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 iperf \u0432 \/usr\/lib\/zabbix\/externalscripts\/. \u0412 \u043f\u0430\u043f\u043a\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 iperf3_speed_testing.py \u0438 iperf3_task.py (\u043e\u0434\u0438\u043d \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0440\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u0437 Zabbix, \u0432\u0442\u043e\u0440\u043e\u0439 \u0434\u043b\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0432\u0441\u0435\u0445). \u0418 \u0434\u0430\u0435\u043c \u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0412\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c \u043f\u0430\u043f\u043a\u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f zabbix.<\/p>\n<pre><code>mkdir \/usr\/lib\/zabbix\/externalscripts\/iperf touch \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_speed_testing.py touch \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_task.py chown -R zabbix:zabbix \/usr\/lib\/zabbix\/externalscripts\/iperf chmod +x \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_speed_testing.py chmod +x \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_task.py<\/code><\/pre>\n<h3>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/h3>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_speed_testing.py \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u043c\u0435\u0440\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u041e\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u043d\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435 \u0432 Zabbix.<\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/python #- *- coding: utf-8 - *-  import protobix import argparse import subprocess import sys import json import time  proxy = subprocess.Popen(['hostname'], stdout=subprocess.PIPE) proxy = proxy.communicate()[0]  def showResult(_upload, _download):         print \"\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430: \" + str(round(_upload\/1000000,2)) + \" \u041c\u0431\u0438\u0442\/\u0441\"         print \"\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435: \" + str(round(_download\/1000000,2)) + \" \u041c\u0431\u0438\u0442\/\u0441\"  def sendData(_upload, _download):         host_moria = sys.argv[2]         host_status = {}         host_status['speed_upload'] = _upload         host_status['speed_download'] = _download         zbx_datacontainer = protobix.DataContainer()         zbx_datacontainer.server_active = proxy.split('\\n')[0]         zbx_datacontainer.server_port = 10051         zbx_datacontainer.data_type = \"items\"         zbx_datacontainer.add({host_moria: host_status}) #       print json.dumps({host_moria: host_status}, indent=4)         zbx_datacontainer.send()         showResult(_upload, _download)  start_time = time.time() result = subprocess.Popen(['\/usr\/bin\/iperf3', '-c', sys.argv[1], '-J', '-P', '5'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)  wait = time.time()-start_time while wait &lt; 45 and result.poll() == None:         wait = time.time()-start_time         if wait > 40 and wait &lt; 45 :                 result.kill()                 stdout_value = {\"error\":\"Timeout error\"}                 stdout_json = stdout_value                 stdout_value = str(stdout_value)                 break  else:         stdout_value, stderr_value = result.communicate()         stdout_json = json.loads(stdout_value)  while stdout_value.find('error') != -1 and stdout_json['error'] == 'error - unable to receive results: Resource temporarily unavailable':                 result = subprocess.Popen(['\/usr\/bin\/iperf3', '-c', sys.argv[1], '-J', '-P', '5'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)                 stdout_value, stderr_value = result.communicate()                 stdout_json = json.loads(stdout_value)  if stdout_value.find('error') == -1:         sendData(stdout_json['end']['sum_sent']['bits_per_second'],stdout_json['end']['sum_received']['bits_per_second']) else:         print stdout_json['error'] <\/code><\/pre>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_task.py \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 \u0437\u0430\u043c\u0435\u0440 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0433\u0440\u0443\u043f\u043f\u0430\u0445 \u0445\u043e\u0441\u0442\u043e\u0432 Zabbix. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a Zabbix API. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<ul>\n<li>\n<p>zabbix_user &#8212; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a API<\/p>\n<\/li>\n<li>\n<p>zabbix_password &#8212; \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f API<\/p>\n<\/li>\n<li>\n<p>zabbix_server &#8212; \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 zabbix<\/p>\n<\/li>\n<li>\n<p>group &#8212; \u0433\u0440\u0443\u043f\u043f\u0430 \u0438\u043b\u0438 \u0433\u0440\u0443\u043f\u043f\u044b \u0432 Zabbix, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043c\u0435\u0440 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">#!\/usr\/bin\/python # - *- coding: utf- 8 - *- from pyzabbix.api import ZabbixAPI import protobix import argparse import subprocess import sys import json import time  zabbix_user = &lt;zabbix_api_user> zabbix_password = &lt;zabbix_api_password> group = ('Gateway_branch_1','Gateway_branch_2')  start_time_script = time.time()  proxy = subprocess.Popen(['hostname'], stdout=subprocess.PIPE) proxy = proxy.communicate()[0]  def sendData(host, upload, download):         host_moria = host         host_status = {}         host_status['speed_upload'] = upload         host_status['speed_download'] = download         zbx_datacontainer = protobix.DataContainer()         zbx_datacontainer.server_active = proxy.split('\\n')[0]         zbx_datacontainer.server_port = 10051         zbx_datacontainer.data_type = \"items\"         zbx_datacontainer.add({host_moria: host_status}) #       print json.dumps({host_moria: host_status}, indent=4)         zbx_datacontainer.send()  def getZabbixGroupID(groupName):         groups = zapi.hostgroup.get(filter={'name':groupName})         for group in groups:                 return group['groupid']   zapi = ZabbixAPI(url=zabbix_server, user=zabbix_user, password=zabbix_password)  hosts = zapi.host.get(groupids=[getZabbixGroupID(group[0]),getZabbixGroupID(group[1])], selectInterfaces=['ip'])  for host in hosts:  #       print (host['host'])         start_time = time.time()         result = subprocess.Popen(['\/usr\/bin\/iperf3', '-c', host['interfaces'][0]['ip'], '-J', '-P', '5'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)          wait = time.time()-start_time         while wait &lt; 45 and result.poll() == None:                 wait = time.time()-start_time                 if wait > 40 and wait &lt; 45 :                         result.kill()                         stdout_value = {\"error\":\"Timeout error\"}                         stdout_json = stdout_value                         stdout_value = str(stdout_value)                         break          else:                 stdout_value, stderr_value = result.communicate()                 stdout_json = json.loads(stdout_value)          while stdout_value.find('error') != -1 and stdout_json['error'] == 'error - unable to receive results: Resource temporarily unavailable':                 result = subprocess.Popen(['\/usr\/bin\/iperf3', '-c', host['interfaces'][0]['ip'], '-J', '-P', '5'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)                 stdout_value, stderr_value = result.communicate()                 stdout_json = json.loads(stdout_value)          if stdout_value.find('error') == -1:                 sendData(host['host'], stdout_json['end']['sum_sent']['bits_per_second'], stdout_json['end']['sum_received']['bits_per_second'])  zapi.user.logout()  related_time = time.time() - start_time_script  host_moria = proxy.split('\\n')[0] host_status = {} host_status['iperf_task_time'] = float(round(related_time,2)) zbx_datacontainer = protobix.DataContainer() zbx_datacontainer.server_active = 'zabbix-server' zbx_datacontainer.server_port = 10051 zbx_datacontainer.data_type = \"items\" zbx_datacontainer.add({host_moria: host_status}) zbx_datacontainer.send()<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 crontab<\/p>\n<p>0 2,6,10,14,18,22 * * * \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_task.py<\/p>\n<p>\u041c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043c\u0435\u0440 \u0440\u0430\u0437 \u0432 4 \u0447\u0430\u0441\u0430. \u041d\u0430\u043c \u044d\u0442\u043e\u0433\u043e \u0445\u0432\u0430\u0442\u0430\u0435\u0442.<\/p>\n<p><strong>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e Zabbix \u0441\u0435\u0440\u0432\u0435\u0440, \u0442\u043e \u043d\u0430 \u043d\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435.<\/strong><\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432 Zabbix<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430. \u042f \u043d\u0430\u0437\u0432\u0430\u043b \u0448\u0430\u0431\u043b\u043e\u043d Internet Speed Testing<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fe7\/ba2\/0a8\/fe7ba20a8bd9e16595c5d0afdc8e5e1d.png\" alt=\"\u0428\u0430\u0431\u043b\u043e\u043d Inernet speed testing\" title=\"\u0428\u0430\u0431\u043b\u043e\u043d Inernet speed testing\" width=\"624\" height=\"213\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fe7\/ba2\/0a8\/fe7ba20a8bd9e16595c5d0afdc8e5e1d.png\"\/><figcaption>\u0428\u0430\u0431\u043b\u043e\u043d Inernet speed testing<\/figcaption><\/figure>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li>\n<p>Speed Upload<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0fc\/adf\/374\/0fcadf37497aa613e856e861539add2e.png\" width=\"973\" height=\"649\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0fc\/adf\/374\/0fcadf37497aa613e856e861539add2e.png\"\/><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>Speed Download<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ecb\/07e\/d4e\/ecb07ed4ecd22fbbe62a760e92eb2ecc.png\" width=\"888\" height=\"657\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ecb\/07e\/d4e\/ecb07ed4ecd22fbbe62a760e92eb2ecc.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b:<\/p>\n<ul>\n<li>\n<p>\u041d\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u0435\u0435 48 \u0447\u0430\u0441\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u041d\u0438\u0437\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u041d\u0438\u0437\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4bd\/c2c\/9c5\/4bdc2c9c5d5c16c5c1f9c2cc5a060b88.png\" alt=\"\u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b\" title=\"\u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b\" width=\"624\" height=\"151\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4bd\/c2c\/9c5\/4bdc2c9c5d5c16c5c1f9c2cc5a060b88.png\"\/><figcaption>\u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b<\/figcaption><\/figure>\n<p>\u041c\u0430\u043a\u0440\u043e\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>{$LOW_SPEED} &#8212; \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0438\u0433\u0433\u0435\u0440<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6e7\/7c9\/07a\/6e77c907a647254ce33039348be295a6.png\" width=\"1069\" height=\"224\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6e7\/7c9\/07a\/6e77c907a647254ce33039348be295a6.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0421\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0440\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e (\u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 -> \u0421\u043a\u0440\u0438\u043f\u0442\u044b -> \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442)<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8cb\/ed7\/365\/8cbed7365e63ed3b0e7cfe736fcaac50.png\" alt=\"\u0414\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u0440\u0430\" title=\"\u0414\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u0440\u0430\" width=\"624\" height=\"373\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8cb\/ed7\/365\/8cbed7365e63ed3b0e7cfe736fcaac50.png\"\/><figcaption>\u0414\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u0440\u0430<\/figcaption><\/figure>\n<p>\u0412 \u043f\u043e\u043b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0443 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0432\u0438\u0434\u0435 \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_speed_testing.py {HOST.CONN} &#8216;{HOST.HOST}&#8217;<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c \u0445\u043e\u0441\u0442\u0430\u043c \u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c. \u0422\u0430\u043a\u0436\u0435 \u0432 \u0445\u043e\u0441\u0442\u0430\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u043d\u0438\u0437\u043a\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430.<\/p>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442 \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/a6b\/250\/c06\/a6b250c06b8a5bb3155c43fd41abb51a.jpg\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043c\u0435\u0440\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043c\u0435\u0440\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438\" width=\"554\" height=\"151\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a6b\/250\/c06\/a6b250c06b8a5bb3155c43fd41abb51a.jpg\" data-blurred=\"true\"\/><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043c\u0435\u0440\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438<\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c. \u0416\u0434\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/840\/a5c\/13a\/840a5c13a6fc8dc5e658f666d9880ded.png\" alt=\"\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430\" title=\"\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430\" width=\"624\" height=\"135\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/840\/a5c\/13a\/840a5c13a6fc8dc5e658f666d9880ded.png\"\/><figcaption>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430<\/figcaption><\/figure>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0451. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435! ?<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/590775\/\"> https:\/\/habr.com\/ru\/articles\/590775\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!<\/p>\n<p>\u042f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 \u043a\u0440\u0443\u043f\u043d\u043e\u0439 \u0444\u0435\u0434\u0435\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u043e\u043b\u0435\u0435 2000 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0437\u0430\u0434\u0430\u0447 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u0430\u043d\u0430\u043b \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u043d\u0430 \u044d\u0442\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445, \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u0431\u044b \u043d\u0430\u0441 \u043e\u0431 \u044d\u0442\u043e\u043c. <\/p>\n<p>\u0421\u043e\u0431\u0440\u0430\u0432 \u0432\u0441\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c, \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u043d\u0430 \u0431\u0430\u0437\u0435 Zabbix. \u0414\u043b\u044f \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 iperf3. \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0430 python.<\/p>\n<h2>\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b<\/h2>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0441\u0445\u0435\u043c\u0430 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"\"><figcaption>\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043a\u0430\u043d\u0430\u043b\u043e\u0432<\/figcaption><\/figure>\n<p>\u041d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0448\u043b\u044e\u0437\u044b \u043d\u0430 Linux, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u0434\u043d\u044f\u0442 iperf3 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u0444\u0438\u043b\u0438\u0430\u043b\u0435 \u0435\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 Zabbix Proxy, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f iperf3 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0437\u0430\u043c\u0435\u0440\u044f\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430, \u043f\u043e\u0441\u043b\u0435 \u043e\u043d \u0432 Zabbix trap \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043c\u0435\u0440\u0430.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a iperf3 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0435<\/h2>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435, \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0448\u043b\u044e\u0437\u044b \u043d\u0430 Linux. \u041d\u0430 \u043d\u0438\u0445 \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d iperf3 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a iperf3 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0448\u043b\u044e\u0437\u0430. \u0417\u0430\u043f\u0443\u0441\u043a \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439, \u0433\u0434\u0435 &lt;IP_address> \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043c\u0435\u0440 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"bash\">\/usr\/bin\/iperf3 -B &lt;IP_address> -Ds<\/code><\/pre>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 iperf3 \u043d\u0430 Zabbix Proxy \u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b: iperf3, python-pip, python. \u0418\u0437 pip \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c py-zabbix \u0438 protobix.<\/p>\n<pre><code class=\"bash\">apt install iperf3 python-pip python pip install py-zabbix pip install protobix<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 iperf \u0432 \/usr\/lib\/zabbix\/externalscripts\/. \u0412 \u043f\u0430\u043f\u043a\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 iperf3_speed_testing.py \u0438 iperf3_task.py (\u043e\u0434\u0438\u043d \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0440\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u0437 Zabbix, \u0432\u0442\u043e\u0440\u043e\u0439 \u0434\u043b\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0432\u0441\u0435\u0445). \u0418 \u0434\u0430\u0435\u043c \u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0412\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c \u043f\u0430\u043f\u043a\u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f zabbix.<\/p>\n<pre><code>mkdir \/usr\/lib\/zabbix\/externalscripts\/iperf touch \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_speed_testing.py touch \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_task.py chown -R zabbix:zabbix \/usr\/lib\/zabbix\/externalscripts\/iperf chmod +x \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_speed_testing.py chmod +x \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_task.py<\/code><\/pre>\n<h3>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/h3>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_speed_testing.py \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u043c\u0435\u0440\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u041e\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u043d\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435 \u0432 Zabbix.<\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/python #- *- coding: utf-8 - *-  import protobix import argparse import subprocess import sys import json import time  proxy = subprocess.Popen(['hostname'], stdout=subprocess.PIPE) proxy = proxy.communicate()[0]  def showResult(_upload, _download):         print \"\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430: \" + str(round(_upload\/1000000,2)) + \" \u041c\u0431\u0438\u0442\/\u0441\"         print \"\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435: \" + str(round(_download\/1000000,2)) + \" \u041c\u0431\u0438\u0442\/\u0441\"  def sendData(_upload, _download):         host_moria = sys.argv[2]         host_status = {}         host_status['speed_upload'] = _upload         host_status['speed_download'] = _download         zbx_datacontainer = protobix.DataContainer()         zbx_datacontainer.server_active = proxy.split('\\n')[0]         zbx_datacontainer.server_port = 10051         zbx_datacontainer.data_type = \"items\"         zbx_datacontainer.add({host_moria: host_status}) #       print json.dumps({host_moria: host_status}, indent=4)         zbx_datacontainer.send()         showResult(_upload, _download)  start_time = time.time() result = subprocess.Popen(['\/usr\/bin\/iperf3', '-c', sys.argv[1], '-J', '-P', '5'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)  wait = time.time()-start_time while wait &lt; 45 and result.poll() == None:         wait = time.time()-start_time         if wait > 40 and wait &lt; 45 :                 result.kill()                 stdout_value = {\"error\":\"Timeout error\"}                 stdout_json = stdout_value                 stdout_value = str(stdout_value)                 break  else:         stdout_value, stderr_value = result.communicate()         stdout_json = json.loads(stdout_value)  while stdout_value.find('error') != -1 and stdout_json['error'] == 'error - unable to receive results: Resource temporarily unavailable':                 result = subprocess.Popen(['\/usr\/bin\/iperf3', '-c', sys.argv[1], '-J', '-P', '5'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)                 stdout_value, stderr_value = result.communicate()                 stdout_json = json.loads(stdout_value)  if stdout_value.find('error') == -1:         sendData(stdout_json['end']['sum_sent']['bits_per_second'],stdout_json['end']['sum_received']['bits_per_second']) else:         print stdout_json['error'] <\/code><\/pre>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_task.py \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 \u0437\u0430\u043c\u0435\u0440 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0433\u0440\u0443\u043f\u043f\u0430\u0445 \u0445\u043e\u0441\u0442\u043e\u0432 Zabbix. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a Zabbix API. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<ul>\n<li>\n<p>zabbix_user &#8212; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a API<\/p>\n<\/li>\n<li>\n<p>zabbix_password &#8212; \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f API<\/p>\n<\/li>\n<li>\n<p>zabbix_server &#8212; \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 zabbix<\/p>\n<\/li>\n<li>\n<p>group &#8212; \u0433\u0440\u0443\u043f\u043f\u0430 \u0438\u043b\u0438 \u0433\u0440\u0443\u043f\u043f\u044b \u0432 Zabbix, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043c\u0435\u0440 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">#!\/usr\/bin\/python # - *- coding: utf- 8 - *- from pyzabbix.api import ZabbixAPI import protobix import argparse import subprocess import sys import json import time  zabbix_user = &lt;zabbix_api_user> zabbix_password = &lt;zabbix_api_password> group = ('Gateway_branch_1','Gateway_branch_2')  start_time_script = time.time()  proxy = subprocess.Popen(['hostname'], stdout=subprocess.PIPE) proxy = proxy.communicate()[0]  def sendData(host, upload, download):         host_moria = host         host_status = {}         host_status['speed_upload'] = upload         host_status['speed_download'] = download         zbx_datacontainer = protobix.DataContainer()         zbx_datacontainer.server_active = proxy.split('\\n')[0]         zbx_datacontainer.server_port = 10051         zbx_datacontainer.data_type = \"items\"         zbx_datacontainer.add({host_moria: host_status}) #       print json.dumps({host_moria: host_status}, indent=4)         zbx_datacontainer.send()  def getZabbixGroupID(groupName):         groups = zapi.hostgroup.get(filter={'name':groupName})         for group in groups:                 return group['groupid']   zapi = ZabbixAPI(url=zabbix_server, user=zabbix_user, password=zabbix_password)  hosts = zapi.host.get(groupids=[getZabbixGroupID(group[0]),getZabbixGroupID(group[1])], selectInterfaces=['ip'])  for host in hosts:  #       print (host['host'])         start_time = time.time()         result = subprocess.Popen(['\/usr\/bin\/iperf3', '-c', host['interfaces'][0]['ip'], '-J', '-P', '5'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)          wait = time.time()-start_time         while wait &lt; 45 and result.poll() == None:                 wait = time.time()-start_time                 if wait > 40 and wait &lt; 45 :                         result.kill()                         stdout_value = {\"error\":\"Timeout error\"}                         stdout_json = stdout_value                         stdout_value = str(stdout_value)                         break          else:                 stdout_value, stderr_value = result.communicate()                 stdout_json = json.loads(stdout_value)          while stdout_value.find('error') != -1 and stdout_json['error'] == 'error - unable to receive results: Resource temporarily unavailable':                 result = subprocess.Popen(['\/usr\/bin\/iperf3', '-c', host['interfaces'][0]['ip'], '-J', '-P', '5'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)                 stdout_value, stderr_value = result.communicate()                 stdout_json = json.loads(stdout_value)          if stdout_value.find('error') == -1:                 sendData(host['host'], stdout_json['end']['sum_sent']['bits_per_second'], stdout_json['end']['sum_received']['bits_per_second'])  zapi.user.logout()  related_time = time.time() - start_time_script  host_moria = proxy.split('\\n')[0] host_status = {} host_status['iperf_task_time'] = float(round(related_time,2)) zbx_datacontainer = protobix.DataContainer() zbx_datacontainer.server_active = 'zabbix-server' zbx_datacontainer.server_port = 10051 zbx_datacontainer.data_type = \"items\" zbx_datacontainer.add({host_moria: host_status}) zbx_datacontainer.send()<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 crontab<\/p>\n<p>0 2,6,10,14,18,22 * * * \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_task.py<\/p>\n<p>\u041c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043c\u0435\u0440 \u0440\u0430\u0437 \u0432 4 \u0447\u0430\u0441\u0430. \u041d\u0430\u043c \u044d\u0442\u043e\u0433\u043e \u0445\u0432\u0430\u0442\u0430\u0435\u0442.<\/p>\n<p><strong>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e Zabbix \u0441\u0435\u0440\u0432\u0435\u0440, \u0442\u043e \u043d\u0430 \u043d\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435.<\/strong><\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432 Zabbix<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430. \u042f \u043d\u0430\u0437\u0432\u0430\u043b \u0448\u0430\u0431\u043b\u043e\u043d Internet Speed Testing<\/p>\n<figure class=\"full-width\"><figcaption>\u0428\u0430\u0431\u043b\u043e\u043d Inernet speed testing<\/figcaption><\/figure>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li>\n<p>Speed Upload<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>Speed Download<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b:<\/p>\n<ul>\n<li>\n<p>\u041d\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u0435\u0435 48 \u0447\u0430\u0441\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u041d\u0438\u0437\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u041d\u0438\u0437\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption>\u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b<\/figcaption><\/figure>\n<p>\u041c\u0430\u043a\u0440\u043e\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>{$LOW_SPEED} &#8212; \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0438\u0433\u0433\u0435\u0440<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0421\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0440\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e (\u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 -> \u0421\u043a\u0440\u0438\u043f\u0442\u044b -> \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442)<\/p>\n<figure class=\"full-width\"><figcaption>\u0414\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u0440\u0430<\/figcaption><\/figure>\n<p>\u0412 \u043f\u043e\u043b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0443 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0432\u0438\u0434\u0435 \/usr\/lib\/zabbix\/externalscripts\/iperf\/iperf3_speed_testing.py {HOST.CONN} &#8216;{HOST.HOST}&#8217;<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c \u0445\u043e\u0441\u0442\u0430\u043c \u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c. \u0422\u0430\u043a\u0436\u0435 \u0432 \u0445\u043e\u0441\u0442\u0430\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u043d\u0438\u0437\u043a\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430.<\/p>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442 \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442:<\/p>\n<figure class=\"full-width\"><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043c\u0435\u0440\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438<\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c. \u0416\u0434\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430:<\/p>\n<figure class=\"full-width\"><figcaption>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430<\/figcaption><\/figure>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0451. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435! ?<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/590775\/\"> https:\/\/habr.com\/ru\/articles\/590775\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-410336","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/410336","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=410336"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/410336\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=410336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=410336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=410336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}