systemctl enable grafana-server.service
systemctl daemon-reload
systemctl start grafana-server
systemctl status grafana-server
mkdir /root/Monitor
cd /root/Monitor
wget https://github.com/prometheus/node_exporter/releases/download/v0.15.1/node_exporter-0.15.1.linux-amd64.tar.gz
tar -xzvf node_exporter-0.15.1.linux-amd64.tar.gz
wget https://github.com/prometheus/mysqld_exporter/releases/download/v0.10.0/mysqld_exporter-0.10.0.linux-amd64.tar.gz
vim /etc/systemd/system/node_exporter.service
[Unit]
Description=Node Exporter
[Service]
User=root
ExecStart=/root/Monitor/node_exporter-0.15.1.linux-amd64/node_exporter
[Install]
WantedBy=default.target
systemctl daemon-reload
systemctl enable node_exporter.service
systemctl start node_exporter.service
systemctl status node_exporter.service
vim /etc/systemd/system/mysqld_exporter.service
[Unit]
Description=Node Exporter
[Service]
User=root
export DATA_SOURCE_NAME='root:XXXXXX@(127.0.0.1:3306)/'
ExecStart=/root/Monitor/mysqld_exporter-0.10.0.linux-amd64/mysqld_exporter
[Install]
WantedBy=default.target
systemctl daemon-reload
systemctl enable mysqld_exporter.service
systemctl start mysqld_exporter.service
systemctl status mysqld_exporter.service
prometheus.yml :
- targets: ['localhost:9100']
labels:
instance: 'Monitor'
Không có nhận xét nào:
Đăng nhận xét