{"id":2785,"date":"2023-09-10T16:18:00","date_gmt":"2023-09-10T14:18:00","guid":{"rendered":"https:\/\/linux-bibel.at\/?p=2785"},"modified":"2023-09-10T16:18:02","modified_gmt":"2023-09-10T14:18:02","slug":"vnstat-netzwerkanalyse-unter-linux","status":"publish","type":"post","link":"https:\/\/linux-bibel.at\/index.php\/2023\/09\/10\/vnstat-netzwerkanalyse-unter-linux\/","title":{"rendered":"Vnstat &#8211; Netzwerkanalyse unter Linux"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In diesem Beitrag der Linux Bibel sehen wir uns einmal eine Software f\u00fcr die Analyse des Netzwerktraffics unter Linux an &#8211; die Software nennt sich Vnstat.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Vnstat installieren<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Unter auf Debian basierenden Linux-Distributionen installieren Sie diese Software wie \u00fcblich ganz einfach \u00fcber die\u00a0Paket-Verwaltung\u00a0durch die Pakete &#8222;<strong>vnstat vnstati<\/strong>&#8222;. Nutzen Sie eine Distribution, die diese Software nicht in ihren Repositorys mitf\u00fchrt, finden Sie die Software auch auf\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/vergoh\/vnstat\/releases\" target=\"_blank\">GitHub<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Vnstat l\u00e4uft als\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/linux-bibel.at\/index.php\/2023\/09\/03\/systemd-die-steuerzentrale-von-linux\/\" data-type=\"post\" data-id=\"783\" target=\"_blank\">Systemd<\/a>-Dienst, unter Debian l\u00e4uft dieser nach der Installation auch gleich &#8211; zeigt der Befehl:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status vnstat.service<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-1024x576.jpg\" alt=\"\" class=\"wp-image-2786\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">L\u00e4uft der Dienst unter anderen Linux-Distributionen nicht automatisch, aktivieren Sie diesen mit dem Befehl:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable --now vnstat.service<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Vnstat nutzen<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Vnstat l\u00e4uft im Hintergrund und zeichnet die Ereignisse des Netzwerkes auf, rufen wir die Software einmal auf &#8211; dies funktioniert auf dem\u00a0Terminal\u00a0mit dem Befehl:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vnstat<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-1-1024x576.jpg\" alt=\"\" class=\"wp-image-2787\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-1-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-1-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-1-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-1-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-1.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Je nachdem, wie lange Vnstat schon l\u00e4uft, zeigt die Software t\u00e4gliche, w\u00f6chentliche und monatliche, aber auch j\u00e4hrliche Statistiken an. Die Ausgabe k\u00f6nnen wir auch anpassen &#8211; mit der Option\u00a0<code>-h<\/code>\u00a0erhalten wir st\u00fcndliche Ausgaben:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vnstat -h<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-2-1024x576.jpg\" alt=\"\" class=\"wp-image-2788\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-2-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-2-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-2-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-2-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-2.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Mit\u00a0<code>-d<\/code>\u00a0erhalten wir t\u00e4gliche Analysen, mit\u00a0<code>-m<\/code>\u00a0monatliche, mit\u00a0<code>-w<\/code>\u00a0w\u00f6chentliche und mit\u00a0<code>-y<\/code>\u00a0j\u00e4hrliche. Wir k\u00f6nnen die Ausgabe auch weiter anpassen &#8211; etwa in f\u00fcnfmin\u00fctigen Abst\u00e4nden:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vnstat -5<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-3-1024x576.jpg\" alt=\"\" class=\"wp-image-2789\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-3-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-3-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-3-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-3-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-3.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Mehr finden Sie wie immer auf der Manpage mit dem Befehl:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>man vnstat<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Oder eine kurze Hilfe mit:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vnstat --help<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Haben Sie bei der Installation der Software nicht nur das erste Paket installiert, sondern auch das zweite wie vorgeschlagen, k\u00f6nnen Sie sich die Nutzung auch grafisch ausgeben lassen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vnstati -s -i wlan0 -o network.log.png<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Statt\u00a0<code>wlan0<\/code>\u00a0geben Sie das entsprechende Netzwerk-Interface an:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-4-1024x576.jpg\" alt=\"\" class=\"wp-image-2790\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-4-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-4-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-4-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-4-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-4.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Jetzt wollen wir eine st\u00fcndliche Ausgabe:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vnstati -h -i wlan0 -o network.log.png<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-5-1024x576.jpg\" alt=\"\" class=\"wp-image-2791\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-5-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-5-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-5-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-5-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/vnstat-5.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Und so weiter und so fort.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In diesem Beitrag der Linux Bibel sehen wir uns einmal eine Software f\u00fcr die Analyse des Netzwerktraffics unter Linux an &#8211; die Software nennt sich Vnstat. Vnstat installieren Unter auf Debian basierenden Linux-Distributionen installieren Sie diese Software wie \u00fcblich ganz einfach \u00fcber die\u00a0Paket-Verwaltung\u00a0durch die Pakete &#8222;vnstat vnstati&#8222;. Nutzen Sie eine Distribution, die diese Software nicht [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2789,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[39],"class_list":["post-2785","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-netzwerk","tag-netzwerk"],"_links":{"self":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/2785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/comments?post=2785"}],"version-history":[{"count":1,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/2785\/revisions"}],"predecessor-version":[{"id":2792,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/2785\/revisions\/2792"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media\/2789"}],"wp:attachment":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media?parent=2785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/categories?post=2785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/tags?post=2785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}