{"id":335,"date":"2024-02-07T12:55:20","date_gmt":"2024-02-07T09:55:20","guid":{"rendered":"https:\/\/imaxis.ru\/?p=335"},"modified":"2025-02-19T14:46:04","modified_gmt":"2025-02-19T11:46:04","slug":"%d1%83%d0%bc%d0%bd%d1%8b%d0%b9-%d0%b4%d0%be%d0%bc-%d1%8f%d0%bd%d0%b4%d0%b5%d0%ba%d1%81-%d0%b2-zabbix","status":"publish","type":"post","link":"https:\/\/imaxis.ru\/?p=335","title":{"rendered":"\u0423\u043c\u043d\u044b\u0439 \u0434\u043e\u043c \u042f\u043d\u0434\u0435\u043a\u0441 \u0432 Zabbix"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"335\" class=\"elementor elementor-335\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-0645403 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"0645403\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-c80b73b\" data-id=\"c80b73b\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-7c850d3 elementor-widget elementor-widget-text-editor\" data-id=\"7c850d3\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>\u041d\u0435 \u0437\u043d\u0430\u044e \u043a\u043e\u043c\u0443 \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f, \u043d\u043e\u00a0 \u0443 \u0432\u0441\u0435\u0445 \u0441\u0432\u043e\u0438 \u0437\u0430\u0442\u0435\u0438.<\/p><p>\u0423 \u0443\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0430 \u042f\u043d\u0434\u0435\u043a\u0441 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 API, \u0438\u043c\u0438 \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 \u043a \u042f\u043d\u0434\u0435\u043a\u0441 \u0421\u0442\u0430\u043d\u0446\u0438\u0438.<\/p><p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0447\u0442\u043e \u0441\u0430\u043c \u0434\u0430\u0442\u0447\u0438\u043a \u0443\u0436\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a &#171;\u0410\u043b\u0438\u0441\u0435&#187;, \u0434\u0430\u043b\u0435\u0435 \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u0430\u00a0https:\/\/oauth.yandex.ru\/client\/new\/<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-89b366c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"89b366c\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-853b9e5\" data-id=\"853b9e5\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-e76045f elementor-widget elementor-widget-image\" data-id=\"e76045f\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" width=\"640\" height=\"678\" src=\"https:\/\/imaxis.ru\/wp-content\/uploads\/2024\/02\/auth-yandex.jpg\" class=\"attachment-large size-large wp-image-336\" alt=\"auth yandex\" srcset=\"https:\/\/imaxis.ru\/wp-content\/uploads\/2024\/02\/auth-yandex.jpg 819w, https:\/\/imaxis.ru\/wp-content\/uploads\/2024\/02\/auth-yandex-283x300.jpg 283w, https:\/\/imaxis.ru\/wp-content\/uploads\/2024\/02\/auth-yandex-768x813.jpg 768w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" loading=\"lazy\" decoding=\"async\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-f8ff1fc elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"f8ff1fc\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1f19e9e\" data-id=\"1f19e9e\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-714cfb2 elementor-widget elementor-widget-text-editor\" data-id=\"714cfb2\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>\u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c:<\/p><p>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u044b\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u0432\u0430\u043c;<br \/>\u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0412\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441, \u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 URL \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e;<\/p><p>\u0412 \u0434\u043e\u0441\u0442\u0443\u043f\u0430\u0445 \u0434\u043e\u0431\u0430\u0432\u0438\u043c iot:view \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0432\u0441\u0435\u0445 \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u0435\u0441\u043b\u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u043e API \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c, \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c iot:control.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-cd03b41 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"cd03b41\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-06e19a2\" data-id=\"06e19a2\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-167bbd1 elementor-widget elementor-widget-image\" data-id=\"167bbd1\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" width=\"640\" height=\"252\" src=\"https:\/\/imaxis.ru\/wp-content\/uploads\/2024\/02\/token-1024x403.jpg\" class=\"attachment-large size-large wp-image-337\" alt=\"token\" srcset=\"https:\/\/imaxis.ru\/wp-content\/uploads\/2024\/02\/token-1024x403.jpg 1024w, https:\/\/imaxis.ru\/wp-content\/uploads\/2024\/02\/token-300x118.jpg 300w, https:\/\/imaxis.ru\/wp-content\/uploads\/2024\/02\/token-768x303.jpg 768w, https:\/\/imaxis.ru\/wp-content\/uploads\/2024\/02\/token-1536x605.jpg 1536w, https:\/\/imaxis.ru\/wp-content\/uploads\/2024\/02\/token.jpg 1612w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" loading=\"lazy\" decoding=\"async\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2f691c4 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2f691c4\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b1d4a6e\" data-id=\"b1d4a6e\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-9db3c75 elementor-widget elementor-widget-text-editor\" data-id=\"9db3c75\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 ClientID<\/p><p>\u041f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0435\u0437 \u043a\u043e\u0434\u043e\u0432 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0441\u0441\u044b\u043b\u043a\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 ClientID\u00a0<\/p><p>https:\/\/oauth.yandex.ru\/authorize?response_type=token&client_id=\u0412\u0430\u0448ClientID<\/p><p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435, \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u043e\u043a\u0435\u043d, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/p><p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432 \u044f\u043d\u0434\u0435\u043a\u0441\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430 \u043c\u043e\u0436\u0435\u043c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043b\u0438\u043d\u0443\u043a\u0441\u0430 \u0432\u0431\u0438\u0442\u044c<\/p><p>curl -i -X GET &#8216;https:\/\/api.iot.yandex.net\/v1.0\/user\/info&#8217; -H &#8216;Authorization: Bearer \u0412\u0410\u0428 \u0422\u041e\u041a\u0415\u041d&#8217;<\/p><p>\u0412 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u043e\u0440\u0442\u044f\u043d\u043a\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0432\u0441\u0435\u043c \u0432\u0430\u0448\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 \u043a \u0423\u043c\u043d\u043e\u043c\u0443 \u0434\u043e\u043c\u0443 \u042f\u043d\u0434\u0435\u043a\u0441<\/p><p>\u0414\u043b\u044f \u043c\u0435\u043d\u044f \u0431\u044b\u043b \u043d\u0443\u0436\u0435\u043d \u0434\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0438 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0445\u043e\u0436\u0443 \u0435\u0433\u043e id (&#171;id&#187;:&#187;d4991cc2-hhfj-dfgg-b40f-6cc3f11f6196&#8243;) \u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u044e \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p><p>\u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0432 \u0432 \u0441\u0441\u044b\u043b\u043a\u0443 id\u00a0<\/p><p>curl -i -X GET &#8216;https:\/\/api.iot.yandex.net\/v1.0\/devices\/d4991cc2-hhfj-dfgg-b40f-6cc3f11f6196&#8217; -H &#8216;Authorization: Bearer \u0412\u0410\u0428 \u0422\u041e\u041a\u0415\u041d&#8217;<\/p><p>\u041f\u043e\u043b\u0443\u0447\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0434\u0430\u0442\u0447\u0438\u043a\u0443<\/p><p>\u0418\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0437\u0430\u0431\u0431\u0438\u043a\u0441\u0430 \u0441\u043f\u0430\u0440\u0441\u0438\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u044d\u0442\u043e\u0433\u043e \u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c python \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u043f\u0440\u044f\u043c \u043d\u0430 zabbix-server<\/p><p>\u041b\u043e\u0433\u0438\u043d\u0438\u043c\u0441\u044f \u043f\u043e ssh, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442<\/p><p>mkdir \/tmp\/script<\/p><p>nano \/tmp\/script\/sensor.py<\/p><p>\u00a0<\/p><p>\u0412\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e token \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c<\/p><pre>#!\/usr\/bin\/python3<br \/><br \/>import requests<br \/><br \/>url = \"https:\/\/api.iot.yandex.net\/v1.0\/devices\/d4991cc2-hhfj-dfgg-b40f-6cc3f11f6196\" #\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c ID \u0441\u0432\u043e\u0435\u0433\u043e \u0434\u0430\u0442\u0447\u0438\u043a\u0430<br \/>token = '\u0412\u0430\u0448 \u0442\u043e\u043a\u0435\u043d'<br \/><br \/>headers= {\"Authorization\" : f\"Bearer {token}\", \"Content-Type\": \"application\/json\"}<br \/><br \/>resp = requests.get(url, headers=headers)<br \/>resps = dict(resp.json())<br \/>for key, values in resps.items():<br \/>  \u00a0 if key == 'properties':<br \/>  \u00a0 \u00a0 \u00a0 for z in values:<br \/>  \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 z = dict(z)<br \/>  \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 for keyz, valuez in z.items():<br \/>  \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if keyz == 'state':<br \/>  \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 nameelement = valuez.get('instance')<br \/>  \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 print(valuez.get('value'))<br \/>  \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 text_file = open(nameelement, \"w+\")<br \/>  \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 text_file.write(str(valuez.get('value')))<br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 text_file.close()<br \/><br \/><\/pre><p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u0442\u043e\u0439 \u0436\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0444\u0430\u0439\u043b\u044b \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u043c \u044f\u043d\u0434\u0435\u043a\u0441\u0430\u00a0 &#8212; \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u0430\u0440\u044f\u0434\u0430 \u0431\u0430\u0442\u0430\u0440\u0435\u0438, \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c, \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430. \u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b\u044b \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u044b (\u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430), \u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f<\/p><p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043a\u0430\u0436\u0434\u044b\u0435 10 \u043c\u0438\u043d\u0443\u0442<\/p><p>crontab -e<\/p><p>*\/10 * * * * \/tmp\/script\/sensor.py<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-0c55c57 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"0c55c57\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d6ad540\" data-id=\"d6ad540\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-45fd07e elementor-widget elementor-widget-text-editor\" data-id=\"45fd07e\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>\u0412 \u0437\u0430\u0431\u0431\u0438\u043a\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u0431\u0431\u0438\u043a\u0441 \u0430\u0433\u0435\u043d\u0442\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0437\u0430\u0431\u0431\u0438\u043a\u0441-\u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0444\u0430\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/p><p>nano \/etc\/zabbix\/zabbix_agentd.conf<\/p><p>\u0432 \u043b\u044e\u0431\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u043c<\/p><p>UserParameter = temp, cat \/tmp\/script\/temperature<\/p><p>UserParameter = pressure, cat \/tmp\/script\/pressure<\/p><p>UserParameter = humidity, cat \/tmp\/script\/humidity<\/p><p>UserParameter = battery, cat \/script\/battery_level<\/p><p>\u0413\u0434\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u0430\u0448<\/p><p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438 \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0443\u0435\u043c \u0430\u0433\u0435\u043d\u0442\u0430<\/p><p>service zabbix-agent restart<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-f4d3a63 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"f4d3a63\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d81ea8d\" data-id=\"d81ea8d\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-c576380 elementor-widget elementor-widget-text-editor\" data-id=\"c576380\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>\u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 zabbix, \u043a\u043b\u044e\u0447\u0438 \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 temp, pressure, humidity, battery, \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0438<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-05eb825 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"05eb825\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f3d6803\" data-id=\"f3d6803\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2f0a283 elementor-widget elementor-widget-image\" data-id=\"2f0a283\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" width=\"640\" height=\"476\" src=\"https:\/\/imaxis.ru\/wp-content\/uploads\/2024\/02\/zabsensor-1024x762.jpg\" class=\"attachment-large size-large wp-image-346\" alt=\"zabsensor\" srcset=\"https:\/\/imaxis.ru\/wp-content\/uploads\/2024\/02\/zabsensor-1024x762.jpg 1024w, https:\/\/imaxis.ru\/wp-content\/uploads\/2024\/02\/zabsensor-300x223.jpg 300w, https:\/\/imaxis.ru\/wp-content\/uploads\/2024\/02\/zabsensor-768x571.jpg 768w, https:\/\/imaxis.ru\/wp-content\/uploads\/2024\/02\/zabsensor.jpg 1089w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" loading=\"lazy\" decoding=\"async\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\u041d\u0435 \u0437\u043d\u0430\u044e \u043a\u043e\u043c\u0443 \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f, \u043d\u043e\u00a0<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-335","post","type-post","status-publish","format-standard","hentry","category-linux"],"aioseo_notices":[],"views":4166,"_links":{"self":[{"href":"https:\/\/imaxis.ru\/index.php?rest_route=\/wp\/v2\/posts\/335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/imaxis.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/imaxis.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/imaxis.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/imaxis.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=335"}],"version-history":[{"count":24,"href":"https:\/\/imaxis.ru\/index.php?rest_route=\/wp\/v2\/posts\/335\/revisions"}],"predecessor-version":[{"id":575,"href":"https:\/\/imaxis.ru\/index.php?rest_route=\/wp\/v2\/posts\/335\/revisions\/575"}],"wp:attachment":[{"href":"https:\/\/imaxis.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/imaxis.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/imaxis.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}