blackbox deployment

Installation and deployment, auto-startup to write independent log files

Download

1
2
wget "https://github.com/prometheus/blackbox_exporter/releases/download/v0.24.0/blackbox_exporter-0.24.0.linux-amd64.tar.gz"
tar zxvf blackbox_exporter-0.24.0.linux-amd64.tar.gz

Make it a service blackbox-exporter.service

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[Unit]
Description=Node-exporter
Documentation=https://prometheus.io/docs/introduction/overview/
After=network.target

[Service]
User=devel
Group=devel
ExecStart=/opt/soft/blackbox_exporter-0.24.0.linux-amd64/blackbox_exporter --config.file /opt/soft/blackbox_exporter-0.24.0.linux-amd64/blackbox.yml
StandardOutput=syslog
StardardError=syslog
SyslogIdentifier=blackbox-exporter
Restart=always

[Install]
WantedBy=multi-user.target

rsyslog log configuration blackbox-exporter.conf

1
2
3
if ($programname == "blackbox-exporter")then{ action(type="omfile" file="/var/log/blackbox-exporter.log") 
stop
}
1
2
systemctl restart rsyslog
systemctl restart blackbox-exporter

test

1
curl "http://localhost:9115/probe?target=google.com&module=http_2xx"