DevOps Tools/Prometheus
From r00tedvw.com wiki
(Difference between revisions)
Line 1: | Line 1: | ||
[[ DevOps_Tools/Monitoring | Overview ]] | [[ DevOps_Tools/Prometheus | Prometheus ]] | [[ DevOps_Tools/Monitoring | Overview ]] | [[ DevOps_Tools/Prometheus | Prometheus ]] | ||
+ | |||
+ | =CentOS 7 Installation= | ||
+ | ==Create dependencies== | ||
+ | <nowiki>~$ sudo yum install -y wget | ||
+ | ~$ sudo groupadd --system prometheus | ||
+ | ~$ sudo useradd -s /sbin/nologin --system -g prometheus prometheus | ||
+ | ~$ sudo mkdir /var/lib/prometheus | ||
+ | ~$ for i in rules rules.d files_sd; do sudo mkdir -p /etc/prometheus/${i}; done | ||
+ | ~$ mkdir -p /tmp/prometheus && cd /tmp/prometheus</nowiki> | ||
+ | |||
+ | ==Download and setup== | ||
+ | <nowiki>~$ curl -s https://api.github.com/repos/prometheus/prometheus/releases/latest | grep browser_download_url | grep linux-amd64 | cut -d '"' -f 4 | wget -qi - | ||
+ | ~$ tar xvf prometheus*.tar.gz | ||
+ | ~$ cd prometheus*/ | ||
+ | ~$ sudo mv prometheus promtool /usr/local/bin/ | ||
+ | ~$ sudo mv prometheus.yml /etc/prometheus/prometheus.yml | ||
+ | ~$ sudo mv consoles/ console_libraries/ /etc/prometheus/ | ||
+ | ~$ cd ~/ | ||
+ | ~$ rm -rf /tmp/prometheus</nowiki> | ||
+ | |||
+ | ==Create config== | ||
+ | <nowiki>~$ sudo vim /etc/prometheus/prometheus.yml</nowiki> | ||
+ | <div class="mw-collapsible mw-collapsed"> | ||
+ | This text is not collapsible; but the next is collapsible and hidden by default: | ||
+ | <div class="mw-collapsible-content">{{Lorem}}</div> | ||
+ | </div> |
Revision as of 14:20, 26 August 2022
Overview | Prometheus
Contents |
CentOS 7 Installation
Create dependencies
~$ sudo yum install -y wget ~$ sudo groupadd --system prometheus ~$ sudo useradd -s /sbin/nologin --system -g prometheus prometheus ~$ sudo mkdir /var/lib/prometheus ~$ for i in rules rules.d files_sd; do sudo mkdir -p /etc/prometheus/${i}; done ~$ mkdir -p /tmp/prometheus && cd /tmp/prometheus
Download and setup
~$ curl -s https://api.github.com/repos/prometheus/prometheus/releases/latest | grep browser_download_url | grep linux-amd64 | cut -d '"' -f 4 | wget -qi - ~$ tar xvf prometheus*.tar.gz ~$ cd prometheus*/ ~$ sudo mv prometheus promtool /usr/local/bin/ ~$ sudo mv prometheus.yml /etc/prometheus/prometheus.yml ~$ sudo mv consoles/ console_libraries/ /etc/prometheus/ ~$ cd ~/ ~$ rm -rf /tmp/prometheus
Create config
~$ sudo vim /etc/prometheus/prometheus.yml
This text is not collapsible; but the next is collapsible and hidden by default: