1
1
[ demo targets] ( https://demo.promlabs.com/targets )
2
2
3
3
4
+ ## Config
5
+ ` nano ./config/prometheus.yml `
6
+ ``` yaml
7
+ global :
8
+ scrape_interval : 5s # Default is every 1 minute.
9
+
10
+ scrape_configs :
11
+ - job_name : " my-target_job"
12
+ metrics_path : /metrics
13
+ scheme : http
14
+ static_configs :
15
+ - targets :
16
+ - localhost:9090
17
+
18
+ # blackbox
19
+ - job_name : ' blackbox'
20
+ metrics_path : /probe
21
+ params :
22
+ module :
23
+ - my_http_2xx_example
24
+ static_configs :
25
+ - targets :
26
+ - http://prometheus.io
27
+ - https://prometheus.io
28
+ - http://example.com:8080
29
+ - http://asim3.github.io
30
+ - https://asim3.github.io
31
+ - http://asim3.github.io/notes
32
+ - https://asim3.github.io/notes
33
+ relabel_configs :
34
+ - source_labels : [__address__]
35
+ target_label : __param_target
36
+ - source_labels : [__param_target]
37
+ target_label : instance
38
+ - target_label : __address__
39
+ replacement : 192.168.197.131:9200
40
+ ` ` `
41
+
42
+
4
43
## Node Exporter
5
44
[download](https://github.com/prometheus/node_exporter/releases)
6
45
` ` ` bash
7
46
cd /tmp
8
- curl -Lo node_exporter.linux-amd64. tar.gz https://github.com/prometheus/node_exporter/releases/download/v1.6.1/node_exporter-1.6.1.linux-amd64.tar.gz
9
- tar xvfz node_exporter.linux-amd64. tar.gz
47
+ curl -Lo node_exporter.tar.gz https://github.com/prometheus/node_exporter/releases/download/v1.6.1/node_exporter-1.6.1.linux-amd64.tar.gz
48
+ tar xvfz node_exporter.tar.gz
10
49
11
50
/tmp/node_exporter-1.6.1.linux-amd64/node_exporter --help
12
51
@@ -15,9 +54,31 @@ tar xvfz node_exporter.linux-amd64.tar.gz
15
54
```
16
55
17
56
57
+ ## website monitoring
58
+ [ download] ( https://github.com/prometheus/blackbox_exporter/releases )
59
+ ``` bash
60
+ cd /tmp
61
+ curl -Lo blackbox_exporter.tar.gz https://github.com/prometheus/blackbox_exporter/releases/download/v0.24.0/blackbox_exporter-0.24.0.linux-amd64.tar.gz
62
+ tar xvfz blackbox_exporter.tar.gz
18
63
64
+ /tmp/blackbox_exporter-0.24.0.linux-amd64/blackbox_exporter --help
19
65
66
+ # run Node Exporter
67
+ /tmp/blackbox_exporter-0.24.0.linux-amd64/blackbox_exporter --config.file=" /tmp/my_blackbox_conf.yml" --web.listen-address=:9200
68
+ ```
20
69
70
+ ## blackbox config
71
+ ` nano /tmp/my_blackbox_conf.yml `
72
+ ``` yml
73
+ modules :
74
+ my_http_2xx_example :
75
+ prober : http
76
+ timeout : 5s
77
+ http :
78
+ valid_http_versions : ["HTTP/1.1", "HTTP/2.0"]
79
+ valid_status_codes : []
80
+ method : GET
81
+ ` ` `
21
82
22
83
23
84
0 commit comments