Add and enable blackbox_exporter package
dustin/metricspi/pipeline/head There was a failure building this commit Details

*blackbox_exporter* is a generic exporter for Prometheus that can be
used to provide metrics about HTTP, etc. services.  I use it to monitor
the availability and responsiveness of websites I host.
pull/2/head
Dustin 2022-08-06 16:05:21 -05:00
parent 34b650c2f4
commit a836526d40
5 changed files with 71 additions and 0 deletions

View File

@ -1,3 +1,4 @@
source "$BR2_EXTERNAL_metricspi_PATH/package/alertmanager/Config.in"
source "$BR2_EXTERNAL_metricspi_PATH/package/blackbox_exporter/Config.in"
source "$BR2_EXTERNAL_metricspi_PATH/package/grafana/Config.in"
source "$BR2_EXTERNAL_metricspi_PATH/package/victoriametrics/Config.in"

View File

@ -110,6 +110,7 @@ BR2_TARGET_ROOTFS_SQUASHFS=y
BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_ALERTMANAGER=y
BR2_PACKAGE_BLACKBOX_EXPORTER=y
BR2_PACKAGE_GRAFANA=y
BR2_PACKAGE_VICTORIAMETRICS=y
BR2_PACKAGE_VICTORIAMETRICS_SINGLE=y

View File

@ -0,0 +1,4 @@
config BR2_PACKAGE_BLACKBOX_EXPORTER
bool "blackbox_exporter"
help
Prometheus Blackbox Exporter

View File

@ -0,0 +1,20 @@
###############################################################################
#
# Prometheus Blackbox Exporter
#
###############################################################################
BLACKBOX_EXPORTER_VERSION = 0.22.0
BLACKBOX_EXPORTER_SITE = $(call github,prometheus,blackbox_exporter,v$(BLACKBOX_EXPORTER_VERSION))
BLACKBOX_EXPORTER_LICENSE = Apache-2.0
BLACKBOX_EXPORTER_LICENSE_FILES = LICENSE
BLACKBOX_EXPORTER_LDFLAGS = -extldflags '-static'
define BLACKBOX_EXPORTER_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m u=rw,go=r \
$(BR2_EXTERNAL_metricspi_PATH)/package/blackbox_exporter/blackbox_exporter.service \
$(TARGET_DIR)/usr/lib/systemd/system/blackbox_exporter.service
endef
$(eval $(golang-package))

View File

@ -0,0 +1,45 @@
[Unit]
Description=Blackbox exporter
Documentation=https://github.com/prometheus/blackbox_exporter/blob/master/README.md
After=network-online.target
Wants=network-online.target
[Service]
Type=exec
ExecStart=/usr/bin/blackbox_exporter \
--config.file=/etc/prometheus/blackbox.yml \
--web.listen-address=[::1]:9115
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
CapabilityBoundingSet=
DeviceAllow=
DevicePolicy=closed
DynamicUser=yes
LockPersonality=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
PrivateDevices=yes
PrivateUsers=yes
PrivateTmp=yes
ProcSubset=pid
ProtectClock=yes
ProtectControlGroups=yes
ProtectHome=yes
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectProc=invisible
ProtectSystem=strict
RestrictAddressFamilies=AF_INET AF_INET6
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~@privileged @resources
UMask=0027
[Install]
WantedBy=multi-user.target