{"id":326550,"date":"2021-07-16T15:00:41","date_gmt":"2021-07-16T15:00:41","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=326550"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=326550","title":{"rendered":"NFStats \u2014 \u0430\u043d\u0430\u043b\u0438\u0437 netflow \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f ISP \u00ab\u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435\u00bb"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e! \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044f \u0440\u0443\u0431\u0440\u0438\u043a\u0443 &#171;\u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435&#187; <s>(\u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0434\u0432\u0430 \u0433\u043e\u0434\u0430 \u043d\u0430\u0437\u0430\u0434 \u043e\u0434\u043d\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u0438 \u0443\u0436\u0435 \u0440\u0443\u0431\u0440\u0438\u043a\u0430)<\/s>, \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0431 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 (\u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0438 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0435\u0433\u043e \u0432 \u043f\u043e\u0440\u044f\u0434\u043e\u043a), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443 \u043d\u0430\u0441 \u043d\u0430 \u0441\u0435\u0442\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 . <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/480\/6b3\/4b7\/4806b34b7c2866c66be2a05aa6e82acd.png\" width=\"1920\" height=\"1016\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u0438 \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 Ddos \u0430\u0442\u0430\u043a (<a href=\"https:\/\/habr.com\/ru\/post\/478238\/\" rel=\"noopener noreferrer nofollow\">link<\/a>) \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432 \u0441\u0432\u043e\u0435\u0439 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0430\u0431\u043e\u0440 \u0443\u0442\u0438\u043b\u0438\u0442 <a href=\"https:\/\/code.google.com\/archive\/p\/flow-tools\/\" rel=\"noopener noreferrer nofollow\">flow-tools<\/a> \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 Netflow \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f. NFStats \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0432 \u0440\u0430\u0437\u0440\u0435\u0437\u0435 BGP \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0447\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u0438 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0435 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0438 \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043a\u0430\u043a\u043e\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437\/\u0432\/\u0438\u0437 \u0432\u0430\u0448\u0443\/\u0435\u0439 AS. \u041f\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0441 Ntopng, \u043e\u0434\u043d\u0430\u043a\u043e NFStats \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443, \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e ISP. <\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 python3 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 django. \u0414\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f google charts. <a href=\"https:\/\/github.com\/owenear\/nfstats\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Github<\/a>  <\/p>\n<p><strong>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435:<\/strong><\/p>\n<ol>\n<li>\n<p><a href=\"#prepare\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#install\" rel=\"noopener noreferrer nofollow\">\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#config\" rel=\"noopener noreferrer nofollow\">\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#use\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c<\/a><\/p>\n<\/li>\n<\/ol>\n<p><a class=\"anchor\" name=\"prepare\" id=\"prepare\"><\/a><\/p>\n<p><strong>\u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c.<\/strong><\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c NFStats, \u043a\u0430\u043a \u0440\u0430\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442 \u0443\u0442\u0438\u043b\u0438\u0442 flow-tools. \u0412\u043e FreeBSD \u043e\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043a\u0430\u043a \u043f\u0430\u043a\u0435\u0442 \u0438 \u0438\u0437 \u043f\u043e\u0440\u0442\u043e\u0432. \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 (<a href=\"https:\/\/habr.com\/ru\/post\/478238\/\" rel=\"noopener noreferrer nofollow\">link<\/a>) \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 flow-tools \u0432\u043e FreeBSD \u0438 \u043d\u0430 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>\u0414\u043b\u044f GNU\/Linux \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Ubuntu.<\/p>\n<details class=\"spoiler\">\n<summary>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Flow-tools \u0432 Ubuntu<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<pre><code class=\"bash\">sudo apt install build-essential tcpd zlib1g-dev<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041a\u0430\u0447\u0430\u0435\u043c flow-tools<\/p>\n<pre><code class=\"bash\">mkdir ~\/src  wget https:\/\/storage.googleapis.com\/google-code-archive-downloads\/v2\/code.google.com\/flow-tools\/flow-tools-0.68.5.1.tar.bz2<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c<\/p>\n<pre><code class=\"bash\">tar -xf flow-tools-0.68.5.1.tar.bz2  cd flow-tools-0.68.5.1 .\/configure make install clean<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/p>\n<pre><code class=\"bash\">adduser --system --no-create-home --shell \/usr\/sbin\/nologin --group flow-toolsools<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041f\u0430\u043f\u043a\u0430 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 netflow<\/p>\n<pre><code class=\"bash\">mkdir \/var\/flows chown -R flow-tools:flow-tools \/var\/flows<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 flow-tools \u0432 systemd. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0444\u043b\u0430\u0433\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043c\u0430\u043d\u0443\u0430\u043b\u0435 flow-capture. \u0412\u0430\u0436\u043d\u043e \u0437\u0434\u0435\u0441\u044c -n 1439, \u0447\u0442\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 flow-capture \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u043c\u0438\u043d\u0443\u0442\u0443 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. <\/p>\n<pre><code class=\"bash\"># cat \/etc\/systemd\/system\/flow-capture.service  [Unit]   Description=flow-capture  [Service]   ExecStart=\/usr\/local\/flow-tools\/bin\/flow-capture -z0 -n1439 -N3 -E10G -e0 -S1 -w \/var\/flows -D -p - 10.0.0.1\/10.0.0.10\/99919991   User=flow-tools   Group=flow-tools   Restart=on-failure   [Install]   WantedBy=multi-user.target<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441<\/p>\n<pre><code class=\"bash\">sudo systemctl daemon-reload sudo systemctl start flow-capture sudo systemctl enable flow-capture<\/code><\/pre>\n<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<p>\u041a\u0440\u043e\u043c\u0435 FreeBSD \u0438\u043b\u0438 GNU\/Linux \u0441\u043e flow-tools \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\n<p>SNMP \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b snmpv2c \u043d\u0430 \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438 <\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>Python 3.6 \u0438\u043b\u0438 \u0432\u044b\u0448\u0435 (\u0414\u043b\u044f GNU\/Linux \u0442\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u0435\u043d \u043f\u0430\u043a\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e python3.6-venv \u0438\u043b\u0438 \u0432\u044b\u0448\u0435 \u0434\u043b\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f)<\/p>\n<\/li>\n<li>\n<p>\u0421\u0423\u0411\u0414 <\/p>\n<ul>\n<li>\n<p>PostgreSQL 9.6 \u0438\u043b\u0438 \u0432\u044b\u0448\u0435<\/p>\n<\/li>\n<li>\n<p>MySQL 5.7 \u0438\u043b\u0438 \u0432\u044b\u0448\u0435<\/p>\n<\/li>\n<li>\n<p>Oracle Database Server 12.2 \u0438\u043b\u0438 \u0432\u044b\u0448\u0435. Version 6.0 or higher of the cx_Oracle Python driver is required.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>WSGI \u0441\u0435\u0440\u0432\u0435\u0440 (Apache \u0441 mod-wsgi-py3, Nginx \u0441 uwsgi, Gunicorn \u0438 \u0442.\u043f)<\/p>\n<\/li>\n<\/ul>\n<hr>\n<p><a class=\"anchor\" name=\"install\" id=\"install\"><\/a><\/p>\n<p><strong>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/strong><\/p>\n<p>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435.<\/p>\n<pre><code class=\"bash\">cd \/var\/www  git clone https:\/\/github.com\/owenear\/nfstats.git  cd nfstats python3 -m venv venv  source venv\/bin\/activate  pip install -r requirements.txt<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0432 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438! \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0432\u0430\u043c\u0438 \u0421\u0423\u0411\u0414. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f Postgres:<\/p>\n<pre><code>pip install psycopg2-binary<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0411\u0414<\/p>\n<pre><code class=\"pgsql\">postgres=# create database nfstats_db; postgres=# create user nfstats_dbuser with encrypted password 'nfstatsdbpass'; postgres=# grant all ON DATABASE nfstats_db to nfstats_dbuser;<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0434\u043b\u044f Django<\/p>\n<pre><code class=\"bash\">cd \/var\/www\/nfstats\/nfstats\/nfstats cp settings.py.sample settings.py<\/code><\/pre>\n<p>\u0412\u043d\u043e\u0441\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/p>\n<pre><code>DATABASES = {     'default': {        'ENGINE': 'django.db.backends.postgresql_psycopg2',            'NAME': 'nfstats_db',        'USER' : 'nfstats_dbuser',        'PASSWORD' : 'nfstatsdbpass',        'HOST' : 'localhost',        'PORT' : '5432',     } }<\/code><\/pre>\n<pre><code>ALLOWED_HOSTS = [ 'nfstats.example.com' ]<\/code><\/pre>\n<pre><code>TIME_ZONE = 'Europe\/Moscow'<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u0438\u043d\u0442 \u0443\u0448\u0430\u043c\u0438 \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0411\u0414. <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0432 URL \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0435 Django \/var\/www\/nfstats\/nfstats\/nfstats\/urls.py \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 url&#8217;\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<pre><code class=\"python\">urlpatterns = [     path('admin\/', admin.site.urls), #    path('', include('mainapp.urls')), ]<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0411\u0414 (\u0422\u0430\u043a\u0436\u0435 \u0432 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438)<\/p>\n<pre><code class=\"bash\">cd \/var\/www\/nfstats\/nfstats python manage.py migrate<\/code><\/pre>\n<p>\u0418 \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c url \u0432 \/var\/www\/nfstats\/nfstats\/nfstats\/urls.py<\/p>\n<pre><code class=\"python\">urlpatterns = [     path('admin\/', admin.site.urls),     path('', include('mainapp.urls')), ]<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b <code>\/var\/log\/nfstats.log<\/code> \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e web \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435  (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 www-data \u0434\u043b\u044f Apache). \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0430\u043f\u043a\u0438 <code>\/var\/www\/nfstats<\/code><\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0442\u0430\u043a\u0436\u0435, \u0447\u0442\u043e\u0431\u044b \u043a<code>\/var\/www\/nfstats\/nfstats\/flow-tools<\/code>  \u0434\u043e\u0441\u0442\u0443\u043f \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c flow-tools.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 web-\u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f Apapche:<\/p>\n<pre><code class=\"bash\">&lt;VirtualHost *:80&gt; \tServerName nfstats.example.com \tDocumentRoot \/var\/www\/nfstats         Alias \/static\/ \/var\/www\/nfstats\/nfstats\/static\/         WSGIScriptAlias \/ \/var\/www\/nfstats\/nfstats\/nfstats\/wsgi.py         WSGIDaemonProcess nfstats.example.com python-home=\/var\/www\/nfstats\/venv python-path=\/var\/www\/nfstats\/nfstats         WSGIProcessGroup nfstats.example.com &lt;\/VirtualHost&gt;<\/code><\/pre>\n<p>C\u043a\u0440\u0438\u043f\u0442<code>\/var\/www\/nfstats\/nfstats\/bin\/interface_speed.py<\/code> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 CRON  \u043d\u0430 \u0435\u0436\u0435\u043c\u0438\u043d\u0443\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435<\/p>\n<pre><code class=\"bash\">*\/1 * * * * \/var\/www\/nfstats\/venv\/bin\/python \/var\/www\/nfstats\/nfstats\/bin\/interface_speed.py<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0441\u044a\u0435\u043c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 netflow (\u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 sampling) \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0441\u0447\u0435\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0445 flow-tools, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0434\u0438\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e \u0441\u0435\u043c\u043f\u043b\u0438\u043d\u0433 \u043d\u0430 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0435 \u043e\u0434\u0438\u043d \u043a \u043e\u0434\u043d\u043e\u043c\u0443, \u0430 \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 1:2000 (\u0442\u043e \u0435\u0441\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438\u0437 2000 \u043f\u0430\u043a\u0435\u0442\u043e\u0432). \u0422\u0430\u043a, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0441\u043e\u0432\u0435\u0442\u0443\u0435\u0442 Juniper \u0434\u043b\u044f 10G \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043c\u0435\u0441\u0442\u043e \u043d\u0430 \u0434\u0438\u0441\u043a\u0435. <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043e. <\/p>\n<hr>\n<p><a class=\"anchor\" name=\"config\" id=\"config\"><\/a><\/p>\n<p><strong>\u041c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a nfstats.example.com<\/strong><\/p>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0438 \u0432\u0430\u0441 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u043e\u0435 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d netflow \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0433\u0434\u0435 \u043b\u0435\u0436\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 flow-tools.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6b5\/eea\/f8f\/6b5eeaf8ffc763146084734c39c126c0.png\" width=\"1920\" height=\"1066\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 &#171;System&#187; \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 SNMP, \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c\u0438, \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c. History &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043d\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044f\u0445 (\u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a flow-capture \u0438 \u043e\u0431\u044a\u0435\u043c\u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445) <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/05b\/89c\/384\/05b89c384725e1297bf1e0ee8556bb58.png\" width=\"1920\" height=\"542\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 &#171;Interfaces&#187; \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0431\u0430\u0437\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0441 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f.  \u0416\u043c\u0435\u043c \u043d\u0430 &#171;Read SNMP&#187; \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b (\u043e\u0431\u044b\u0447\u043d\u043e \u0432\u0441\u0435). \u0422\u0443\u0442 \u043d\u0430\u0434\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d &#171;description&#187; \u043d\u0430 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/133\/5fa\/5cc\/1335fa5cc3667edf3ea71c12352a53e6.png\" width=\"1920\" height=\"429\"><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0442\u043c\u0435\u0447\u0430\u0435\u043c \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0442\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u043a\u043b\u044e\u0447\u0435\u043d sampling (\u0442.\u0435. \u0442\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f netflow). \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0443\u0442 Uplink \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u0442.\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0445\u043e\u0434\u0438\u0442 \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bf0\/1b0\/27e\/bf01b027e349d25384f5e02258007708.png\" width=\"1920\" height=\"1042\"><figcaption><\/figcaption><\/figure>\n<hr>\n<p><a class=\"anchor\" name=\"use\" id=\"use\"><\/a><\/p>\n<p><strong>\u041d\u0443, \u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435.<\/strong> <\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0430 nfstats.example.com. \u041d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 &#171;Common Stats&#187;  \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430  \u043f\u043e \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c. \u0422\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 pie-charts \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043d\u043e\u043c\u0435\u0440 AS \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u0435\u0435 \u0438\u043c\u044f \u0432 \u0431\u0430\u0437\u0435 Ripe. Direction \u043c\u0435\u043d\u044f\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u0444\u0438\u043a\u0430. Input &#8212; \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0442\u0440\u0430\u0444\u0438\u043a, Output &#8212; \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0439.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/851\/2f3\/e64\/8512f3e642b17b0ecb604f06d82e0ccd.png\" width=\"1920\" height=\"1019\"><figcaption><\/figcaption><\/figure>\n<p>&#171;BGP AS&#187; &#8212; \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043f\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 source \u0438\/\u0438\u043b\u0438 destination AS. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c6b\/081\/5f9\/c6b0815f9fc9577883b4fe978d9947cc.png\" width=\"1920\" height=\"1019\"><figcaption><\/figcaption><\/figure>\n<p>&#171;Interface&#187;  \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u043b\u0438 \u0432\u0432\u0435\u0441\u0442\u0438 snmpid \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u041d\u0415! \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0441\u044d\u043c\u043f\u043b\u0438\u043d\u0433.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/48c\/61c\/f96\/48c61cf96da8749af1434799cf92425d.png\" width=\"1920\" height=\"1019\"><figcaption><\/figcaption><\/figure>\n<p>\u0418 &#171;IP&#187; &#8212; \u0442\u043e\u043f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e ip-\u0430\u0434\u0440\u0435\u0441\u0430\u043c \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438. \u041f\u0440\u0438 \u043a\u043b\u0438\u043a\u0435 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 &#171;bar&#187; \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u0441\u0435\u0442\u0438 \u0438 \u043a\u043d\u043e\u043f\u043a\u0430 &#171;show traffic&#187;, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 netflow \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e ip-\u0430\u0434\u0440\u0435\u0441\u0430<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/837\/d35\/002\/837d35002c9650ac3efdfa8689a7eeba.png\" width=\"1920\" height=\"1019\"><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a1e\/af3\/404\/a1eaf340403156094de66925db04727b.png\" width=\"1920\" height=\"1055\"><figcaption><\/figcaption><\/figure>\n<hr>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043e\u043d \u0432\u044b\u0442\u0435\u043a\u0430\u0435\u0442 \u0438\u0437 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0430 flow-tools &#8212; \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 netflow 9\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u0427\u0442\u043e \u0432\u043b\u0435\u0447\u0435\u0442 \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 32 \u0431\u0438\u0442\u043d\u044b\u0445 \u043d\u043e\u043c\u0435\u0440\u043e\u0432 AS. \u0412\u0441\u0435 &#171;\u0434\u043b\u0438\u043d\u043d\u044b\u0435&#187; ASN \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a AS23456. \u0427\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u0440\u0438\u0441\u043a\u043e\u0440\u0431\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043f\u043b\u0430\u043d\u044b \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e netflow \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0430. <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f (\u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0432 \u043c\u043e\u0438\u0445 \u0441\u0438\u043b\u0430\u0445). \u041a\u043e\u0435-\u043a\u0430\u043a\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u044f \u043f\u043e\u043b\u043e\u0436\u0438\u043b \u0438 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 <a href=\"https:\/\/github.com\/owenear\/nfstats\" rel=\"noopener noreferrer nofollow\">\u043d\u0430 Github<\/a>. <\/p>\n<p>\u041d\u043e \u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0433\u043e\u0442\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435, \u0443\u0434\u0430\u0447\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f!<\/p>\n<\/div>\n<p> \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\/post\/568074\/\"> https:\/\/habr.com\/ru\/post\/568074\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e! \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044f \u0440\u0443\u0431\u0440\u0438\u043a\u0443 &#171;\u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435&#187; <s>(\u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0434\u0432\u0430 \u0433\u043e\u0434\u0430 \u043d\u0430\u0437\u0430\u0434 \u043e\u0434\u043d\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u0438 \u0443\u0436\u0435 \u0440\u0443\u0431\u0440\u0438\u043a\u0430)<\/s>, \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0431 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 (\u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0438 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0435\u0433\u043e \u0432 \u043f\u043e\u0440\u044f\u0434\u043e\u043a), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443 \u043d\u0430\u0441 \u043d\u0430 \u0441\u0435\u0442\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 . <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u0438 \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 Ddos \u0430\u0442\u0430\u043a (<a href=\"https:\/\/habr.com\/ru\/post\/478238\/\" rel=\"noopener noreferrer nofollow\">link<\/a>) \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432 \u0441\u0432\u043e\u0435\u0439 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0430\u0431\u043e\u0440 \u0443\u0442\u0438\u043b\u0438\u0442 <a href=\"https:\/\/code.google.com\/archive\/p\/flow-tools\/\" rel=\"noopener noreferrer nofollow\">flow-tools<\/a> \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 Netflow \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f. NFStats \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0432 \u0440\u0430\u0437\u0440\u0435\u0437\u0435 BGP \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0447\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u0438 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0435 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0438 \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043a\u0430\u043a\u043e\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437\/\u0432\/\u0438\u0437 \u0432\u0430\u0448\u0443\/\u0435\u0439 AS. \u041f\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0441 Ntopng, \u043e\u0434\u043d\u0430\u043a\u043e NFStats \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443, \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e ISP. <\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 python3 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 django. \u0414\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f google charts. <a href=\"https:\/\/github.com\/owenear\/nfstats\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Github<\/a>  <\/p>\n<p><strong>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435:<\/strong><\/p>\n<ol>\n<li>\n<p><a href=\"#prepare\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#install\" rel=\"noopener noreferrer nofollow\">\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#config\" rel=\"noopener noreferrer nofollow\">\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#use\" rel=\"noopener noreferrer nofollow\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c<\/a><\/p>\n<\/li>\n<\/ol>\n<p><a class=\"anchor\" name=\"prepare\" id=\"prepare\"><\/a><\/p>\n<p><strong>\u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c.<\/strong><\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c NFStats, \u043a\u0430\u043a \u0440\u0430\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442 \u0443\u0442\u0438\u043b\u0438\u0442 flow-tools. \u0412\u043e FreeBSD \u043e\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043a\u0430\u043a \u043f\u0430\u043a\u0435\u0442 \u0438 \u0438\u0437 \u043f\u043e\u0440\u0442\u043e\u0432. \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 (<a href=\"https:\/\/habr.com\/ru\/post\/478238\/\" rel=\"noopener noreferrer nofollow\">link<\/a>) \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 flow-tools \u0432\u043e FreeBSD \u0438 \u043d\u0430 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>\u0414\u043b\u044f GNU\/Linux \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Ubuntu.<\/p>\n<details class=\"spoiler\">\n<summary>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Flow-tools \u0432 Ubuntu<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<pre><code class=\"bash\">sudo apt install build-essential tcpd zlib1g-dev<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041a\u0430\u0447\u0430\u0435\u043c flow-tools<\/p>\n<pre><code class=\"bash\">mkdir ~\/src  wget https:\/\/storage.googleapis.com\/google-code-archive-downloads\/v2\/code.google.com\/flow-tools\/flow-tools-0.68.5.1.tar.bz2<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c<\/p>\n<pre><code class=\"bash\">tar -xf flow-tools-0.68.5.1.tar.bz2  cd flow-tools-0.68.5.1 .\/configure make install clean<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/p>\n<pre><code class=\"bash\">adduser --system --no-create-home --shell \/usr\/sbin\/nologin --group flow-toolsools<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041f\u0430\u043f\u043a\u0430 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 netflow<\/p>\n<pre><code class=\"bash\">mkdir \/var\/flows chown -R flow-tools:flow-tools \/var\/flows<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 flow-tools \u0432 systemd. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0444\u043b\u0430\u0433\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043c\u0430\u043d\u0443\u0430\u043b\u0435 flow-capture. \u0412\u0430\u0436\u043d\u043e \u0437\u0434\u0435\u0441\u044c -n 1439, \u0447\u0442\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 flow-capture \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u043c\u0438\u043d\u0443\u0442\u0443 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. <\/p>\n<pre><code class=\"bash\"># cat \/etc\/systemd\/system\/flow-capture.service  [Unit]   Description=flow-capture  [Service]   ExecStart=\/usr\/local\/flow-tools\/bin\/flow-capture -z0 -n1439 -N3 -E10G -e0 -S1 -w \/var\/flows -D -p - 10.0.0.1\/10.0.0.10\/99919991   User=flow-tools   Group=flow-tools   Restart=on-failure   [Install]   WantedBy=multi-user.target<\/code><\/pre>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441<\/p>\n<pre><code class=\"bash\">sudo systemctl daemon-reload sudo systemctl start flow-capture sudo systemctl enable flow-capture<\/code><\/pre>\n<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<p>\u041a\u0440\u043e\u043c\u0435 FreeBSD \u0438\u043b\u0438 GNU\/Linux \u0441\u043e flow-tools \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\n<p>SNMP \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b snmpv2c \u043d\u0430 \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438 <\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>Python 3.6 \u0438\u043b\u0438 \u0432\u044b\u0448\u0435 (\u0414\u043b\u044f GNU\/Linux \u0442\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u0435\u043d \u043f\u0430\u043a\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e python3.6-venv \u0438\u043b\u0438 \u0432\u044b\u0448\u0435 \u0434\u043b\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f)<\/p>\n<\/li>\n<li>\n<p>\u0421\u0423\u0411\u0414 <\/p>\n<ul>\n<li>\n<p>PostgreSQL 9.6 \u0438\u043b\u0438 \u0432\u044b\u0448\u0435<\/p>\n<\/li>\n<li>\n<p>MySQL 5.7 \u0438\u043b\u0438 \u0432\u044b\u0448\u0435<\/p>\n<\/li>\n<li>\n<p>Oracle Database Server 12.2 \u0438\u043b\u0438 \u0432\u044b\u0448\u0435. Version 6.0 or higher of the cx_Oracle Python driver is required.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>WSGI \u0441\u0435\u0440\u0432\u0435\u0440 (Apache \u0441 mod-wsgi-py3, Nginx \u0441 uwsgi, Gunicorn \u0438 \u0442.\u043f)<\/p>\n<\/li>\n<\/ul>\n<hr>\n<p><a class=\"anchor\" name=\"install\" id=\"install\"><\/a><\/p>\n<p><strong>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/strong><\/p>\n<p>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435.<\/p>\n<pre><code class=\"bash\">cd \/var\/www  git clone https:\/\/github.com\/owenear\/nfstats.git  cd nfstats python3 -m venv venv  source venv\/bin\/activate  pip install -r requirements.txt<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0432 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438! \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0432\u0430\u043c\u0438 \u0421\u0423\u0411\u0414. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f Postgres:<\/p>\n<pre><code>pip install psycopg2-binary<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0411\u0414<\/p>\n<pre><code class=\"pgsql\">postgres=# create database nfstats_db; postgres=# create user nfstats_dbuser with encrypted password 'nfstatsdbpass'; postgres=# grant all ON DATABASE nfstats_db to nfstats_dbuser;<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0434\u043b\u044f Django<\/p>\n<pre><code class=\"bash\">cd \/var\/www\/nfstats\/nfstats\/nfstats cp settings.py.sample settings.py<\/code><\/pre>\n<p>\u0412\u043d\u043e\u0441\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/p>\n<pre><code>DATABASES = {     'default': {        'ENGINE': 'django.db.backends.postgresql_psycopg2',            'NAME': 'nfstats_db',        'USER' : 'nfstats_dbuser',        'PASSWORD' : 'nfstatsdbpass',        'HOST' : 'localhost',        'PORT' : '5432',     } }<\/code><\/pre>\n<pre><code>ALLOWED_HOSTS = [ 'nfstats.example.com' ]<\/code><\/pre>\n<pre><code>TIME_ZONE = 'Europe\/Moscow'<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u0438\u043d\u0442 \u0443\u0448\u0430\u043c\u0438 \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0411\u0414. <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0432 URL \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0435 Django \/var\/www\/nfstats\/nfstats\/nfstats\/urls.py \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 url&#8217;\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<pre><code class=\"python\">urlpatterns = [     path('admin\/', admin.site.urls), #    path('', include('mainapp.urls')), ]<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0411\u0414 (\u0422\u0430\u043a\u0436\u0435 \u0432 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438)<\/p>\n<pre><code class=\"bash\">cd \/var\/www\/nfstats\/nfstats python manage.py migrate<\/code><\/pre>\n<p>\u0418 \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c url \u0432 \/var\/www\/nfstats\/nfstats\/nfstats\/urls.py<\/p>\n<pre><code class=\"python\">urlpatterns = [     path('admin\/', admin.site.urls),     path('', include('mainapp.urls')), ]<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b <code>\/var\/log\/nfstats.log<\/code> \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e web \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435  (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 www-data \u0434\u043b\u044f Apache). \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0430\u043f\u043a\u0438 <code>\/var\/www\/nfstats<\/code><\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0442\u0430\u043a\u0436\u0435, \u0447\u0442\u043e\u0431\u044b \u043a<code>\/var\/www\/nfstats\/nfstats\/flow-tools<\/code>  \u0434\u043e\u0441\u0442\u0443\u043f \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c flow-tools.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 web-\u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f Apapche:<\/p>\n<pre><code class=\"bash\">&lt;VirtualHost *:80&gt; \tServerName nfstats.example.com \tDocumentRoot \/var\/www\/nfstats         Alias \/static\/ \/var\/www\/nfstats\/nfstats\/static\/         WSGIScriptAlias \/ \/var\/www\/nfstats\/nfstats\/nfstats\/wsgi.py         WSGIDaemonProcess nfstats.example.com python-home=\/var\/www\/nfstats\/venv python-path=\/var\/www\/nfstats\/nfstats         WSGIProcessGroup nfstats.example.com &lt;\/VirtualHost&gt;<\/code><\/pre>\n<p>C\u043a\u0440\u0438\u043f\u0442<code>\/var\/www\/nfstats\/nfstats\/bin\/interface_speed.py<\/code> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 CRON  \u043d\u0430 \u0435\u0436\u0435\u043c\u0438\u043d\u0443\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435<\/p>\n<pre><code class=\"bash\">*\/1 * * * * \/var\/www\/nfstats\/venv\/bin\/python \/var\/www\/nfstats\/nfstats\/bin\/interface_speed.py<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0441\u044a\u0435\u043c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 netflow (\u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 sampling) \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0441\u0447\u0435\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0445 flow-tools, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0434\u0438\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e \u0441\u0435\u043c\u043f\u043b\u0438\u043d\u0433 \u043d\u0430 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0435 \u043e\u0434\u0438\u043d \u043a \u043e\u0434\u043d\u043e\u043c\u0443, \u0430 \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 1:2000 (\u0442\u043e \u0435\u0441\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438\u0437 2000 \u043f\u0430\u043a\u0435\u0442\u043e\u0432). \u0422\u0430\u043a, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0441\u043e\u0432\u0435\u0442\u0443\u0435\u0442 Juniper \u0434\u043b\u044f 10G \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043c\u0435\u0441\u0442\u043e \u043d\u0430 \u0434\u0438\u0441\u043a\u0435. <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043e. <\/p>\n<hr>\n<p><a class=\"anchor\" name=\"config\" id=\"config\"><\/a><\/p>\n<p><strong>\u041c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a nfstats.example.com<\/strong><\/p>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0438 \u0432\u0430\u0441 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u043e\u0435 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d netflow \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0433\u0434\u0435 \u043b\u0435\u0436\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 flow-tools.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 &#171;System&#187; \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 SNMP, \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c\u0438, \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c. History &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043d\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044f\u0445 (\u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a flow-capture \u0438 \u043e\u0431\u044a\u0435\u043c\u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445) <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 &#171;Interfaces&#187; \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0431\u0430\u0437\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0441 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f.  \u0416\u043c\u0435\u043c \u043d\u0430 &#171;Read SNMP&#187; \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b (\u043e\u0431\u044b\u0447\u043d\u043e \u0432\u0441\u0435). \u0422\u0443\u0442 \u043d\u0430\u0434\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d &#171;description&#187; \u043d\u0430 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0442\u043c\u0435\u0447\u0430\u0435\u043c \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0442\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u043a\u043b\u044e\u0447\u0435\u043d sampling (\u0442.\u0435. \u0442\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f netflow). \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0443\u0442 Uplink \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u0442.\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0445\u043e\u0434\u0438\u0442 \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<hr>\n<p><a class=\"anchor\" name=\"use\" id=\"use\"><\/a><\/p>\n<p><strong>\u041d\u0443, \u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435.<\/strong> <\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0430 nfstats.example.com. \u041d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 &#171;Common Stats&#187;  \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430  \u043f\u043e \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c. \u0422\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 pie-charts \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043d\u043e\u043c\u0435\u0440 AS \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u0435\u0435 \u0438\u043c\u044f \u0432 \u0431\u0430\u0437\u0435 Ripe. Direction \u043c\u0435\u043d\u044f\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u0444\u0438\u043a\u0430. Input &#8212; \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0442\u0440\u0430\u0444\u0438\u043a, Output &#8212; \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0439.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>&#171;BGP AS&#187; &#8212; \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043f\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 source \u0438\/\u0438\u043b\u0438 destination AS. <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>&#171;Interface&#187;  \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u043b\u0438 \u0432\u0432\u0435\u0441\u0442\u0438 snmpid \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u041d\u0415! \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0441\u044d\u043c\u043f\u043b\u0438\u043d\u0433.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0418 &#171;IP&#187; &#8212; \u0442\u043e\u043f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e ip-\u0430\u0434\u0440\u0435\u0441\u0430\u043c \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438. \u041f\u0440\u0438 \u043a\u043b\u0438\u043a\u0435 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 &#171;bar&#187; \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u0441\u0435\u0442\u0438 \u0438 \u043a\u043d\u043e\u043f\u043a\u0430 &#171;show traffic&#187;, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 netflow \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e ip-\u0430\u0434\u0440\u0435\u0441\u0430<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<hr>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043e\u043d \u0432\u044b\u0442\u0435\u043a\u0430\u0435\u0442 \u0438\u0437 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0430 flow-tools &#8212; \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 netflow 9\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u0427\u0442\u043e \u0432\u043b\u0435\u0447\u0435\u0442 \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 32 \u0431\u0438\u0442\u043d\u044b\u0445 \u043d\u043e\u043c\u0435\u0440\u043e\u0432 AS. \u0412\u0441\u0435 &#171;\u0434\u043b\u0438\u043d\u043d\u044b\u0435&#187; ASN \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a AS23456. \u0427\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u0440\u0438\u0441\u043a\u043e\u0440\u0431\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043f\u043b\u0430\u043d\u044b \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e netflow \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0430. <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f (\u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0432 \u043c\u043e\u0438\u0445 \u0441\u0438\u043b\u0430\u0445). \u041a\u043e\u0435-\u043a\u0430\u043a\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u044f \u043f\u043e\u043b\u043e\u0436\u0438\u043b \u0438 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 <a href=\"https:\/\/github.com\/owenear\/nfstats\" rel=\"noopener noreferrer nofollow\">\u043d\u0430 Github<\/a>. <\/p>\n<p>\u041d\u043e \u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0433\u043e\u0442\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435, \u0443\u0434\u0430\u0447\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f!<\/p>\n<\/div>\n<p> \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\/post\/568074\/\"> https:\/\/habr.com\/ru\/post\/568074\/<\/a><br \/><\/br><\/br><\/hr>\n<\/hr>\n<\/hr>\n<\/div>\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-326550","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/326550","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=326550"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/326550\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=326550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=326550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=326550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}