{"id":167,"date":"2011-04-22T11:52:11","date_gmt":"2011-04-22T09:52:11","guid":{"rendered":"http:\/\/rexxer.kharkov.ru\/?p=167"},"modified":"2011-04-22T11:52:11","modified_gmt":"2011-04-22T09:52:11","slug":"mpd5-ip-logging","status":"publish","type":"post","link":"https:\/\/dety.net.ua\/?p=167","title":{"rendered":"MPD5 + IP logging"},"content":{"rendered":"<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u0442\u0435\u043c\u043a\u0443 \u043d\u0430\u0448\u0435\u043b: <a href=\"http:\/\/forum.ixbt.com\/topic.cgi?id=76:9897\" target=\"_blank\">\u0442\u044b\u0446<\/a><\/p>\n<p>citrin \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f IP \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432:<\/p>\n<blockquote><p>\u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 mpd \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c<\/p>\n<p>set auth enable ext-acct<br \/>\nset auth extacct-script \/usr\/local\/sbin\/mpd-acct.sh<br \/>\n\u0412 \/usr\/local\/sbin\/mpd-acct.sh \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c:<\/p>\n<p>\u043a\u043e\u0434<\/p>\n<div id=\"c1\" class=\"n2\" style=\"width: 100%\">\n<pre><span style=\"font-family: courier\">#!\/bin\/sh\n\nIFS=':'\n\nwhile read _key _value; do\n\n        if [ -z \"${_key}\" ]; then\n                break\n        fi\n\n        if [ -n \"${_value}\" ]; then\n                LOGLINE=\"$LOGLINE ${_key}=${_value}\"\n        fi\ndone\n\necho $LOGLINE | sed 's\/^ \/\/' | logger -p local7.info -t mpd-acct\n<\/span><\/pre>\n<\/div>\n<hr size=\"1\" \/><\/blockquote>\n<p>\u0432 \/etc\/syslog.conf \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c:<\/p>\n<blockquote><p>!*<br \/>\nlocal7.*                                        \/var\/log\/mpd-acct.log<\/p><\/blockquote>\n<p>\u042f \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u043b \u043f\u043e\u0434 \u0441\u0435\u0431\u044f \u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e &#8211; \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0442\u0430\u043a:<\/p>\n<blockquote>\n<blockquote>\n<blockquote><p>#!\/bin\/sh<\/p>\n<p>IFS=&#8217;:&#8217;<\/p>\n<p>while read _key _value; do<\/p>\n<p>if [ -z &#8220;${_key}&#8221; ]; then<br \/>\nbreak<br \/>\nfi<\/p>\n<p>if [ -n &#8220;${_value}&#8221; ]; then<\/p>\n<p>if [ &#8220;${_key}&#8221; = &#8220;USER_NAME&#8221; ] || [ &#8220;${_key}&#8221; = &#8220;PEER_ADDR&#8221; ] || [ &#8220;${_key}&#8221; = &#8220;SELF_ADDR&#8221; ] || [ &#8220;${_key}&#8221; = &#8220;PE<br \/>\nLOGLINE=&#8221;$LOGLINE ${_key}=${_value}&#8221;<br \/>\nfi<\/p>\n<p>fi<br \/>\ndone<\/p>\n<p>echo $LOGLINE | logger -p local7.info -t mpd-acct<\/p><\/blockquote>\n<p>\u0432 \/etc\/syslog.conf \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c<\/p>\n<blockquote><p>!*<br \/>\nlocal7.*                                        @192.168.10.1<\/p><\/blockquote>\n<\/blockquote>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u0442\u0435\u043c\u043a\u0443 \u043d\u0430\u0448\u0435\u043b: \u0442\u044b\u0446 citrin \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f IP \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432: \u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 mpd \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c set auth enable ext-acct set auth extacct-script \/usr\/local\/sbin\/mpd-acct.sh \u0412 \/usr\/local\/sbin\/mpd-acct.sh \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c: \u043a\u043e\u0434 #!\/bin\/sh IFS=&#8217;:&#8217; while read _key _value; do if [ -z &#8220;${_key}&#8221; ]; then break fi if [ -n &#8220;${_value}&#8221; ]; then LOGLINE=&#8221;$LOGLINE ${_key}=${_value}&#8221; fi done echo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6,13],"tags":[],"class_list":["post-167","post","type-post","status-publish","format-standard","hentry","category-freebsd","category-linux","category-novosti"],"_links":{"self":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=167"}],"version-history":[{"count":0,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/167\/revisions"}],"wp:attachment":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}