FreeBSD: Install Prometheus, Node Exporter and Grafana

by Kliment Andreev
0 comment
Reading Time: 2 minutes

FreeBSD comes out of the box with three great tools for monitoring. If you need more info about how these tools work, please read the official documentation. I’ll explain the installation only and creating a simple dashboard.
The installation is very simple. These amazing tools don’t need any external libraries. We’ll install the packages and enable them to start on boot.

pkg -y install prometheus node_exporter grafana5
sysrc prometheus_enable=YES
sysrc node_exporter_enable=YES
sysrc grafana_enable=YES

Add these lines at the very end in /usr/local/etc/prometheus.yml. Make sure you have the proper spacing. Check the job_name above. They have to be in line.

- job_name: 'node_exporter'
  scrape_interval: 5s
  static_configs:
    - targets: ['localhost:9100']

Now start the services.

service prometheus start
service node_exporter start
service grafana start

Go to http://your_ip:9090. This is how it should look like.

Now go to Grafana at http://your_ip:3000. Log as admin/admin and you’ll be prompted to change your password. From the Home Dashboard click on Add Source, right in the middle.

Click on the Prometheus icons from the choice of the others. You’ll be prompted to fill out this form. Just make sure the URL is http://localhost:9090. Click Save & Test and make sure it’s OK.

Now, in the upper left corner where the Grafana logo is, click on the Plus (+) sign and choose Import. In another browser tab go to this link and on the right side click on Download JSON. Save it somewhere. Go back to your Grafana dashboard and click on Upload .json file.

Find the JSON file that you saved in the previous step and upload it. You’ll see this screen. Just make sure to choose Prometheus under localhost parameter and click Import.

That’s it. You’ll see the node_exporter’s dashboard.

Related Articles

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More