<?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>qualquercoisa</title>
	<atom:link href="https://qualquercoisa.eu/feed/" rel="self" type="application/rss+xml" />
	<link>https://qualquercoisa.eu/</link>
	<description>in English it translates to something</description>
	<lastBuildDate>Wed, 18 Sep 2024 23:03:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
	<item>
		<title>Static IP Address in Raspberry Pi</title>
		<link>https://qualquercoisa.eu/2024/09/06/static-ip-address-in-raspberry-pi/</link>
		
		<dc:creator><![CDATA[gerapam]]></dc:creator>
		<pubDate>Fri, 06 Sep 2024 13:20:43 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[SSH]]></category>
		<guid isPermaLink="false">https://qualquercoisa.eu/?p=77</guid>

					<description><![CDATA[Hot to setup an static IP address in you Raspberry Pi. Until Raspberry Pi OS version 11 (bullseye) we could setup a static IP Address by editing the file &#8220;dhcpcd.conf&#8221;. In current versions this is not possible anymore. I will explain in this post how you can configure your static IP Address in version 11 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p></p>



<h2 class="wp-block-heading">Hot to setup an static IP address in you Raspberry Pi.</h2>



<p>Until Raspberry Pi OS version 11 (bullseye) we could setup a static IP Address by editing the file &#8220;dhcpcd.conf&#8221;. In current versions this is not possible anymore.</p>



<p>I will explain in this post how you can configure your static IP Address in version 11 (bullseye) and version 12 (bookworm) of Raspberry Pi OS.</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide"/>



<h2 class="wp-block-heading">Raspberry Pi OS Version 11 (bullseye)</h2>



<p></p>



<p>To setup your Static IP Address in this version, you will need to edit the file dhcpcd.conf.</p>



<p>Before we edit the file we need to check our network interface name, we should also have an IP Address in mind and our gateway.</p>



<p>To check our interface name use this command, this will show you all your network interfaces available, it will include virtual interfaces like Docker containers for example.</p>



<pre class="wp-block-code"><code>ip a</code></pre>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="839" height="308" src="https://qualquercoisa.eu/wp-content/uploads/2024/09/staticip001.png" alt="" class="wp-image-150" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/09/staticip001.png 839w, https://qualquercoisa.eu/wp-content/uploads/2024/09/staticip001-300x110.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/09/staticip001-768x282.png 768w" sizes="(max-width: 839px) 100vw, 839px" /></figure>



<p>In my case, I will chose my ethernet port which is &#8220;eth0&#8221;.</p>



<p>To configure this in our file we will need to use the following command</p>



<pre class="wp-block-code"><code>sudo nano /etc/dhcpcd.conf</code></pre>



<p>The file will open in edit mode and you need to scrool until the end of the file and insert the following lines</p>



<pre class="wp-block-code"><code>interface eth0
static ip_address=192.168.1.2/24
static routers=192.168.1.1</code></pre>



<p>In my example i choose the ip &#8220;192.168.1.2&#8221; for my Raspberry Pi ethernet port, the 192.168.1.1 is my router IP Address.</p>



<p>After setting this up, you can also set it up for your wireless interface, you can close the editor and save the file by inserting the following commands</p>



<pre class="wp-block-code"><code>ctrl + x (close nano)
Y (confirm and save the modifications)
Enter</code></pre>



<p>Now your Raspberry should have a Static IP Address.</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide"/>



<h2 class="wp-block-heading">Raspberry Pi OS version 12 (bookworm)</h2>



<p></p>



<p>To setup your Static IP Address in this version you will need to start the NMTUI (Network Manager TUI)</p>



<p>To launch the NMTUI app inset the following comand</p>



<pre class="wp-block-code"><code>sudo nmtui</code></pre>


<div class="wp-block-image is-style-default">
<figure class="aligncenter size-full"><img decoding="async" width="321" height="324" src="https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui001.png" alt="" class="wp-image-152" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui001.png 321w, https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui001-297x300.png 297w, https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui001-150x150.png 150w" sizes="(max-width: 321px) 100vw, 321px" /></figure></div>


<p>Now you will navigate this tool using the arrow keys on your keyboard. Enter in the &#8220;Edit a connection&#8221;</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="438" height="338" src="https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui002.png" alt="" class="wp-image-153" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui002.png 438w, https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui002-300x232.png 300w" sizes="(max-width: 438px) 100vw, 438px" /></figure></div>


<p>Inside your connections menu you can choose the interface to change. In my case I will use the &#8220;Wired connection 1&#8221; which is my ethernet port.</p>



<p>Inside the Edit Connection of my wired connection 1 interface you will find a dashboard similar to the one below.</p>



<p>In this you will change the &#8220;IPv4 CONFIGURATION&#8221; from &#8220;Automatic&#8221; to &#8220;Manual&#8221;, then you will insert your Static IP Address, Gateway and if you have or want, your DNS Server.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="624" height="372" src="https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui004.png" alt="" class="wp-image-156" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui004.png 624w, https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui004-300x179.png 300w" sizes="(max-width: 624px) 100vw, 624px" /></figure></div>


<p>After setting this up you can scrool all the way down and confirm with the &#8220;OK&#8221; button. Please remenber that all of this is navigated with the arrow keys.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="573" height="378" src="https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui005.png" alt="" class="wp-image-157" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui005.png 573w, https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui005-300x198.png 300w" sizes="(max-width: 573px) 100vw, 573px" /></figure></div>


<p>Now you are back at the Connections menu, you can select &#8220;Back&#8221; to return to ~the main menu.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="573" height="344" src="https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui006.png" alt="" class="wp-image-158" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui006.png 573w, https://qualquercoisa.eu/wp-content/uploads/2024/09/nmtui006-300x180.png 300w" sizes="(max-width: 573px) 100vw, 573px" /></figure></div>


<p>Now you can exit NMTUI. You may be asked to reboot your Raspberry Pi.</p>



<p></p>



<p></p>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Monitoring on Raspberry Pi with Node Exporter, Prometheus, and Grafana with Docker &#8211; Part 3/3</title>
		<link>https://qualquercoisa.eu/2024/08/05/monitoring-on-raspberry-pi-with-node-exporter-prometheus-and-grafana-with-docker-part-3-3/</link>
		
		<dc:creator><![CDATA[gerapam]]></dc:creator>
		<pubDate>Mon, 05 Aug 2024 14:46:18 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[Grafana]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Node Exporter]]></category>
		<category><![CDATA[Prometheus]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<guid isPermaLink="false">https://qualquercoisa.eu/?p=117</guid>

					<description><![CDATA[In this post I will show you how to configure Grafana and add your new server configured in the previouse post, to start monitoring them. Steps to Deploy your new server in your Grafana instance. Data Source To add a new server to your Grafana dashboard, I will assume you did everything I explain in [&#8230;]]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" width="1024" height="512" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana-logo-1024x512.png" alt="" class="wp-image-146" style="width:538px;height:auto" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana-logo-1024x512.png 1024w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana-logo-300x150.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana-logo-768x384.png 768w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana-logo.png 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>


<p>In this post I will show you how to configure Grafana and add your new server configured in the previouse post, to start monitoring them.</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide"/>



<h2 class="wp-block-heading">Steps to Deploy your new server in your Grafana instance.</h2>



<h2 class="wp-block-heading">Data Source</h2>



<p>To add a new server to your Grafana dashboard, I will assume you did everything I explain in the 2 previouse post.</p>



<p>No inside Grafana you should go to &#8220;Menu &gt; Connections &gt; Data sources&#8221;, in your system you should have your first server, where Grafana is installed. In the image below you can see I already have some Prometheus instances runing in my Grafana.</p>



<p>Now let&#8217;s add your new server.</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="494" data-id="120" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana001-1024x494.png" alt="" class="wp-image-120" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana001-1024x494.png 1024w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana001-300x145.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana001-768x370.png 768w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana001-1536x741.png 1536w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana001.png 1912w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</figure>



<p>Click in the top right corner blue button &#8220;Add new data source&#8221;, a list like the one below will show up. In here you can select your data source, were your data comes from. In this example we will select the first option, &#8220;Prometheus&#8221;</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="575" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana002-1024x575.png" alt="" class="wp-image-121" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana002-1024x575.png 1024w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana002-300x168.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana002-768x431.png 768w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana002-1536x862.png 1536w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana002.png 1541w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Now you can give your new data source it&#8217;s name, I use the name of my server. You will also enter your server IP Address folowed by the port number &#8216;9090&#8217;.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="554" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafsana003-1024x554.png" alt="" class="wp-image-123" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafsana003-1024x554.png 1024w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafsana003-300x162.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafsana003-768x415.png 768w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafsana003.png 1501w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>For the rest of this screen you don&#8217;t need to change anything, all you have to do is press &#8220;Save &amp; Test&#8221;</p>



<p>If everything goes according to plan, you should get a message &#8220;Sucessfully queired the Prometheus API.&#8221;.</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="370" data-id="125" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana004-1024x370.png" alt="" class="wp-image-125" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana004-1024x370.png 1024w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana004-300x108.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana004-768x277.png 768w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana004-1536x555.png 1536w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana004.png 1811w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</figure>



<p>Now you are connected with your new server, all is left to do, is to setup your new dashboard.</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide"/>



<h2 class="wp-block-heading">Dashboard</h2>



<p>For this you should go to your &#8220;Dashboards&#8221; menu and click &#8220;New&#8221;</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="324" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana005-1024x324.png" alt="" class="wp-image-127" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana005-1024x324.png 1024w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana005-300x95.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana005-768x243.png 768w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana005-1536x486.png 1536w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana005.png 1903w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>The usual panel for inserting a new dashboard will show up, and like before, we will &#8220;Import a dashboard&#8221;.</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="584" data-id="129" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana006-1024x584.png" alt="" class="wp-image-129" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana006-1024x584.png 1024w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana006-300x171.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana006-768x438.png 768w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana006.png 1199w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</figure>



<p>Now we will insert the Grafana dashboard ID that we want to use, like before, we will use the &#8220;1860&#8221; dashboard and press &#8220;Load&#8221;</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="750" height="745" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana007.png" alt="" class="wp-image-130" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana007.png 750w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana007-300x298.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana007-150x150.png 150w" sizes="(max-width: 750px) 100vw, 750px" /></figure>



<p>This will take us to the next menu, were we will give our dashboard a name and select our data source, previously created.</p>



<p>Note that the Unique identifier (UID) shows up with an error message, this is because we are already using this dashboard on another server, so we need to give it a diferent UID. In this case click &#8220;Change uid&#8221; and just add a number or a letter. This will hapean eveytime you add a new dashboard with the same ID. To finish, click &#8220;Import&#8221;.</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="834" height="773" data-id="133" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana009-1.png" alt="" class="wp-image-133" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana009-1.png 834w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana009-1-300x278.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana009-1-768x712.png 768w" sizes="(max-width: 834px) 100vw, 834px" /></figure>
</figure>



<p>After the you have imported, you will be taken to your new dashboard, like me you will get on top of the dashboard the &#8220;Datasource&#8221; as default and the &#8220;Host&#8221; as your Grafana server IP address.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="485" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana011-1024x485.png" alt="" class="wp-image-135" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana011-1024x485.png 1024w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana011-300x142.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana011-768x364.png 768w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana011-1536x728.png 1536w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana011.png 1591w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Now we need to configure our node in this new dashboard. For this use should click on the &#8220;Dashboard settings&#8221; button on top.</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="155" data-id="136" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana012-1024x155.png" alt="" class="wp-image-136" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana012-1024x155.png 1024w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana012-300x45.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana012-768x116.png 768w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana012-1536x232.png 1536w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana012.png 1566w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</figure>



<p>In this new menu, you have to goto &#8220;Variables&#8221;, edit the &#8220;node&#8221; settings.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="415" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana013-1024x415.png" alt="" class="wp-image-137" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana013-1024x415.png 1024w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana013-300x122.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana013-768x311.png 768w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana013.png 1106w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-6 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="984" height="464" data-id="138" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana014.png" alt="" class="wp-image-138" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana014.png 984w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana014-300x141.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana014-768x362.png 768w" sizes="(max-width: 984px) 100vw, 984px" /></figure>
</figure>



<p>By default this should come as &#8220;${datasource}&#8221;, you need to select your new data source, that we created at the begining of this post.</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="532" height="748" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana015.png" alt="" class="wp-image-139" style="width:838px;height:auto" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana015.png 532w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana015-213x300.png 213w" sizes="(max-width: 532px) 100vw, 532px" /></figure>



<p>We don&#8217;t need to change anything else in this menu, all we need to do new is to click &#8220;Run query&#8221; and then &#8220;Apply&#8221; the changes.</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-7 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="598" height="623" data-id="140" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana016.png" alt="" class="wp-image-140" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana016.png 598w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana016-288x300.png 288w" sizes="(max-width: 598px) 100vw, 598px" /></figure>
</figure>



<p>For the final step, we need to goto &#8220;&lt;&gt; JSON Model&#8221;, and in the line 68, we need to change the &#8220;uid&#8221; from &#8220;000000001&#8221; to &#8220;000000002&#8221;</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1173" height="705" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/Grafana017.png" alt="" class="wp-image-142" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/Grafana017.png 1173w, https://qualquercoisa.eu/wp-content/uploads/2024/08/Grafana017-300x180.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/08/Grafana017-1024x615.png 1024w, https://qualquercoisa.eu/wp-content/uploads/2024/08/Grafana017-768x462.png 768w" sizes="(max-width: 1173px) 100vw, 1173px" /></figure>



<p>After this change is done all we have to do is to Save our new settings for our new dashboard.</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-8 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="152" data-id="143" src="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana018-1024x152.png" alt="" class="wp-image-143" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana018-1024x152.png 1024w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana018-300x44.png 300w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana018-768x114.png 768w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana018-1536x227.png 1536w, https://qualquercoisa.eu/wp-content/uploads/2024/08/grafana018.png 1594w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SSH Welcome Screem</title>
		<link>https://qualquercoisa.eu/2024/07/31/test-post/</link>
		
		<dc:creator><![CDATA[gerapam]]></dc:creator>
		<pubDate>Wed, 31 Jul 2024 13:23:16 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>
		<guid isPermaLink="false">https://qualquercoisa.eu/?p=47</guid>

					<description><![CDATA[This post is a full copy from Habilya website https://habilisbest.com/ssh-welcome-screen, in the post there is still one working link for his GitHub page where you will find the script with the art work and layout for this project. Habilya is still active in GitHub. This website as been deactivated and the only place were I [&#8230;]]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="637" height="778" src="https://qualquercoisa.eu/wp-content/uploads/2024/07/2024-07-31_14h59_51.png" alt="" class="wp-image-62" style="width:431px;height:auto" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/07/2024-07-31_14h59_51.png 637w, https://qualquercoisa.eu/wp-content/uploads/2024/07/2024-07-31_14h59_51-246x300.png 246w" sizes="(max-width: 637px) 100vw, 637px" /></figure></div>


<p>This post is a full copy from Habilya website <a href="https://habilisbest.com/ssh-welcome-screen"><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">https://habilisbest.com/ssh-welcome-screen</mark></a>, in the post there is still one working link for his GitHub page where you will find the script with the art work and layout for this project. Habilya is still active in GitHub.</p>



<p>This website as been deactivated and the only place were I could find this was in the Internet Archives <a href="https://web.archive.org/web/20221007200247mp_/https://habilisbest.com/ssh-welcome-screen"><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">https://web.archive.org/web/20221007200247mp_/https://habilisbest.com/ssh-welcome-screen</mark></a></p>



<hr class="wp-block-separator aligncenter has-alpha-channel-opacity is-style-wide"/>



<h2 class="wp-block-heading" id="custom-ssh-welcome-screen">Custom SSH welcome screen</h2>



<p>This screen is what the server administrator ever needs on one page. A custom ASCII art of Montreal, my favorite city. CPU temperature, Load Average, Memory and Disk usage, Available system updates, to name a few&#8230;</p>



<p>Before you start, this script requires&nbsp;<strong>bc</strong>&nbsp;to perform some calculations, if you don&#8217;t already have it, install it:</p>



<pre class="wp-block-code"><code><code>sudo apt install bc</code></code></pre>



<p>Let&#8217;s start with the System updates, to do that we need to write a simple script to be executed as root.</p>



<p>If you don&#8217;t have the scripts directory created, create it and a root directory, for all the scripts to be executed by root user.</p>



<pre class="wp-block-code"><code><code>sudo mkdir -p /var/zzscriptzz/root/</code></code></pre>



<p>Create update_checker.sh bash script.</p>



<pre class="wp-block-code"><code><code>sudo nano /var/zzscriptzz/root/update_checker.sh</code></code></pre>



<p>Paste this inside the file, save and exit (CTRL+X, Y).</p>



<pre class="wp-block-code"><code>#!/bin/bash

apt-get update
apt-get upgrade -d -y | grep 'upgraded,' | awk {'print $1'} > /var/zzscriptzz/MOTD/updates-available.dat
echo "Update Check Complete"
</code></pre>



<p>This is a script that you are going to automate with cron, it writes the number of new updates available for your operating system in this file:</p>



<p><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-green-cyan-color">/var/zzscriptzz/MOTD/updates-available.dat</mark></p>



<p>Now, make this script executable.</p>



<pre class="wp-block-code"><code><code>sudo chmod +x /var/zzscriptzz/root/update_checker.sh</code></code></pre>



<p>Then, configure this script to be executed by cron every 3 hours.</p>



<pre class="wp-block-code"><code><code>sudo crontab -e</code></code></pre>



<p>add this line at the bottom, save and exit.</p>



<pre class="wp-block-code"><code>0 */3 * * * /var/zzscriptzz/root/update_checker.sh > /dev/null 2>&amp;1</code></pre>



<p>This will run the script automatically every 3 hours, so the available system updates will be checked and logged to be displayed on your welcome screen.</p>



<h2 class="wp-block-heading" id="the-message-of-the-day-itself">The Message of the day itself</h2>



<p>Create a directory to store the MOTD / Welcome Screen script itself. This script will be executed as a normal user, your user.</p>



<pre class="wp-block-code"><code><code>sudo mkdir /var/zzscriptzz/MOTD</code></code></pre>



<p>Change the owner of the directory to your user, you are using to SSH into your machine.</p>



<pre class="wp-block-code"><code><code>sudo chown -R &#91;YOUR_USER]:&#91;YOUR_USER] /var/zzscriptzz/MOTD</code></code></pre>



<p>Create the script</p>



<pre class="wp-block-code"><code>sudo nano /var/zzscriptzz/MOTD/MOTD.sh</code></pre>



<p>paste this:</p>



<p>script is in my GitHub repository (MOTD.sh).</p>



<pre class="wp-block-code"><code><a href="https://github.com/Habilya/SSH-Welcome-screen"><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">https://github.com/Habilya/SSH-Welcome-screen</mark></a></code></pre>



<p><em>Please contribute if you like <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></em></p>



<p>Now, save, exit and make this script executable.</p>



<pre class="wp-block-code"><code><code>sudo chmod +x /var/zzscriptzz/MOTD/MOTD.sh</code></code></pre>



<h2 class="wp-block-heading" id="applying-the-custom-welcome-message">Applying the custom welcome message</h2>



<p>Those commands easier to be executed as root user, so:</p>



<pre class="wp-block-code"><code>sudo su

echo '' > /etc/motd

nano /etc/ssh/sshd_config</code></pre>



<p>Change values of following the values displayed below.</p>



<pre class="wp-block-code"><code>PrintLastLog no
PrintMotd no
</code></pre>



<p>Now, let&#8217;s restart SSH service.</p>



<pre class="wp-block-code"><code><code>/etc/init.d/ssh restart</code></code></pre>



<p>Now, edit this file:</p>



<pre class="wp-block-code"><code><code>nano /etc/pam.d/login</code></code></pre>



<p>And comment this line</p>



<pre class="wp-block-code"><code><em>#session optional pam_motd.so</em></code></pre>



<p>Edit this file as well:</p>



<pre class="wp-block-code"><code><code>nano /etc/profile</code></code></pre>



<p>Add this at the end of the file:</p>



<pre class="wp-block-code"><code><code>/var/zzscriptzz/MOTD/MOTD.sh</code></code></pre>



<p>save CTRL+X Y. Exit from root.</p>



<pre class="wp-block-code"><code><code>exit</code></code></pre>



<p>Run the update checker for the first time</p>



<pre class="wp-block-code"><code>sudo /var/zzscriptzz/root/update_checker.sh</code></pre>



<p>If you&#8217;ve done everything correctly, on every login via SSH, you should enjoy your custom, informative welcome screen.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Monitoring on Raspberry Pi with Node Exporter, Prometheus, and Grafana with Docker &#8211; Part 2/3</title>
		<link>https://qualquercoisa.eu/2024/07/31/monitoring-on-raspberry-pi-with-node-exporter-prometheus-and-grafana-2/</link>
		
		<dc:creator><![CDATA[gerapam]]></dc:creator>
		<pubDate>Wed, 31 Jul 2024 13:07:04 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Node Exporter]]></category>
		<category><![CDATA[Prometheus]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<guid isPermaLink="false">https://qualquercoisa.eu/?p=41</guid>

					<description><![CDATA[This post is a partial copy of the post from&#160;Nishanth Nagendra&#160;in the site&#160;https://easycode.page/monitoring-on-raspberry-pi-with-node-exporter-prometheus-and-grafana/ In this post I made some small changes to the original one, and these were the setting and configuration I used in my network. In this post I will show you hot I implemented Node Exporter and Prometheus in my network to [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-gallery aligncenter has-nested-images columns-default is-cropped wp-block-gallery-9 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="407" height="168" data-id="54" src="https://qualquercoisa.eu/wp-content/uploads/2024/07/2024-07-31_14h40_23.png" alt="" class="wp-image-54" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/07/2024-07-31_14h40_23.png 407w, https://qualquercoisa.eu/wp-content/uploads/2024/07/2024-07-31_14h40_23-300x124.png 300w" sizes="(max-width: 407px) 100vw, 407px" /></figure>
</figure>



<p>This post is a partial copy of the post from&nbsp;<a href="https://easycode.page/author/nishanth/"><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">Nishanth Nagendra</mark></a>&nbsp;in the site&nbsp;<a href="https://easycode.page/monitoring-on-raspberry-pi-with-node-exporter-prometheus-and-grafana/"><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">https://easycode.page/monitoring-on-raspberry-pi-with-node-exporter-prometheus-and-grafana/</mark></a></p>



<p>In this post I made some small changes to the original one, and these were the setting and configuration I used in my network.</p>



<p>In this post I will show you hot I implemented Node Exporter and Prometheus in my network to monitor my servers from one single Grafana instance.</p>



<hr class="wp-block-separator aligncenter has-alpha-channel-opacity is-style-wide"/>



<h3 class="wp-block-heading">Steps to Deploy Node Exporter on Docker</h3>



<p>1. Setup folders to maintain the container data</p>



<pre class="wp-block-code"><code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Create a directory for the project and each component
</mark>mkdir -p monitoring/node-exporter
mkdir -p monitoring/prometheus</code></pre>



<p>2. Navigate to the node-exporter folder and run the container using the docker command as shown</p>



<pre class="wp-block-code"><code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Navigate to the node-exporter directory
</mark>cd monitoring/node-exporter
<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Run the node-exporter docker container
</mark>sudo docker run -d \
--name="node-exporter" \
--net="host" \
--pid="host" \
-v "/:/host:ro,rslave" \
--restart=always \
quay.io/prometheus/node-exporter:latest --path.rootfs=/host
<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Node exporter is installed on 9100 port by default</mark></code></pre>



<p>3. Verify node exporter is working by browsing to http://&lt;IP&gt;:9100/ where&nbsp;<strong>“IP”</strong>&nbsp;is the IP address of the Pi/Machine on which the docker container is deployed</p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-8.35.36-PM.png?resize=950%2C155&amp;ssl=1" alt="Monitoring" class="wp-image-452"/></figure>



<p>4. Click on the&nbsp;<strong>“Metrics”</strong>&nbsp;to view all the collected metrics as shown</p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-8.43.26-PM.png?resize=950%2C594&amp;ssl=1" alt="Monitoring" class="wp-image-453"/></figure>



<p>Congratulations!! You’ve successfully deployed Node Exporter on Docker</p>



<hr class="wp-block-separator aligncenter has-alpha-channel-opacity is-style-wide"/>



<h3 class="wp-block-heading">Steps to Deploy Prometheus on Docker</h3>



<p>1.&nbsp;Navigate to the Prometheus folder created previously and create a YAML configuration file for Prometheus</p>



<pre class="wp-block-code"><code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Navigate to the prometheus directory
</mark>cd monitoring/prometheus
<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Create a file called prometheus.yml
</mark>touch prometheus.yml</code></pre>



<p>2. Create the Prometheus YAML configuration file as shown</p>



<pre class="wp-block-code"><code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Edit the file using a file editor (nano is this case)
</mark>sudo nano prometheus.yml
<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Add the below content to the file
</mark>global:
  scrape_interval: 5s
  external_labels:
    monitor: 'node'
scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: &#91;'192.168.0.128:9090'] <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">## IP Address of the localhost</mark>
  - job_name: 'node-exporter'
    static_configs:
      - targets: &#91;'192.168.0.128:9100'] <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">## IP Address of the localhost</mark>
<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># The Port with the prometheus job will be the port on which prometheus will be deployed (9090 in this case)
# The Port with the node-exporter job will be the port on which node-exporter is deployed (9100 in this case)
# Here a sample IP address has been used (192.168.0.128). Replace this with the IP of your Pi/Machine</mark></code></pre>



<p>3. Run the Prometheus docker container</p>



<pre class="wp-block-code"><code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># -d specifies the container to run in detached state
# --name specifies the name of the container
# -p specifies the port mapping where the left side indicates the host and the right side indicates to container
# -v specifies the volume mount and this must point to the location of the prometheus.yml file created in the previous step
# --restart always ensures the container restarts if it goes down due to any circumstances</mark>
sudo docker run -d \
--name prometheus \
-p 9090:9090 \
-v /home/pi/monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \
--restart always \
prom/prometheus</code></pre>



<p>4. Verify Prometheus is working by browsing to http://&lt;IP&gt;:9090/ where&nbsp;<strong>“IP”</strong>&nbsp;is the IP address of the Pi/Machine on which the docker container is deployed</p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.05.17-PM-1.png?resize=950%2C297&amp;ssl=1" alt="Monitoring" class="wp-image-457"/></figure>



<p>5. Navigate to the&nbsp;<strong>Targets</strong>&nbsp;section to verify node-exporter and Prometheus is up</p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.08.06-PM.png?resize=950%2C294&amp;ssl=1" alt="Monitoring" class="wp-image-458"/></figure>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.09.56-PM.png?resize=950%2C332&amp;ssl=1" alt="Monitoring" class="wp-image-459"/></figure>



<p>Congratulations!! You’ve successfully deployed Prometheus on Docker</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Monitoring on Raspberry Pi with Node Exporter, Prometheus, and Grafana with Docker &#8211; Part 1/3</title>
		<link>https://qualquercoisa.eu/2024/07/31/monitoring-on-raspberry-pi-with-node-exporter-prometheus-and-grafana/</link>
		
		<dc:creator><![CDATA[gerapam]]></dc:creator>
		<pubDate>Wed, 31 Jul 2024 12:52:09 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[Grafana]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Node Exporter]]></category>
		<category><![CDATA[Prometheus]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<guid isPermaLink="false">https://qualquercoisa.eu/?p=30</guid>

					<description><![CDATA[This post is a partial copy of the post from Nishanth Nagendra in the site https://easycode.page/monitoring-on-raspberry-pi-with-node-exporter-prometheus-and-grafana/ In this post I made some small changes to the original one, and these were the setting and configuration I used in my network. I will not explain what is a Raspberry Pi, Grafana, Prometheus or Node Exporter, because [&#8230;]]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="592" height="199" src="https://qualquercoisa.eu/wp-content/uploads/2024/07/Docker-Prometheus-Grafana-1.webp" alt="" class="wp-image-50" srcset="https://qualquercoisa.eu/wp-content/uploads/2024/07/Docker-Prometheus-Grafana-1.webp 592w, https://qualquercoisa.eu/wp-content/uploads/2024/07/Docker-Prometheus-Grafana-1-300x101.webp 300w" sizes="(max-width: 592px) 100vw, 592px" /></figure></div>


<p>This post is a partial copy of the post from <a href="https://easycode.page/author/nishanth/"><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">Nishanth Nagendra</mark></a> in the site <a href="https://easycode.page/monitoring-on-raspberry-pi-with-node-exporter-prometheus-and-grafana/"><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">https://easycode.page/monitoring-on-raspberry-pi-with-node-exporter-prometheus-and-grafana/</mark></a></p>



<p>In this post I made some small changes to the original one, and these were the setting and configuration I used in my network.</p>



<p>I will not explain what is a Raspberry Pi, Grafana, Prometheus or Node Exporter, because if you are here, it means that you are looking for this information.</p>



<hr class="wp-block-separator aligncenter has-alpha-channel-opacity is-style-wide"/>



<h3 class="wp-block-heading">Steps to Deploy Node Exporter on Docker</h3>



<p>1. Setup folders to maintain the container data</p>



<pre class="wp-block-code"><code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Create a directory for the project and each component</mark>
mkdir -p monitoring/node-exporter
mkdir -p monitoring/prometheus
mkdir -p monitoring/grafana</code></pre>



<p>2. Navigate to the node-exporter folder and run the container using the docker command as shown</p>



<pre class="wp-block-code"><code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Navigate to the node-exporter directory
</mark>cd monitoring/node-exporter
<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Run the node-exporter docker container
</mark>sudo docker run -d \
--name="node-exporter" \
--net="host" \
--pid="host" \
-v "/:/host:ro,rslave" \
--restart=always \
quay.io/prometheus/node-exporter:latest --path.rootfs=/host
<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Node exporter is installed on 9100 port by default</mark></code></pre>



<p>3. Verify node exporter is working by browsing to http://&lt;IP&gt;:9100/ where&nbsp;<strong>“IP”</strong>&nbsp;is the IP address of the Pi/Machine on which the docker container is deployed</p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-8.35.36-PM.png?resize=950%2C155&amp;ssl=1" alt="Monitoring" class="wp-image-452"/></figure>



<p>4. Click on the&nbsp;<strong>“Metrics”</strong>&nbsp;to view all the collected metrics as shown</p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-8.43.26-PM.png?resize=950%2C594&amp;ssl=1" alt="Monitoring" class="wp-image-453"/></figure>



<p>Congratulations!! You’ve successfully deployed Node Exporter on Docker</p>



<hr class="wp-block-separator aligncenter has-alpha-channel-opacity is-style-wide"/>



<h3 class="wp-block-heading">Steps to Deploy Prometheus on Docker</h3>



<p>1.&nbsp;Navigate to the Prometheus folder created previously and create a YAML configuration file for Prometheus</p>



<pre class="wp-block-code"><code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Navigate to the prometheus directory
</mark>cd monitoring/prometheus
<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Create a file called prometheus.yml
</mark>touch prometheus.yml</code></pre>



<p>2. Create the Prometheus YAML configuration file as shown</p>



<pre class="wp-block-code"><code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Edit the file using a file editor (nano is this case)
</mark>sudo nano prometheus.yml
<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Add the below content to the file
</mark>global:
  scrape_interval: 5s
  external_labels:
    monitor: 'node'
scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: &#91;'192.168.0.128:9090'] <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">## IP Address of the localhost</mark>
  - job_name: 'node-exporter'
    static_configs:
      - targets: &#91;'192.168.0.128:9100'] <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">## IP Address of the localhost</mark>
<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># The Port with the prometheus job will be the port on which prometheus will be deployed (9090 in this case)
# The Port with the node-exporter job will be the port on which node-exporter is deployed (9100 in this case)
# Here a sample IP address has been used (192.168.0.128). Replace this with the IP of your Pi/Machine</mark></code></pre>



<p>3. Run the Prometheus docker container</p>



<pre class="wp-block-code"><code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># -d specifies the container to run in detached state
# --name specifies the name of the container
# -p specifies the port mapping where the left side indicates the host and the right side indicates to container
# -v specifies the volume mount and this must point to the location of the prometheus.yml file created in the previous step
# --restart always ensures the container restarts if it goes down due to any circumstances</mark>
sudo docker run -d \
--name prometheus \
-p 9090:9090 \
-v /home/pi/monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \
--restart always \
prom/prometheus</code></pre>



<p>4. Verify Prometheus is working by browsing to http://&lt;IP&gt;:9090/ where&nbsp;<strong>“IP”</strong>&nbsp;is the IP address of the Pi/Machine on which the docker container is deployed</p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.05.17-PM-1.png?resize=950%2C297&amp;ssl=1" alt="Monitoring" class="wp-image-457"/></figure>



<p>5. Navigate to the&nbsp;<strong>Targets</strong>&nbsp;section to verify node-exporter and Prometheus is up</p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.08.06-PM.png?resize=950%2C294&amp;ssl=1" alt="Monitoring" class="wp-image-458"/></figure>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.09.56-PM.png?resize=950%2C332&amp;ssl=1" alt="Monitoring" class="wp-image-459"/></figure>



<p>Congratulations!! You’ve successfully deployed Prometheus on Docker</p>



<hr class="wp-block-separator aligncenter has-alpha-channel-opacity is-style-wide"/>



<h3 class="wp-block-heading">Steps to Deploy Grafana on Docker</h3>



<p>1. Navigate to the grafana folder created previously</p>



<pre class="wp-block-code"><code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># Navigate into the grafana folder
</mark>cd monitoring/grafana</code></pre>



<p>2. Run the Grafana docker container as shown</p>



<pre class="wp-block-code"><code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color"># -d specifies the container to run in detached state
# --name specifies the name of the container
# -p specifies the port mapping where the left side indicates the host and the right side indicates to container
# --restart always ensures the container restarts if it goes down due to any circumstances</mark>
sudo docker run -d \
--name=grafana \
-p 9003:3000 \
--restart=always \
grafana/grafana</code></pre>



<p>3. Verify grafana is deployed by browsing to http://&lt;ip&gt;:9003/ where IP is the IP of the Pi/Machine. The Port is the port that has been specified during the deployment of the docker container (9003 in this case). You should see the login screen as shown below</p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.16.03-PM-1.png?resize=950%2C594&amp;ssl=1" alt="Monitoring" class="wp-image-462"/></figure>



<p>4. Login to grafana using the following credentials:</p>



<p><strong>Username:</strong>&nbsp;admin</p>



<p><strong>Password:</strong>&nbsp;admin</p>



<p>You will be asked to change the password as shown</p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/New.png?resize=950%2C592&amp;ssl=1" alt="Monitoring" class="wp-image-463"/></figure>



<p>5. You should now be able to see the Grafana dashboard</p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.24.04-PM.png?resize=950%2C594&amp;ssl=1" alt="Monitoring" class="wp-image-464"/></figure>



<p>Congratulations!! You’ve successfully deployed Grafana on Docker</p>



<hr class="wp-block-separator aligncenter has-alpha-channel-opacity is-style-wide"/>



<h3 class="wp-block-heading">Steps to Configure a Data Source in Grafana</h3>



<p>1. Navigate to the Data Source Configuration as shown below</p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.26.49-PM.png?resize=950%2C1023&amp;ssl=1" alt="Monitoring" class="wp-image-466"/></figure>



<p>2. Click on&nbsp;<strong>“Add Data Source”</strong>&nbsp;and choose&nbsp;<strong>“Prometheus”</strong></p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.28.40-PM.png?resize=950%2C402&amp;ssl=1" alt="Monitoring" class="wp-image-467"/></figure>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.29.38-PM.png?resize=950%2C349&amp;ssl=1" alt="Monitoring" class="wp-image-468"/></figure>



<p>3. Configure the data source to the node-exporter url as setup previously and then click on&nbsp;<strong>“Save and Test”</strong></p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.30.50-PM.png?resize=950%2C316&amp;ssl=1" alt="Monitoring" class="wp-image-469"/></figure>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.32.02-PM.png?resize=950%2C594&amp;ssl=1" alt="Monitoring" class="wp-image-470"/></figure>



<p>4. Ensure the Data Source is working</p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.32.54-PM.png?resize=950%2C235&amp;ssl=1" alt="Monitoring" class="wp-image-471"/></figure>



<p>Congratulations!! You’ve successfully setup the data source for grafana</p>



<hr class="wp-block-separator aligncenter has-alpha-channel-opacity is-style-wide"/>



<h3 class="wp-block-heading">Steps to add a Dashboard on Grafana</h3>



<p>1. Search for a ready-made template dashboard here: <a href="https://grafana.com/grafana/dashboards/?orderBy=downloads&amp;direction=desc&amp;search=node+exporter" target="_blank" rel="noreferrer noopener"><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">https://grafana.com/grafana/dashboards/?orderBy=downloads&amp;direction=desc&amp;search=node+exporter</mark></a></p>



<p>2. Copy the ID of the dashboard. For this tutorial, we will be using this dashboard: <a href="https://grafana.com/grafana/dashboards/1860" target="_blank" rel="noreferrer noopener"><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">https://grafana.com/grafana/dashboards/1860</mark></a>. The ID of the dashboard is 1860 in this case</p>



<p>3. On the Grafana Home page click on the import option in the dashboard section</p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.57.17-PM.png?resize=950%2C754&amp;ssl=1" alt="Monitoring" class="wp-image-473"/></figure>



<p>4. Enter the ID of your selected dashboard and click on&nbsp;<strong>Load</strong></p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.57.32-PM.png?resize=950%2C723&amp;ssl=1" alt="Monitoring" class="wp-image-474"/></figure>



<p>5. Select the Prometheus installation and click on&nbsp;<strong>Import</strong></p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-9.59.44-PM.png?resize=950%2C801&amp;ssl=1" alt="Monitoring" class="wp-image-475"/></figure>



<p>6. Once it is imported, you will be able to see the dashboard populated with the metrics of your Pi</p>



<figure class="wp-block-image"><img decoding="async" src="https://i0.wp.com/easycode.page/wp-content/uploads/2021/10/Screenshot-2021-10-10-at-10.00.30-PM.png?resize=950%2C594&amp;ssl=1" alt="Monitoring" class="wp-image-476"/></figure>



<p>Congratulations!! You’ve successfully configured a Dashboard to view the metrics of your Raspberry Pi</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
