Install the SNMP Exporter

Video Lecture

Install SNMP Exporter Install SNMP Exporter Install SNMP Exporter


Now to manually install the SNMP Exporter.

I am going to manually install the latest version of the SNMP Exporter.

To see the latest versions, you can visit,

Select the file appropriate for your operating system.

I will download snmp_exporter-0.19.0.linux-amd64.tar.gz


Untar it,

tar xzf snmp_exporter-0.19.0.linux-amd64.tar.gz

CD into the new folder that was created and copy the files to the /usr/local/bin/ folder

cd snmp_exporter-0.19.0.linux-amd64
ls -lh
cp ./snmp_exporter /usr/local/bin/snmp_exporter
cp ./snmp.yml /usr/local/bin/snmp.yml
cd /usr/local/bin/

See the snmp_exporter help

./snmp_exporter -h

Create a new user (if it doesn't already exist)

sudo useradd --system prometheus

Create a new file called snmp-exporter.service

sudo nano /etc/systemd/system/snmp-exporter.service

Add the script and save

Description=Prometheus SNMP Exporter Service

ExecStart=/usr/local/bin/snmp_exporter --config.file="/usr/local/bin/snmp.yml"


Now start and check the service is running.

systemctl daemon-reload
sudo service snmp-exporter start
sudo service snmp-exporter status

Visit in the browser http://[ip or domain]:9116

Now to add the configuration to the prometheus.yml

sudo nano /etc/prometheus/prometheus.yml

Add the following to the end of the existing yml.

  - job_name: snmp
    metrics_path: /snmp
      module: [if_mib]
      - targets:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement:  # URL as shown on the UI

Save and check changes to the config are syntactically correct

promtool check config /etc/prometheus/prometheus.yml

and if OK, then restart the Prometheus service.

sudo service prometheus restart
sudo service prometheus status