Skip to content

Commit 2e5cb67

Browse files
committed
added prometheus blackbox
1 parent 1f54c43 commit 2e5cb67

File tree

1 file changed

+63
-2
lines changed

1 file changed

+63
-2
lines changed

data/prometheus/targets.md

+63-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,51 @@
11
[demo targets](https://demo.promlabs.com/targets)
22

33

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+
443
## Node Exporter
544
[download](https://github.com/prometheus/node_exporter/releases)
645
```bash
746
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
1049

1150
/tmp/node_exporter-1.6.1.linux-amd64/node_exporter --help
1251

@@ -15,9 +54,31 @@ tar xvfz node_exporter.linux-amd64.tar.gz
1554
```
1655

1756

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
1863

64+
/tmp/blackbox_exporter-0.24.0.linux-amd64/blackbox_exporter --help
1965

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+
```
2069

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+
```
2182
2283
2384

0 commit comments

Comments
 (0)