<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>bandwidth usage &#8211; Uroš Vovk</title>
	<atom:link href="https://www.urosvovk.com/tag/bandwidth-usage/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.urosvovk.com</link>
	<description>Uroš Vovk home page</description>
	<lastBuildDate>Tue, 03 Mar 2026 21:15:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>Bandwidth usage report per IP address</title>
		<link>https://www.urosvovk.com/bandwidth-usage-report-per-ip-address/</link>
					<comments>https://www.urosvovk.com/bandwidth-usage-report-per-ip-address/#comments</comments>
		
		<dc:creator><![CDATA[Uroš]]></dc:creator>
		<pubDate>Fri, 01 Jun 2018 13:04:54 +0000</pubDate>
				<category><![CDATA[Linux Stuff]]></category>
		<category><![CDATA[Network Stuff]]></category>
		<category><![CDATA[accounting]]></category>
		<category><![CDATA[bandwidth usage]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mikrotik]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[python 2.7]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[RouterOS]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sqlite3]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[traffic]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">http://www.urosvovk.com/?p=858</guid>

					<description><![CDATA[I created a simple python script for collecting data from mikrotik accounting (documetation) feature. Here is my &#8220;mik_collector.py&#8221; script: all you need to change is router_ip variable to match your router IP after that you can run this script simply with this command: python mik_collector.py this will collect data from mikrotik every 5 seconds and store &#8230; <a href="https://www.urosvovk.com/bandwidth-usage-report-per-ip-address/" class="more-link">Continue reading <span class="screen-reader-text">Bandwidth usage report per IP address</span></a>]]></description>
										<content:encoded><![CDATA[<p>I created a simple python script for collecting data from mikrotik accounting (<a href="https://wiki.mikrotik.com/wiki/Manual:IP/Accounting" target="_blank" rel="noopener">documetation</a>) feature.</p>
<p>Here is my &#8220;mik_collector.py&#8221; script:<br />
<script src="//pastebin.com/embed_js/xCYZ9Cf8"></script></p>
<p>all you need to change is <em><strong>router_ip</strong></em> variable to match your router IP</p>
<p>after that you can run this script simply with this command:</p>
<pre>python mik_collector.py</pre>
<p>this will collect data from mikrotik every 5 seconds and store it in data.db sqlite3 database in the same directory as the script is.</p>
<p>All you need to do at mikrotik side is to enable accounting feature:</p>
<p><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-861" src="http://www.urosvovk.com/wp-content/uploads/2018/06/mik_acc_1.png" alt="" width="395" height="314" srcset="https://www.urosvovk.com/wp-content/uploads/2018/06/mik_acc_1.png 395w, https://www.urosvovk.com/wp-content/uploads/2018/06/mik_acc_1-300x238.png 300w" sizes="(max-width: 395px) 100vw, 395px" /> <img decoding="async" class="aligncenter size-full wp-image-862" src="http://www.urosvovk.com/wp-content/uploads/2018/06/mik_acc_2.png" alt="" width="303" height="185" srcset="https://www.urosvovk.com/wp-content/uploads/2018/06/mik_acc_2.png 303w, https://www.urosvovk.com/wp-content/uploads/2018/06/mik_acc_2-300x183.png 300w" sizes="(max-width: 303px) 100vw, 303px" /> <img decoding="async" class="aligncenter size-full wp-image-863" src="http://www.urosvovk.com/wp-content/uploads/2018/06/mik_acc_3.png" alt="" width="272" height="136" /></p>
<p>If you want to analyze your collected data you can do it with sqlite3 command from Ubuntu command prompt:</p>
<pre>sqlite3 data.db "select * from sum_per_month order by month"</pre>
<p>like this:</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-864" src="http://www.urosvovk.com/wp-content/uploads/2018/06/mik_acc_4.png" alt="" width="704" height="420" srcset="https://www.urosvovk.com/wp-content/uploads/2018/06/mik_acc_4.png 704w, https://www.urosvovk.com/wp-content/uploads/2018/06/mik_acc_4-300x179.png 300w" sizes="auto, (max-width: 704px) 100vw, 704px" /></p>
<p>you can write your own queries, all data is stored in a table named accounting. You can share your query in the comments :)</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.urosvovk.com/bandwidth-usage-report-per-ip-address/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
	</channel>
</rss>
