From 5574466145fd5b89311e1bacb012503d5dbc5527 Mon Sep 17 00:00:00 2001 From: ilyamak04 Date: Tue, 8 Oct 2024 23:58:50 +0300 Subject: [PATCH] start to study monitoring --- linux/COMMANDS.MD | 2 +- linux/NOTES.MD | 1 + monitoring/GRAFANA.MD | 1 + monitoring/PROMETHEUS.MD | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 monitoring/GRAFANA.MD create mode 100644 monitoring/PROMETHEUS.MD diff --git a/linux/COMMANDS.MD b/linux/COMMANDS.MD index f79e67c..0556db2 100644 --- a/linux/COMMANDS.MD +++ b/linux/COMMANDS.MD @@ -91,7 +91,7 @@ APT работает поверх более низкоуровневого ин - `-xvf` - извлечь архив - `-z` - использовать сжатие `gzip` ```bash - tar -cvfz backup.tar.gz /var/www + tar -xvfz backup.tar.gz /var/www ``` ### Разное diff --git a/linux/NOTES.MD b/linux/NOTES.MD index 1aec676..16c4f21 100644 --- a/linux/NOTES.MD +++ b/linux/NOTES.MD @@ -81,4 +81,5 @@ Swap-файл (или swap-раздел) — это специальная об --- +`tar xvfz *tar.gz` - распаковать архив .tar.gz diff --git a/monitoring/GRAFANA.MD b/monitoring/GRAFANA.MD new file mode 100644 index 0000000..31c6028 --- /dev/null +++ b/monitoring/GRAFANA.MD @@ -0,0 +1 @@ +[**Установка**](https://grafana.com/docs/grafana/latest/setup-grafana/installation/debian/) diff --git a/monitoring/PROMETHEUS.MD b/monitoring/PROMETHEUS.MD new file mode 100644 index 0000000..d5b5340 --- /dev/null +++ b/monitoring/PROMETHEUS.MD @@ -0,0 +1,36 @@ +### Install and Configure +- `wget https://github.com/prometheus/prometheus/releases/download/v2.55.0-rc.0/prometheus-2.55.0-rc.0.linux-amd64.tar.gz` - скачиваем прометеус сервер + +- `tar xvfz *.tar.gz` +- `sudo mv prometheus /usr/bin/` +- `sudo mkdir /etc/prometheus/` +- `sudo mkdir /etc/prometheus/data` +- `useradd -rs /bin/false prometheus` - создаём системного пользователя для работы с prometheus +- `chown prometheus:prometheus /usr/bin/prometheus` +- `chown -R prometheus:prometheus /etc/prometheus` +- `vi /etc/systemd/system/prometheus.service` - создаём systemd юнит +```bash +[Unit] +Description=Prometheus Server +After=network.target + +[Service] +User=prometheus +Group=prometheus +Type=simple +Restart=on-failure +ExecStart=/usr/bin/prometheus \ + --config.file /etc/prometheus/prometheus.yml \ + --storage.tsdb.path /etc/prometheus/data + +[Install] +WantedBy=multi-user.target +``` +- `sudo systemctl daemon-reload` - обновить systemd + +- `sudo systemctl start prometheus` +- `sudo systemctl enable prometheus` + + + + \ No newline at end of file