Add Grafana, AlertManager, vmutils

The *vmutils* package can be built from source easily, as its just a
collection of Go applications.  Grafana and Alertmanager are quite a bit
more complicated because of their respective browser applications.  In
the interest of getting this project actually going, we'll just install
the official binary releases of these (for now?).
pull/2/head
Dustin 2022-06-26 12:35:12 -05:00
parent a9d8a71a92
commit 5a9e9c0597
10 changed files with 215 additions and 0 deletions

View File

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

View File

@ -86,4 +86,9 @@ BR2_PACKAGE_UTIL_LINUX_SULOGIN=y
BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS=y
BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
# BR2_TARGET_ROOTFS_TAR is not set # BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_ALERTMANAGER=y
BR2_PACKAGE_GRAFANA=y
BR2_PACKAGE_VICTORIAMETRICS=y BR2_PACKAGE_VICTORIAMETRICS=y
BR2_PACKAGE_VMUTILS=y
BR2_PACKAGE_VMUTILS_VMAGENT=y
BR2_PACKAGE_VMUTILS_VMALERT=y

View File

@ -0,0 +1,5 @@
config BR2_PACKAGE_ALERTMANAGER
bool "alertmanager"
help
Prometheus Alertmanager

View File

@ -0,0 +1,37 @@
sha256 a726fa727b6d8e422665a93f90c85b8bca15e2821594288944e21cbe340c68f1 alertmanager-0.24.0.darwin-amd64.tar.gz
sha256 f7890cffaca862528e6e7f857d73aa65a36a921dc960f514e26342a8ebccdf26 alertmanager-0.24.0.darwin-arm64.tar.gz
sha256 ee794fedb64588c0c9f1b8ac044720231f75cd910fd197526ed334e89af39fa9 alertmanager-0.24.0.dragonfly-amd64.tar.gz
sha256 30855a1669e70200008324a29804b011aa0e8a94a52c833d9d8aa2ece81a9c67 alertmanager-0.24.0.freebsd-386.tar.gz
sha256 b0a1c85eb02ae204d39dfde09a7a3b622c2688a574e9a4e928245f1723973939 alertmanager-0.24.0.freebsd-amd64.tar.gz
sha256 b981fac8d3789960f58207115009046e72ba486dd45660c68f88ea1005f47101 alertmanager-0.24.0.freebsd-arm64.tar.gz
sha256 331a022d3814a2e0040169a6d8004eed862c16db0465480eab82afaa0ed063c2 alertmanager-0.24.0.freebsd-armv6.tar.gz
sha256 0d3f57d64b734777c5ce1a3492c7f6441fd63c8629ba56a5bda960bc5b91f467 alertmanager-0.24.0.freebsd-armv7.tar.gz
sha256 83831093f007cdcd3bf0130e7f87c650b4370f566a0a2c3e446c40888cc8a402 alertmanager-0.24.0.illumos-amd64.tar.gz
sha256 54a2017c56ded6d2209dfbed38ece9736ce7085aaa924ae02c67b6f1eb283085 alertmanager-0.24.0.linux-386.tar.gz
sha256 6fa982232ae7be5524f5b3cd4e90b7c6a75086368200c917644eaa3e806555dc alertmanager-0.24.0.linux-amd64.tar.gz
sha256 f54dd97f20b5d06517cbe83bae6333325fc26bc6595ede433f165aefb562d421 alertmanager-0.24.0.linux-arm64.tar.gz
sha256 c8fcb4b1ed7645469093a7a2fa40d6b5c90b8bef80ca0b5e57ab7e47b8786c50 alertmanager-0.24.0.linux-armv5.tar.gz
sha256 ffde04ddf0c30ff06a424cd848d748e6eddc21a68ac44f12dcf39d415e308f1d alertmanager-0.24.0.linux-armv6.tar.gz
sha256 0a8f12b92974392a4760b22afa05c1b85fd121c457124f555d1ab3c92ad94222 alertmanager-0.24.0.linux-armv7.tar.gz
sha256 64672d461c1972862c2b977ab43c2423f1158c5aa1e5c3e1872fe220f7866f94 alertmanager-0.24.0.linux-mips.tar.gz
sha256 ae85975eaf79c73c5fa4ba34873a5fc232e65ab8532d224ca2e2db486849b299 alertmanager-0.24.0.linux-mips64.tar.gz
sha256 05603a0965bf6f22c5e51f46e81fe59e64833d476426a5a19ee95ea09de92712 alertmanager-0.24.0.linux-mips64le.tar.gz
sha256 b32b820b83b73dd97dcbf38c98e940773774fc38f524e45ea8dd0cc9b33aae9b alertmanager-0.24.0.linux-mipsle.tar.gz
sha256 ce148c13c2452855a48e13b458281dee80043ab912774d2b1a0c476414edb9ee alertmanager-0.24.0.linux-ppc64.tar.gz
sha256 3795d63ea93484d1e66a400b8446227a2011be72630b19a6e9a64533aa3af006 alertmanager-0.24.0.linux-ppc64le.tar.gz
sha256 e20f759118a682354f1490c922fc58705f8b8851366bcbd0622c0c74aa5c2d1a alertmanager-0.24.0.linux-s390x.tar.gz
sha256 0508245f3bbe45f540b8072b9a1dabfd6bcc2d5d5f2a8d72a4fd94ef3ccb408a alertmanager-0.24.0.netbsd-386.tar.gz
sha256 bffdf272e4ad28d260c29313c37f07bd4a772aaad3dc7a55db9e5f94b033440a alertmanager-0.24.0.netbsd-amd64.tar.gz
sha256 e42820d33faa02a20199d87f5ad7195397366ea0a1a0a0e0dcbc3d619604098c alertmanager-0.24.0.netbsd-arm64.tar.gz
sha256 e88e51329ca464c72b4ad1ac41a42092a47e6d53ac64ceda1623c35c4d84b2f6 alertmanager-0.24.0.netbsd-armv6.tar.gz
sha256 d46fba7a72f87c72177456be99c6ab9ea8f92c09279e0b4f9f516373c436fd41 alertmanager-0.24.0.netbsd-armv7.tar.gz
sha256 d4b705e1217d17e37f8376856077814535d7e4c9bcfded7c96b5396d1cb5387a alertmanager-0.24.0.openbsd-386.tar.gz
sha256 1ef9339d6d24ec9a6484a3c88a64d4fd4f81845512aeab6989bc2a8439437e48 alertmanager-0.24.0.openbsd-amd64.tar.gz
sha256 f1b78bdebb38d508df075ec4c8ef55153f6d0f8af377d2c557fd9f4fd3aa7994 alertmanager-0.24.0.openbsd-arm64.tar.gz
sha256 8b95e63b105be79d997d916f37d6908bf91d25f0921616c0ccaa7cd86e39eced alertmanager-0.24.0.openbsd-armv7.tar.gz
sha256 334066ab1925dd9903c085b8ddabdbc569ed1dd7f0345e43113e612d656e2223 alertmanager-0.24.0.windows-386.tar.gz
sha256 2ec2fe568e94c99b58186822fbd628cd17e2f168ae35252b316ac81c6487777d alertmanager-0.24.0.windows-386.zip
sha256 e73c1c93cca44bd7ca51f43737a6d55cd0d3bb9f2f982a9442bc02c143a1faaa alertmanager-0.24.0.windows-amd64.tar.gz
sha256 1a29cdd112bbc3e76a95f951ce6679a5fd9f424ed2964d1065ab9706f70e9ec0 alertmanager-0.24.0.windows-amd64.zip
sha256 340a43c5549cd948b97106800a9e866cb61f22d8197afce0eb4ca4febb72c7f2 alertmanager-0.24.0.windows-arm64.tar.gz
sha256 b8d4cbac97d0fa2e755df91ffc7b0e624379e6a3d66a944063305241a00a7fd4 alertmanager-0.24.0.windows-arm64.zip

View File

@ -0,0 +1,26 @@
###############################################################################
#
# Prometheus Alertmanager
#
# This is a very hacky way to install AlertMangager, using the upstream binary
# release packagkes. Building AlertManager requires Node.js/NPM, etc. to
# build the front-end, and I don't care to figure all that out right now.
###############################################################################
ALERTMANAGER_VERSION = 0.24.0
ALERTMANAGER_SOURCE = alertmanager-$(ALERTMANAGER_VERSION).linux-$(KERNEL_ARCH).tar.gz
ALERTMANAGER_SITE = https://github.com/prometheus/alertmanager/releases/download/v$(ALERTMANAGER_VERSION)
ALERTMANAGER_LICENSE = Apache-2.0
ALERTMANAGER_LICENSE_FILES = LICENSE
ALERTMANAGER_INSTALL_TARGET = YES
define ALERTMANAGER_INSTALL_TARGET_CMDS
$(INSTALL) -m u=rwx,go=rx $(@D)/alertmanager $(TARGET_DIR)/usr/sbin
endef
define ALERTMANAGER_USERS
alertmanager -1 alertmanager -1 * - - - Prometheus Alertmanager
endef
$(eval $(generic-package))

View File

@ -0,0 +1,5 @@
config BR2_PACKAGE_GRAFANA
bool "grafana"
help
Grafana

View File

@ -0,0 +1 @@
sha256 2046f8e9c0b659d0e67f57d8a311ba714214e9616a41ffaba71c256d42914977 grafana-9.0.1.linux-arm64.tar.gz

View File

@ -0,0 +1,37 @@
###############################################################################
#
# Grafana
#
# Building Grafana is quite complicated, so we'll just install from the binary
# package for now.
###############################################################################
GRAFANA_VERSION = 9.0.1
GRAFANA_SOURCE = grafana-$(GRAFANA_VERSION).linux-$(KERNEL_ARCH).tar.gz
GRAFANA_SITE = https://dl.grafana.com/oss/release
GRAFANA_LICENSE = Apache-2.0
GRAFANA_LICENSE_FILES = LICENSE
GRAFANA_INSTALL_TARGET = YES
define GRAFANA_INSTALL_TARGET_CMDS
$(INSTALL) -m u=rwx,go=rx $(@D)/bin/grafana-cli $(TARGET_DIR)/usr/sbin
$(INSTALL) -m u=rwx,go=rx $(@D)/bin/grafana-server $(TARGET_DIR)/usr/sbin
$(INSTALL) -d $(TARGET_DIR)/usr/share/grafana
cp -a \
$(@D)/conf \
$(@D)/plugins-bundled \
$(@D)/public \
$(@D)/scripts \
$(@D)/LICENSE \
$(@D)/NOTICE.md \
$(@D)/README.md \
$(@D)/VERSION \
$(TARGET_DIR)/usr/share/grafana/
endef
define GRAFANA_USERS
grafana -1 grafana -1 * /usr/share/grafana /sbin/nologin - grafana user account
endef
$(eval $(generic-package))

57
package/vmutils/Config.in Normal file
View File

@ -0,0 +1,57 @@
menuconfig BR2_PACKAGE_VMUTILS
bool "vmutils"
help
Victoria Metrics utilities
if BR2_PACKAGE_VMUTILS
config BR2_PACKAGE_VMUTILS_VMAGENT
bool "vmagent"
help
vmagent is a tiny but mighty agent which helps you collect metrics
from various sources and store them in VictoriaMetrics or any other
Prometheus-compatible storage systems that support the remote_write
protocol.
config BR2_PACKAGE_VMUTILS_VMALERT
bool "vmalert"
help
vmalert executes a list of the given alerting or recording rules
against configured -datasource.url. For sending alerting
notifications vmalert relies on Alertmanager configured via
-notifier.url flag. Recording rules results are persisted via remote
write protocol and require -remoteWrite.url to be configured. Vmalert
is heavily inspired by Prometheus implementation and aims to be
compatible with its syntax.
config BR2_PACKAGE_VMUTILS_VMAUTH
bool "vmauth"
help
vmauth is a simple auth proxy, router and load balancer for
VictoriaMetrics. It reads auth credentials from Authorization http
header (Basic Auth, Bearer token and InfluxDB authorization is
supported), matches them against configs pointed by -auth.config
command-line flag and proxies incoming HTTP requests to the
configured per-user url_prefix on successful match. The -auth.config
can point to either local file or to http url.
config BR2_PACKAGE_VMUTILS_VMBACKUP
bool "vmbackup"
help
vmbackup creates VictoriaMetrics data backups from instant snapshots.
config BR2_PACKAGE_VMUTILS_VMRESTORE
bool "vmrestore"
help
vmrestore restores data from backups created by vmbackup.
VictoriaMetrics v1.29.0 and newer versions must be used for working
with the restored data.
config BR2_PACKAGE_VMUTILS_VMCTL
bool "vmctl"
help
VictoriaMetrics command-line tool
vmctl provides various useful actions with VictoriaMetrics components.
endif

View File

@ -0,0 +1,39 @@
VMUTILS_VERSION = 1.78.0
VMUTILS_SITE = $(call github,VictoriaMetrics,VictoriaMetrics,v$(VMUTILS_VERSION))
VMUTILS_LICENSE = Apache-2.0
VMUTILS_LICENSE_FILES = LICENSE
VMUTILS_LDFLAGS = -extldflags '-static'
VMUTILS_TAGS = netgo osusergo nethttpomithttp2 musl
ifeq ($(BR2_PACKAGE_VMUTILS_VMAGENT),y)
VMUTILS_BUILD_TARGETS += app/vmagent
VMUTILS_INSTALL_BINS += vmagent
endif
ifeq ($(BR2_PACKAGE_VMUTILS_VMALERT),y)
VMUTILS_BUILD_TARGETS += app/vmalert
VMUTILS_INSTALL_BINS += vmalert
endif
ifeq ($(BR2_PACKAGE_VMUTILS_VMAUTH),y)
VMUTILS_BUILD_TARGETS += app/vmauth
VMUTILS_INSTALL_BINS += vmauth
endif
ifeq ($(BR2_PACKAGE_VMUTILS_VMBACKUP),y)
VMUTILS_BUILD_TARGETS += app/vmbackup
VMUTILS_INSTALL_BINS += vmbackup
endif
ifeq ($(BR2_PACKAGE_VMUTILS_VMRESTORE),y)
VMUTILS_BUILD_TARGETS += app/vmrestore
VMUTILS_INSTALL_BINS += vmrestore
endif
ifeq ($(BR2_PACKAGE_VMUTILS_VMCTL),y)
VMUTILS_BUILD_TARGETS += app/vmctl
VMUTILS_INSTALL_BINS += vmctl
endif
$(eval $(golang-package))