-
Notifications
You must be signed in to change notification settings - Fork 23
/
node expoter installation.txt
77 lines (43 loc) · 1.48 KB
/
node expoter installation.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Node expoter installation
sudo apt-get update
sudo apt-get upgrade
Go to https://prometheus.io/download/
wget the URL
sudo tar -xvf node_exporter-1.5.0.linux-amd64.tar.gz
go inside the folder :-
cd node_exporter-1.5.0.linux-amd64/
We can also run the node expoter
./node_exporter
Now lets configure prometheus.yml file that will listen this node expoter
Login to prometheus server go to prometheus.yml file (/etc/prometheus)
make the neccessary changes basically add the new target
sudo systemctl stop prometheus
sudo systemctl start prometheus
How to run node expoter as service:-
sudo groupadd --system prometheus
sudo useradd -s /sbin/nologin --system -g prometheus prometheus
sudo mkdir /var/lib/node
sudo mv node_exporter /var/lib/node/
sudo nano /etc/systemd/system/node.service
[Unit]
Description=Prometheus Node Exporter
Documentation=https://prometheus.io/docs/introduction/overview/
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=prometheus
Group=prometheus
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/var/lib/node/node_exporter
SyslogIdentifier=prometheus_node_exporter
Restart=always
[Install]
WantedBy=multi-user.target
lets make the owner
sudo chown -R prometheus:prometheus /var/lib/node
sudo chown -R prometheus:prometheus /var/lib/node/*
sudo systemctl daemon-reload
sudo systemctl start node
sudo systemctl enable node
sudo systemctl status node