Editing Prometheus

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 58: Line 58:
 
:: http://prometheus.domain.com:9090/api/v2/admin/tsdb/delete_series
 
:: http://prometheus.domain.com:9090/api/v2/admin/tsdb/delete_series
 
:: http://prometheus.domain.com:9090/api/v2/admin/tsdb/clean_tombstones
 
:: http://prometheus.domain.com:9090/api/v2/admin/tsdb/clean_tombstones
 +
 +
==Running Node Exporter==
 +
 +
The steps for running Node Exporter are similar to those for running Prometheus itself. Start by creating the Systemd service file for Node Exporter and copy the following content into the service file:
 +
 +
<pre>sudo vi /etc/systemd/system/node_exporter.service</pre>
 +
 +
<pre>[Unit]
 +
Description=Node Exporter
 +
Wants=network-online.target
 +
After=network-online.target
 +
 +
[Service]
 +
User=node_exporter
 +
Group=node_exporter
 +
Type=simple
 +
ExecStart=/usr/local/bin/node_exporter
 +
 +
[Install]
 +
WantedBy=multi-user.target</pre>
 +
 +
 +
* '''Reload''' systemd to use the newly created service: :<code>sudo systemctl daemon-reload</code>
 +
 +
* '''Run''' Node Exporter using the following command: :<code>sudo systemctl start node_exporter</code>
 +
 +
* '''Verify''' that Node Exporter's running correctly: :<code>sudo systemctl status node_exporter</code>
 +
 +
 +
* Lastly, enable Node Exporter to start on boot.
 +
 +
<pre>
 +
sudo systemctl enable node_exporter
 +
</pre>
 +
 +
 +
===Configuring Prometheus to Scrape Node Exporter===
 +
 +
Because Prometheus only scrapes exporters which are defined in the '''scrape_configs''' portion of its configuration file, we'll need to add an entry for Node Exporter, just like we did for Prometheus itself.
 +
 +
At the end of the '''scrape_configs''' block, add a new entry called '''node_exporter.'''
 +
 +
<pre>sudo nano /etc/prometheus/prometheus.yml</pre>
 +
 +
<pre>global:
 +
  scrape_interval: 15s
 +
 +
scrape_configs:
 +
  - job_name: 'prometheus'
 +
    scrape_interval: 5s
 +
    static_configs:
 +
      - targets: ['localhost:9090']
 +
  - job_name: 'node_exporter'
 +
    scrape_interval: 5s
 +
    static_configs:
 +
      - targets: ['localhost:9100']</pre>
 +
 +
Finally, restart Prometheus to put the changes into effect and verify status
  
 
==Activities==
 
==Activities==

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: