{"id":5199,"date":"2022-09-06T13:49:08","date_gmt":"2022-09-06T13:49:08","guid":{"rendered":"https:\/\/tst-amo.net.ua\/blog\/?p=5199"},"modified":"2022-10-08T06:20:13","modified_gmt":"2022-10-08T06:20:13","slug":"%d0%bb%d0%be%d0%b3%d0%b8%d1%80%d0%be%d0%b2%d0%b0%d0%bd%d0%b8%d0%b5-%d1%81%d0%be%d0%b1%d1%8b%d1%82%d0%b8%d0%b9-%d0%bd%d0%b0-%d1%83%d0%b4%d0%b0%d0%bb%d0%b5%d0%bd%d0%bd%d1%8b%d0%b9-%d1%81%d0%b5%d1%80","status":"publish","type":"post","link":"https:\/\/tst-amo.net.ua\/blog\/?p=5199","title":{"rendered":"\u041b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 rsyslog"},"content":{"rendered":"<p>System&#8211;&gt;Logging&#8211;&gt;Actions&#8211;&gt;New Action<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-5203 aligncenter\" src=\"https:\/\/tst-amo.net.ua\/blog\/wp-content\/uploads\/2022\/09\/\u0411\u0435\u0437-\u0438\u043c\u0435\u043d\u0438-16.jpg\" alt=\"\" width=\"412\" height=\"423\" srcset=\"https:\/\/tst-amo.net.ua\/blog\/wp-content\/uploads\/2022\/09\/\u0411\u0435\u0437-\u0438\u043c\u0435\u043d\u0438-16.jpg 412w, https:\/\/tst-amo.net.ua\/blog\/wp-content\/uploads\/2022\/09\/\u0411\u0435\u0437-\u0438\u043c\u0435\u043d\u0438-16-292x300.jpg 292w\" sizes=\"(max-width: 412px) 100vw, 412px\" \/><\/p>\n<p>Type &#8211; remote<\/p>\n<p>Remote Address &#8211; IP \u0441\u0435\u0440\u0432\u0435\u0440\u0430 syslog<\/p>\n<p>\u041f\u043e\u0442\u043e\u043c \u0434\u0435\u043b\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 Rules<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-5205 aligncenter\" src=\"https:\/\/tst-amo.net.ua\/blog\/wp-content\/uploads\/2022\/09\/\u0411\u0435\u0437-\u0438\u043c\u0435\u043d\u0438-17.jpg\" alt=\"\" width=\"412\" height=\"423\" srcset=\"https:\/\/tst-amo.net.ua\/blog\/wp-content\/uploads\/2022\/09\/\u0411\u0435\u0437-\u0438\u043c\u0435\u043d\u0438-17.jpg 412w, https:\/\/tst-amo.net.ua\/blog\/wp-content\/uploads\/2022\/09\/\u0411\u0435\u0437-\u0438\u043c\u0435\u043d\u0438-17-292x300.jpg 292w\" sizes=\"(max-width: 412px) 100vw, 412px\" \/><\/p>\n<p>\u0412 \u043f\u043e\u043b\u0435 Topics \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u0430\u043a\u0438\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0432 \u043f\u043e\u043b\u0435 Action \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0430\u0448 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 action.<\/p>\n<p>\u041d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c rsyslog.conf, \u0440\u0430\u0441\u043a\u043e\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre># vi \/etc\/rsyslog.conf\r\n\r\n# Provides UDP syslog reception\r\n$ModLoad imudp\r\n$UDPServerRun <span style=\"color: #ff0000;\">514<\/span><\/pre>\n<p>\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u043f\u0443\u0442\u044c \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043b\u043e\u0433\u0430, \u0447\u0442\u043e \u0431\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0435 \u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c \u0438\u043b\u0438 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0432 \/var\/log\/messages:<\/p>\n<pre># vi \/etc\/rsyslog.d\/mikrotik.conf\r\n\r\n$template FILENAME,\"\/var\/log\/<span style=\"color: #ff0000;\">mikrotik<\/span>\/%fromhost-ip%\/syslog.log\" \r\nif $fromhost-ip != '127.0.0.1' then ?FILENAME \r\n&amp; stop<\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c firewall \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f 514 udp \u043f\u043e\u0440\u0442\u0430.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e<\/p>\n<pre># systemctl restart rsyslog<\/pre>\n<p>\u0418 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f<\/p>\n<pre># less \/var\/log\/mikrotik\/192.168.1.1\/syslog.log<\/pre>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0440\u043e\u0442\u0430\u0446\u0438\u044e \u043b\u043e\u0433\u043e\u0432:<\/h3>\n<pre># cat \/etc\/logrotate.d\/mikrotik\u00a0\r\n\/var\/log\/mikrotik\/*\/*.log {\r\n  \u00a0 \u00a0 \u00a0 weekly\r\n  \u00a0 \u00a0 \u00a0 rotate 12\r\n  \u00a0 \u00a0 \u00a0 compress\r\n  \u00a0 \u00a0 \u00a0 olddir \/var\/log\/mikrotik\/old\r\n  \u00a0 \u00a0 \u00a0 missingok\r\n  \u00a0 \u00a0 \u00a0 notifempty\r\n  \u00a0 \u00a0 \u00a0 create 0644 root root\r\n}<\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c<\/p>\n<pre># \/usr\/sbin\/logrotate -d \/etc\/logrotate.conf 2&gt; \/tmp\/logrotate.debug<\/pre>\n<p>\u0420\u043e\u0442\u0430\u0446\u0438\u044f \u043b\u043e\u0433\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0435\u0436\u0435\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u043e, \u0432\u043e \u0432\u0441\u0435\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u0445, \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f 12 \u0441\u0436\u0430\u0442\u044b\u0445 \u0430\u0440\u0445\u0438\u0432\u043e\u0432, \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \/var\/log\/mikrotik\/old.<\/p>\n<div class=\"pdfprnt-buttons pdfprnt-buttons-post pdfprnt-bottom-right\"><a href=\"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=wpv2posts5199&print=pdf\" class=\"pdfprnt-button pdfprnt-button-pdf\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/tst-amo.net.ua\/blog\/wp-content\/plugins\/pdf-print\/images\/pdf.png\" alt=\"image_pdf\" title=\"View PDF\" \/><\/a><a href=\"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=wpv2posts5199&print=print\" class=\"pdfprnt-button pdfprnt-button-print\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/tst-amo.net.ua\/blog\/wp-content\/plugins\/pdf-print\/images\/print.png\" alt=\"image_print\" title=\"Print Content\" \/><\/a><\/div>","protected":false},"excerpt":{"rendered":"<p>System&#8211;&gt;Logging&#8211;&gt;Actions&#8211;&gt;New Action Type &#8211; remote Remote Address &#8211; IP \u0441\u0435\u0440\u0432\u0435\u0440\u0430 syslog \u041f\u043e\u0442\u043e\u043c \u0434\u0435\u043b\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 Rules \u0412 \u043f\u043e\u043b\u0435 Topics \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u0430\u043a\u0438\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0432 \u043f\u043e\u043b\u0435 Action \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0430\u0448 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 action. \u041d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c rsyslog.conf, \u0440\u0430\u0441\u043a\u043e\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438: # vi \/etc\/rsyslog.conf # Provides UDP syslog reception $ModLoad imudp $UDPServerRun 514 \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 &#8230;<\/p>\n<p><a href=\"https:\/\/tst-amo.net.ua\/blog\/?p=5199\" class=\"more-link\">Continue reading &lsquo;\u041b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 rsyslog&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48,47,242,283,316,184],"tags":[],"class_list":["post-5199","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux","category-log","category-logrotate","category-mikrotik","category-rsyslog"],"_links":{"self":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5199"}],"collection":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5199"}],"version-history":[{"count":9,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5199\/revisions"}],"predecessor-version":[{"id":5312,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5199\/revisions\/5312"}],"wp:attachment":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}