{"id":1187,"date":"2021-02-26T13:01:30","date_gmt":"2021-02-26T10:01:30","guid":{"rendered":"https:\/\/blog.airmeno.ru\/?p=1187"},"modified":"2021-02-26T13:04:54","modified_gmt":"2021-02-26T10:04:54","slug":"servis-upravleniya-besperebojnym-pitaniem-v-seti-nut","status":"publish","type":"post","link":"https:\/\/blog.airmeno.ru\/?p=1187","title":{"rendered":"\u0421\u0435\u0440\u0432\u0438\u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0435\u0441\u043f\u0435\u0440\u0435\u0431\u043e\u0439\u043d\u044b\u043c \u043f\u0438\u0442\u0430\u043d\u0438\u0435\u043c \u0432 \u0441\u0435\u0442\u0438 (NUT)"},"content":{"rendered":"\n<p>\u041a\u0430\u043a \u0431\u044b \u043c\u044b \u043d\u0435 \u0443\u0445\u043e\u0434\u0438\u043b\u0438 \u043e\u0442 \u043f\u043e\u043d\u044f\u0442\u0438\u044f \u0436\u0435\u043b\u0435\u0437\u0430 \u0432 \u043e\u0431\u043b\u0430\u043a\u0430, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0435 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u0442\u043e \u0441\u0440\u0430\u0437\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043a\u0430\u043a \u0431\u043e\u0440\u043e\u0442\u044c\u0441\u044f \u0441 \u043f\u0435\u0440\u0435\u043f\u0430\u0434\u0430\u043c\u0438 \u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f \u0438 \u043a\u0430\u043a \u0431\u044b\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u0438\u0442\u0430\u043d\u0438\u0435 \u0432 \u0441\u0435\u0442\u0438?<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0431\u044b\u0447\u043d\u043e &#8212; \u044d\u0442\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u044f\u0433\u043a\u0438\u043c \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c \u0431\u0435\u0441\u043f\u0435\u0440\u0435\u0431\u043e\u0439\u043d\u043e\u0433\u043e \u043f\u0438\u0442\u0430\u043d\u0438\u044f (\u0418\u0411\u041f) \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043d\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u043d\u0438 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u043c NUT \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438. <\/p>\n\n\n\n<p>NUT &#8212; NetworkUPSTools \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0418\u0411\u041f. \u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u0421\u0435\u0440\u0432\u0435\u0440 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0418\u0411\u041f \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432.<\/p>\n\n\n\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432\u044b\u0431\u0440\u0430\u043d Linux Debian 10, \u0442\u0443\u0442 \u043d\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u044b\u0445 \u043e\u0442\u043b\u0438\u0447\u0438\u0439 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435. \u041a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c Linux \u0438 Windows \u043c\u0430\u0448\u0438\u043d\u044b.<\/p>\n\n\n\n<h4>\u0421\u0435\u0440\u0432\u0435\u0440 NUT<\/h4>\n\n\n\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c NUT \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install nut<\/code><\/pre>\n\n\n\n<p>\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0418\u0411\u041f (\u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430) \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0443\u0442 &#8212; \/usr\/share\/nut\/driver.list \u0438\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 &#8212; <a href=\"https:\/\/networkupstools.org\/stable-hcl.html\">https:\/\/networkupstools.org\/stable-hcl.html<\/a><\/p>\n\n\n\n<p>\u041a\u0430\u043a\u043e\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u0438 \u043d\u0430 \u043a\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u0442\u0443 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@debian:~# lsusb\r\nBus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub\r\nBus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub\r\nBus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub\r\nBus 002 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply\r\nBus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub\r\nBus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u0440\u043e \u043d\u0430\u0448 \u0418\u0411\u041f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lsusb -vd 051d:0002<\/code><\/pre>\n\n\n\n<p><strong>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 NUT<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/etc\/nut\/nut.conf\r\n\r\nMODE=netserver<\/code><\/pre>\n\n\n\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0434\u0440\u0430\u0439\u0432\u0435\u0440, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 &#8212; usbhid-ups \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/etc\/nut\/ups.conf\r\n\r\n&#91;apc]\r\ndriver = usbhid-ups\r\nport = auto\r\nvendorid = 051d\r\nproductid = 0002\r\ndesc = \"apc smart-ups 1000\"<\/code><\/pre>\n\n\n\n<p><strong>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 NUT \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0430\u0448\u0438\u043c \u0418\u0411\u041f<\/strong><\/p>\n\n\n\n<p>\u0427\u0442\u043e\u0431\u044b NUT \u043c\u043e\u0433 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0418\u0411\u041f \u0447\u0435\u0440\u0435\u0437 USB, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 udev.<br>udev &#8212; \u044d\u0442\u043e \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u0432 \u043f\u0441\u0435\u0432\u0434\u043e-\u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \/dev \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n\n\n\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u043e\u043c \u0434\u043b\u044f udev:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/udev\/rules.d\/90-nut-ups.rules\r\n\r\n# Smart-UPS 1000 \r\nACTION==\"add\", SUBSYSTEM==\"usb\", ATTR{idVendor}==\"051d\", ATTR{idProduct}==\"0002\", MODE=\"0660\", GROUP=\"nut\"<\/code><\/pre>\n\n\n\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441 udev:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart udev.service<\/code><\/pre>\n\n\n\n<p>\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@debian:~# upsdrvctl start\r\nNetwork UPS Tools - UPS driver controller 2.7.4\r\nNetwork UPS Tools - Generic HID driver 0.41 (2.7.4)\r\nUSB communication driver 0.33\r\nUsing subdriver: APC HID 0.96<\/code><\/pre>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b\u0432\u043e\u0434 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u044d\u0442\u043e\u0442, \u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n\n\n\n<p><strong>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0438 \u043f\u043e\u0440\u0442\u043e\u0432 \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043a NUT<\/strong><\/p>\n\n\n\n<p>\u0412 \/etc\/nut\/upsd.conf \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>LISTEN 127.0.0.1 3493\r\nLISTEN 192.168.1.108 3493<\/code><\/pre>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u043f\u0430\u0440\u043e\u043b\u0438 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 NUT:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/etc\/nut\/upsd.users:\r\n\r\n&#91;upsadm]\r\n    password = USER_PASS\r\n    actions = SET\r\n    instcmds = ALL<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e upsadm \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c NUT \u0447\u0435\u0440\u0435\u0437 \u0443\u0442\u0438\u043b\u0438\u0442\u0443 upscmd, \u043c\u0435\u043d\u044f\u0442\u044c \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0418\u0411\u041f (\u0441\u0442\u0440\u043e\u043a\u0430 actions = SET \u0438 instcmds = ALL). \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0442\u043e \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043e\u043f\u0446\u0438\u0438 instcmds, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;upsadm]\r\n...\r\n    instcmds  = test.battery.start\r\n    instcmds  = test.battery.stop\r\n...<\/code><\/pre>\n\n\n\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0435\u0440\u0432\u0435\u0440 NUT \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0441\u0442\u0430\u0442\u0443\u0441:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl start nut-server.service\nsystemctl status nut-server.service<\/code><\/pre>\n\n\n\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0441\u043b\u0443\u0448\u0430\u0435\u0442 \u043b\u0438 NUT \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0440\u0442\u044b:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@debian:~# ss -ltun | grep 3493\r\ntcp     LISTEN   0        16             127.0.0.1:3493          0.0.0.0:*\r\ntcp     LISTEN   0        16         192.168.1.108:3493          0.0.0.0:*<\/code><\/pre>\n\n\n\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u043d\u0430\u0448 \u0433\u043e\u0442\u043e\u0432. <\/p>\n\n\n\n<p>\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0418\u0411\u041f, \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043e \u0441\u0432\u043e\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>upsc apc@localhost<\/code><\/pre>\n\n\n\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 NUT<\/h4>\n\n\n\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a NUT. \u0412 \/etc\/nut\/upsd.conf \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0435\u043a\u0446\u0438\u0438 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/etc\/nut\/upsd.users:\r\n\r\n&#91;upsadm]\r\n    password = ups_passwd\r\n    actions = SET\r\n    instcmds = ALL\r\n\t\r\n&#91;srv_mon]\r\n    password = srv_passwd\r\n    upsmon master\r\n\t\r\n&#91;linux_mon]\r\n    password = linux_passwd\r\n    upsmon slave\r\n\t\r\n&#91;win_mon]\r\n    password = win_passwd\r\n    upsmon slave<\/code><\/pre>\n\n\n\n<ul><li>local_mon &#8212; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e (\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e) \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/li><li>linux_mon &#8212; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c linux \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/li><li>win_mon &#8212; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c windows \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/li><\/ul>\n\n\n\n<p>\/etc\/nut\/upsmon.conf \u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u0435\u0433\u043e \u043a \u0432\u0438\u0434\u0443:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MONITOR apc@localhost 1 srv_mon srv_passwd master\r\nSHUTDOWNCMD \"\/sbin\/shutdown -h +0\"\r<\/code><\/pre>\n\n\n\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f MONITOR:<\/p>\n\n\n\n<ul><li>apc@localhost &#8212; \u0438\u043c\u044f \u0438 \u0430\u0434\u0440\u0435\u0441 \u0418\u0411\u041f (\u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 \/etc\/nut\/ups.conf)<\/li><li>1 &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0418\u0411\u041f<\/li><li>srv_mon srv_passwd &#8212; \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c<\/li><li>master &#8212; \u043e\u043f\u0446\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 slave \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432<\/li><\/ul>\n\n\n\n<p><strong>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 NUT \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Linux<\/strong><\/p>\n\n\n\n<p>\u0414\u043b\u044f \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c Linux CentOS 7, \u043f\u043e \u0441\u0443\u0442\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0434\u043b\u044f Debian \u0441\u0438\u0441\u0442\u0435\u043c \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install nut-client<\/code><\/pre>\n\n\n\n<p>\/etc\/ups\/upsmon.conf \u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043a \u0432\u0438\u0434\u0443:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MONITOR apc@192.168.1.108 1 linux_mon linux_passwd slave\r\nSHUTDOWNCMD \"\/sbin\/shutdown -h +0\"\r<\/code><\/pre>\n\n\n\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u043c \u0430\u0432\u0442\u043e\u0441\u0442\u0430\u0440\u0442 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart nut-monitor.service\nsystemctl enable nut-monitor.service<\/code><\/pre>\n\n\n\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 NUT:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>upsc apc@192.168.1.108<\/code><\/pre>\n\n\n\n<p><strong>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 Windows<\/strong><\/p>\n\n\n\n<p>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c <a href=\"http:\/\/www.networkupstools.org\/package\/windows\/NUT-Installer-2.6.5-6.msi\">NUT \u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f Windows<\/a> &#8212;  \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c.<\/p>\n\n\n\n<p>\u0412 \u043f\u0430\u043f\u043a\u0443 \u0433\u0434\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 NUT \u0432 bin \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0438 \u043a\u043b\u0430\u0434\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 OpenSSL, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u043b \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435, ssleay32.dll, libssl32.dll \u0438 libeay32.dll. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u0445\u043e\u0434\u044f\u0442 \u0432 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 openssl \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438.<\/p>\n\n\n\n<p>NUT\\etc\\nut.conf.sample \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0432 NUT\\etc\\nut.conf \u0438 \u043f\u0440\u0430\u0432\u0438\u043c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MODE=netclient<\/code><\/pre>\n\n\n\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e upsmon.conf.sample \u0432 upsmon.conf \u0438 \u043f\u0440\u0430\u0432\u0438\u043c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MONITOR apc@192.168.1.108 1 win_mon win_passwd slave\r\nSHUTDOWNCMD \"shutdown \/s \/t 0\"<\/code><\/pre>\n\n\n\n<p>\u0414\u0430\u043b\u0435\u0435 \u0447\u0435\u0440\u0435\u0437 \u041f\u0443\u0441\u043a &#8212; \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b &#8212; NUT:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Stop Service\r\nStart Service<\/code><\/pre>\n\n\n\n<p>\u0418\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u044c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>net stop \"Network UPS Tools\"\r\nnet start \"Network UPS Tools\"<\/code><\/pre>\n\n\n\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"C:\\Program Files (x86)\\NUT\\bin\\upsc.exe\" apc@192.168.1.108<\/code><\/pre>\n\n\n\n<p>\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 &#8212; \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 WinNUT \u0441 GUI. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u044b \u0438 \u043f\u0440\u043e\u0441\u0442\u044b, \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 readme.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"530\" height=\"370\" src=\"https:\/\/blog.airmeno.ru\/wp-content\/uploads\/2021\/02\/nut.jpg\" alt=\"\" class=\"wp-image-1188\" srcset=\"https:\/\/blog.airmeno.ru\/wp-content\/uploads\/2021\/02\/nut.jpg 530w, https:\/\/blog.airmeno.ru\/wp-content\/uploads\/2021\/02\/nut-300x209.jpg 300w\" sizes=\"(max-width: 530px) 100vw, 530px\" \/><\/figure>\n\n\n\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 <a href=\"https:\/\/disk.yandex.ru\/d\/dXFdX41orvvZ9g\" data-type=\"URL\" data-id=\"https:\/\/disk.yandex.ru\/d\/dXFdX41orvvZ9g\">WinNUT<\/a>.<\/p>\n\n\n\n<h4>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/h4>\n\n\n\n<p>\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u0443. \u041e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0441\u0438\u0433\u043d\u0430\u043b \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043d\u0430\u0448\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e \u043f\u043e\u0439\u0434\u0443\u0442 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440 NUT. <\/p>\n\n\n\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>upsmon -c fsd<\/code><\/pre>\n\n\n\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;networkupstools.org\/\r\nhttps:\/\/wiki.debian.org\/ru\/NetworkUPSToolsHowto<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u0430\u043a \u0431\u044b \u043c\u044b \u043d\u0435 \u0443\u0445\u043e\u0434\u0438\u043b\u0438 \u043e\u0442 \u043f\u043e\u043d\u044f\u0442\u0438\u044f \u0436\u0435\u043b\u0435\u0437\u0430 \u0432 \u043e\u0431\u043b\u0430\u043a\u0430, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0435 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u0442\u043e \u0441\u0440\u0430\u0437\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043a\u0430\u043a \u0431\u043e\u0440\u043e\u0442\u044c\u0441\u044f \u0441 \u043f\u0435\u0440\u0435\u043f\u0430\u0434\u0430\u043c\u0438 \u0438&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,5],"tags":[104,12,119,24],"_links":{"self":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts\/1187"}],"collection":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1187"}],"version-history":[{"count":3,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts\/1187\/revisions"}],"predecessor-version":[{"id":1192,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts\/1187\/revisions\/1192"}],"wp:attachment":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}