Update – January 2020

2 Months of Results

Traffic to

2 months ago I launched I decided to do it to fuel my motivation. Recently I have been working more personal tech projects. I figure the blog will help keep me motivated. If I know others are getting value, its an extra push for me when I am feeling lazy ๐Ÿ™‚

So far it seems to be working. I am surprised at the amount of traffic is getting. Almost 2K views in December and over 300 so far this month. The numbers are not earth shattering but in my experience really good for a new blog.

Raspberry Pi PXE boot tutorial a success

The December traffic is mostly due to a Reddit post I made for my Raspberry Pi PXE boot article. I posted to Raspberry Pi sub-reddit on whim. It felt like a high quality post, I figured others might like it. I guess I was right ๐Ÿ™‚ It is up to 1K up-votes on Reddit. And I got some Reddit silver as well. I estimate the post took 10 hours to create. 10 hours total between researching, writing, editing, testing and double testing the tutorial. Happy to see the time spent being enjoyed by others.

Reader engagement

When I first started blogging in the 90s, commenting was a big part of blogging. Authors had discussions with each other via their blogs using ping backs. Now it seems blogging is more a 1 way communication channel. Even with 2.5K total page views on the blog, the comment count from readers is still below 10.

I am happy that readers are commenting and asking questions. I try to answer then as quickly as I can. If you have any feedback or questions please feel free to comment on a post.

Topic Requests

If you have topic requests for future posts, please drop a comment with your idea. I can’t promise I will do every suggestion, but feedback is a big motivator.

broot – Navigate, Browse and Search Directory Trees

broot – A new CLI tool

I am always amazed when a new useful CLI tool like broot is released. Using Linux for well over 20 years, I expect everything useful to be built already. From time to time a new tool comes out and I wonder “How did I live with out this?” Some examples of CLI tools that have changed my life:

  • jq – command line JSON parser
  • pv – pipe viewer, a tool for monitoring pipeline progress
  • mosh – mobile shell
  • socat – multipurpose relay

I expect I will be adding broot to the list. Check out the website here.

What is broot?

A CLI tool written in rust. You use it to explore and find directories. “I made broot to both replace the classical fuzzy finders and the old tree.” – Denys Sรฉguret from his reddit post. So think of it as a combination of the tree and fzf commands.

The simplest use case is to launch it via the br shell function and start typing the name of a directory. It does a fuzzy find showing all matching files in the tree. From within to the tool you can do all sorts of things.

Once launched, you can navigate and drill down into directories. You can edit files or open them with command configured for the given file type.

Installing broot

The broot website has installation instructions for various platforms. There are binaries for the following platforms:

  • Windows 10+
  • Linux
  • Raspberry Pi (ARM) Linux

Simply download the binary and put into your $PATH. I installed it in /usr/local/bin.

If you are on OSX you can use Homebrew or MacPorts. Additionally if you have a rust development environment setup you can install the crate via cargo: cargo install broot.

The first time you run broot it will prompt you to install a shell function br. This is the intended way to run broot. Choosing “Yes” will install the shell function in .config/broot in your home directory. It supports a few different shells. I run bash. On my system the function was installed at ~/.config/broot/launcher/bash/br . Additionally my .bashrc was updated to source the function: source /home/ken/.config/broot/launcher/bash/br.

The br function is a wrapper around the broot command:

# This script was automatically generated by the broot program
# More information can be found in
# This function starts broot and executes the command
# it produces, if any.
# It's needed because some shell commands, like `cd`,
# have no useful effect if executed in a subshell.
function br {
        set +e
        broot --outcmd "$f" "$@"
        if [ "$code" != 0 ]; then
            rm -f "$f"
            exit "$code"
    if [ "$code" != 0 ]; then
        return "$code"
    rm -f "$f"
    eval "$d"

If you change the configuration and want to restore it to the original state use the broot --install command. Additionally you can print the shell function for a give shell using the --print-shell-function flag. For example br --print-shell-function bash.


Some of the interesting options are:

  • -d show last modified dates
  • -h show hidden files
  • -f only show directories
  • -p display permissions
  • -s show file an directory size

I like running all of these flags together: br -s -p -d -f.

Running “br -s -p -d -f” to display size, permissions, date and only directories.

You can manipulate/move files. Copying, removing files and editing files. For example, to do the equivalent of rm -rf on a directory, type space key and then rm.Make sure have set in your $EDITOR environment variable.

With the -g or --gitignore flag you can control if .gitignore files are honored.

One command within broot that I find useful is the print_path or pp command.

Wish List

  • Use broot like ls. For example, I want to run br -p -d to print a directory tree and immediately exit. Maybe I am missing something, but I have not found a way to do this.
  • Errors from verbs. For example, I get no feedback when the rm verb fails due to “permission denied”.

More from Linuxhit

Prometheus node exporter on Raspberry Pi – How to install

Introduction – Prometheus Node Exporter on Raspberry Pi

What does this tutorial cover?

In this post we are walking through configuring the Prometheus node exporter on a Raspberry Pi. When done, you will be able to export system metrics to Prometheus. Node exporter has over a thousand data points to export. It covers the basics like CPU and memory. But as you will see later, it also goes much further.

I am using Raspbian for this tutorial. However the instructions are generic enough to work on most Linux distributions that use systemd.

I will not cover how to setup Prometheus or complementing tools like Grafana. I am writing additional monitoring focused posts to cover these topics. Stay tuned!


  • Raspberry Pi running Raspbian Linux
  • Existing Prometheus server running on another system. It can be on a Pi or another type of system. Alternatively you could try a hosted Prometheus service.

If you want to learn more about Prometheus, I suggest the Prometheus Up & Running book from Oreilly.

About Prometheus and the Node Exporter

Prometheus Logo
Prometheus Logo

Prometheus is an open source metrics database and monitoring system. In a typical architecture the Prometheus server queries targets. This is called “scraping”. Scraping targets are HTTP endpoints on the systems being monitored. Targets publish metrics in the Prometheus metrics format.

Prometheus stores the data collected from endpoints. You can query Prometheus data store monitoring and visualization.

Many systems or stacks do not have Prometheus formatted. For example a Raspberry Pi running Raspbian does not have a Prometheus metrics endpoint. This is where the node exporter comes in. The node exporter is an agent. It exposes your host’s metrics in the format Prometheus expects.

Prometheus scrapes the node exporter and stores the data in its time series database. The data can now be queried directly in Prometheus via the API, UI or other monitoring tools like Grafana.

Raspberry Pi temperature graph in Prometheus. Data from Node Exporter.
Raspberry Pi temperature graph in Prometheus. Data from Node Exporter.

Node Exporter Setup on Raspberry Pi running Raspbian

Ok, lets dive into the actual setup of the node exporter. You might notice that I am not installing the node importer via a package management tool like “apt”.

This is intentional. The node exporter is updated frequently. As a result packages contained in a package repo often lag releases. Therefor I prefer to install the latest release from the node exporter Github page.

Step 1 Download Node Exporter to Your Pi

In this step we are simply downloading a release of the node exporter. Releases are published on projects releases page on Github. The node exporter release binaries are architecture specific. This means you need to download the ArmV7 build for Raspberry Pi 4. If you are on a Raspberry Pi 3 you will need the ArmV6 build.

Use the ARMv6 and ARMv7 builds for your respective platform.

Log into your Raspberry Pi and run the following wget command to download node exporter for the ArmV7 architecture.


Now un-tar the release using this command.

tar -xvzf node_exporter-0.18.1.linux-armv7.tar.gz

This will un-tar the files into a sub-directory that looks like this.


Step 2 – Install node_exporter binary and create required directories

The only file we need out of the expanded tarball is the node_exporter binary. Copy that file to /usr/local/bin.

sudo cp node_exporter-0.18.1.linux-armv6/node_exporter /usr/local/bin

Use the chmod command to make the node_exporter binary executable.

chmod +x /usr/local/bin/node_exporter

Create a service account for the node_exporter.

sudo useradd -m -s /bin/bash node_exporter

Make a directly in /var/lib/ that will be used by the node_exporter. Change the ownership to the service account we just created.

sudo mkdir /var/lib/node_exporter
chown -R node_exporter:node_exporter /var/lib/node_exporter

You have completed the node_exporter binary installation and setup of required directories!

Step 3 – Setup systemd unit file

Next step, setting up the unit file. The unit file will allow us to control the service via the systemctl command. Additionally it will ensure node_exporter starts on boot.

Create a file called node_exporter.service in the /etc/sytemd/system directory. The full path to the file should be:


Put the following contents into the file:

Description=Node Exporter

# Provide a text file location for data with the
# parameter.
ExecStart=/usr/local/bin/node_exporter /var/lib/node_exporter/textfile_collector


I also have the unit file posted on this github gist.

Now lets reload systemd, enable and start the service.

sudo systemctl daemon-reload 
sudo systemctl enable node_exporter.service
sudo systemctl start node_exporter.service

Congratulations the node_exporter service should be running now. You can use the systemctl status node_exporter command to verify.

The output should look like this:

sudo systemctl status node_exporter.service
โ— node_exporter.service - Node Exporter
   Loaded: loaded (/etc/systemd/system/node_exporter.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-01-16 18:53:28 GMT; 21s ago
 Main PID: 1740 (node_exporter)
    Tasks: 5 (limit: 4915)
   Memory: 1.2M
   CGroup: /system.slice/node_exporter.service
           โ””โ”€1740 /usr/local/bin/node_exporter /var/lib/node_exporter/textfile_collector
Jan 16 18:53:28 raspberrypi node_exporter[1740]: time="2020-01-16T18:53:28Z" level=info msg=" - sockstat" source="node_exporter.go:104"
Jan 16 18:53:28 raspberrypi node_exporter[1740]: time="2020-01-16T18:53:28Z" level=info msg=" - stat" source="node_exporter.go:104"
Jan 16 18:53:28 raspberrypi node_exporter[1740]: time="2020-01-16T18:53:28Z" level=info msg=" - textfile" source="node_exporter.go:104"
Jan 16 18:53:28 raspberrypi node_exporter[1740]: time="2020-01-16T18:53:28Z" level=info msg=" - time" source="node_exporter.go:104"
Jan 16 18:53:28 raspberrypi node_exporter[1740]: time="2020-01-16T18:53:28Z" level=info msg=" - timex" source="node_exporter.go:104"
Jan 16 18:53:28 raspberrypi node_exporter[1740]: time="2020-01-16T18:53:28Z" level=info msg=" - uname" source="node_exporter.go:104"
Jan 16 18:53:28 raspberrypi node_exporter[1740]: time="2020-01-16T18:53:28Z" level=info msg=" - vmstat" source="node_exporter.go:104"
Jan 16 18:53:28 raspberrypi node_exporter[1740]: time="2020-01-16T18:53:28Z" level=info msg=" - xfs" source="node_exporter.go:104"
Jan 16 18:53:28 raspberrypi node_exporter[1740]: time="2020-01-16T18:53:28Z" level=info msg=" - zfs" source="node_exporter.go:104"
Jan 16 18:53:28 raspberrypi node_exporter[1740]: time="2020-01-16T18:53:28Z" level=info msg="Listening on :9100" source="node_exporter.go:1

Listening on :9100” is the key piece of information. It tells us that node_exporter web server is up on port 9100. Try using wget or curl to query the node_exporter.

curl http://localhost:9100/metrics

The output should look similar to this. Additionally I have an example of my Raspberry Pi’s output on this github gist.

Output of curling the metrics endpoint.

Next steps

Now you should add the metrics endpoint as a target to your Prometheus server. You can do this by editing the prometheus configuration file on your prometheus server. For reference mine looks like this.

# my global config
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
  - static_configs:
    - targets:
      # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    - targets: ['localhost:9090']

  - job_name: 'pi1'
    scrape_interval: 5s
    - targets: ['']

This is the standard prometheus config file. However I added the following target at the end for my Raspberry Pi:

- job_name: 'pi1'
    scrape_interval: 5s
    - targets: ['']

The IP address of my Raspberry Pi is The Port 9100 corresponds is the port used by node_exporter.

I restart my Prometheus server and the target is now displayed in Prometheus.

Prometheus Target UI
The Prometheus UI displaying configured scraping target.

If you are using Prometheus, you are likely using Grafana as well. Grafana has an excellent node_exporter dashboard template available.

Which Tutorial Should I do Next?

Clearly Node Exporter is just one piece of the puzzle. Given that, I will be writing some tutorials on Prometheus, Grafana and other monitoring subjects. Vote for which I should do next by leaving a comment. Thanks!


Node Exporter is a powerful tool for getting metrics out of your Raspberry Pi. However there are some downsides. The main downside is the requirement of a Prometheus server. I use Prometheus already so it was a no-brainer for me.

Prometheus can be setup to run a Raspberry Pi. However I typically advise against it. Prometheus does a big job and the Pi is not well suited for any but the smallest Prometheus workloads.