From patchwork Sun Jun 6 17:48:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Sunke X-Patchwork-Id: 4404 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4FykYM0ycXz3x6t for ; Sun, 6 Jun 2021 17:50:15 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4FykYH5cLbz1DF; Sun, 6 Jun 2021 17:50:11 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4FykYG71qvz2yqh; Sun, 6 Jun 2021 17:50:10 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4FykYF5ljRz2xhq for ; Sun, 6 Jun 2021 17:50:09 +0000 (UTC) Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4FykYD2FMVzkW for ; Sun, 6 Jun 2021 17:50:08 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id B391A240029 for ; Sun, 6 Jun 2021 19:50:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1623001806; bh=tPHFl+a5CEg2xR+NTd4g5qNgNRatfBQGCcIO7hgdD1E=; h=From:To:Cc:Subject:Date:From; b=LjtH1EYk0j2E1iGVqkz5kx0n2V3tWet0J0lpDGBaNFk/OMoCQU+mCgQXGTyN1nyFS bRxNgPxNb6L0q+A/FIGCxIr8FFfvfUDSXBsoXhjj6egvEVHk3f7xy6Hs6MXMh6Ienh 6ubr6JxnwmreIBRnibE/o849UULLzuNPpVMG5K5Kz0B6C32x4/tzOK5XXLDbjUycKr t92WhTfH2/i4bzDsCMpwyr1rEAPESCXkeXJcL5OlBTX7Furv3fGy68+ITVLhoULxXZ mRB5E6aL59xee/pAgj5K2bUOWIH3HIZCARvkSA8+LDiknB6yCuNO0n8zXMXUqxusvv egWXwD62JXwSQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FykYB2gbZz9rxQ; Sun, 6 Jun 2021 19:50:06 +0200 (CEST) From: Holger Sunke To: development@lists.ipfire.org Subject: [PATCH 1/2] Added x86_64 i586 aarch64 armv5tel support for GO language required for node_exporter compilation. Date: Sun, 6 Jun 2021 17:48:55 +0000 Message-Id: <20210606174856.177205-2-holger.sunke@posteo.de> In-Reply-To: <20210606174856.177205-1-holger.sunke@posteo.de> References: <20210606174856.177205-1-holger.sunke@posteo.de> MIME-Version: 1.0 ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=posteo.de header.s=2017 header.b=LjtH1EYk; spf=pass (mail01.ipfire.org: domain of holger.sunke@posteo.de designates 185.67.36.65 as permitted sender) smtp.mailfrom=holger.sunke@posteo.de ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1623001808; a=rsa-sha256; cv=none; b=RSngL7IHzK0k0V4HD7irIZb/l9lS8knzM0TyQpepYSakJUt8zK5RiXfbIeg745pbX3U3x5 4PdK4zhB2o11NNMBhkoHC1/sc0VNVxoZA6S+6Eo5t550uWE4Tqr+BGuOjZI8U3BoJwLl00 h88uJ13jrltqbQPZkvErqxSGIZM+uAeUayL7TLsoLAAOpOt/26bLfiyjYvuOD5aXTxYPqj vkWVLcRQjlHCkavMZZcL5a8dvirDeUOQyj9TAwLj+P9SZklse+q/cGo36665+fij+InPLo Ogg2jJoLV4goJFyH4ZEWPuzijfmD2Uu7AdExXqp9OW+xv52mgbQu8v3gJnuE4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1623001808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=KMv4/1oHTXCeZb9wPaMqdP6Fn0poscev0ilGBA1cyec=; b=Fmwu42l9SJ6p4AxgcLnCpaIYDatpe4aGf3My2I7geNNCYydJiFefCUyWuAOZAXfPgfEeR3 CeS6QXHkJ0PdHZ8hkgCnCB+qkdaNx8fnCmDcHoDmPTNNbC3400/Nfk8xt+vhH5zUEtE4sK zxzjhhKl5gez0WgJBrhBrUcYiIJjsyUa56DRUMS9ifkpTp5Iy6JyZOKbYXdo2PC3ASAjD6 jO4WPQc2ruQ3VS6SZQhMtMUNyYGAVsV5EFTQswN4norQIMAgG7qDXDaKImeCA2t7SlWrkL B9pHGcnzZZZwrrgM5jk7Qk8YJnp2aUfU2U7Gt5qkH/uqkoWP4CH1NOpRKrMeJw== X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [-1.42 / 11.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:185.67.36.0/23:c]; R_MISSING_CHARSET(2.50)[]; RWL_MAILSPIKE_GOOD(0.00)[185.67.36.65:from]; IP_REPUTATION_HAM(-1.31)[asn: 8495(-0.37), country: DE(-0.01), ip: 185.67.36.65(-0.93)]; BROKEN_CONTENT_TYPE(1.50)[]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[posteo.de:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[posteo.de,none]; MX_GOOD(-0.01)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8495, ipnet:185.67.36.0/23, country:DE]; BAYES_HAM(-3.00)[99.99%]; RCVD_IN_DNSWL_LOW(-0.10)[185.67.36.65:from]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[posteo.de:s=2017]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[development@lists.ipfire.org]; DWL_DNSWL_LOW(-1.00)[posteo.de:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4FykYD2FMVzkW Authentication-Results: mail01.ipfire.org; dkim=pass header.d=posteo.de header.s=2017 header.b=LjtH1EYk; spf=pass (mail01.ipfire.org: domain of holger.sunke@posteo.de designates 185.67.36.65 as permitted sender) smtp.mailfrom=holger.sunke@posteo.de; dmarc=pass (policy=none) header.from=posteo.de X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" --- lfs/Config | 8 ++++++++ lfs/go | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lfs/Config b/lfs/Config index 7d98e303b..c8be227a1 100644 --- a/lfs/Config +++ b/lfs/Config @@ -138,6 +138,14 @@ ifeq "$(BUILD_ARCH)" "aarch64" GOARCH = arm64 endif +ifeq "$(BUILD_ARCH)" "armv5tel" + GOARCH = armv6l +endif + +ifeq "$(BUILD_ARCH)" "i586" + GOARCH = 386 +endif + ############################################################################### # Common Macro Definitions ############################################################################### diff --git a/lfs/go b/lfs/go index 6ebb37080..487ad8486 100644 --- a/lfs/go +++ b/lfs/go @@ -28,10 +28,10 @@ VER = 1.15.4 THISAPP = go-$(VER) DL_FILE = go$(VER).$(GOOS)-$(GOARCH).tar.gz -DL_FROM = $(URL_IPFIRE) +DL_FROM = https://golang.org/dl/ DIR_APP = $(DIR_SRC)/go TARGET = $(DIR_INFO)/$(THISAPP) -SUP_ARCH = x86_64 +SUP_ARCH = x86_64 i586 aarch64 armv5tel ############################################################################### # Top-level Rules @@ -41,7 +41,10 @@ objects = $(DL_FILE) $(DL_FILE) = $(DL_FROM)/$(DL_FILE) -$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c +go$(VER).$(GOOS)-arm64.tar.gz_MD5 = b1846fb093f0261707bda44e158bc5be +go$(VER).$(GOOS)-armv6l.tar.gz_MD5 = cf04e0d84de6cbb7d224be1f42a83f02 install : $(TARGET) From patchwork Sun Jun 6 17:48:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Sunke X-Patchwork-Id: 4403 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4FykYL3wlZz3ws5 for ; Sun, 6 Jun 2021 17:50:14 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4FykYH43Pjz17l; Sun, 6 Jun 2021 17:50:11 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4FykYG6L3Tz2yqb; Sun, 6 Jun 2021 17:50:10 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4FykYF5Qx0z2xd1 for ; Sun, 6 Jun 2021 17:50:09 +0000 (UTC) Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4FykYD2Md0z13j for ; Sun, 6 Jun 2021 17:50:08 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 2D6822400FC for ; Sun, 6 Jun 2021 19:50:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1623001807; bh=hx27Fj1rROv8CqEPNe9SlbFN266MFIU0Xv68s9H3srU=; h=From:To:Cc:Subject:Date:From; b=gM4CkTrAo5tg/UH2+xe1s2VUf4BSXgUHEGuGzCpZoCkJOo8D5cNGx/DdGACN8Od8n 6TVnHjQlQ2Joy3ZSsaRlN3fbonKLs6O2RCyn9Rf1rbA3nD9m49qpTGdEj7VCjRolAk I6hLEx5qNEtMGZasXxyIcm2J9AugFOniZ/uQ/hBqWDTEqdi3K3p5xphkqR+BbpYt8+ h60ISRlEvtkugyv9duwB7hPE9zvjQljbh0wQrpQaNwA5RbKeGW13znM3wnWmAEfHAz jEmAPS7L0td87DmGN02iM82PgPQ5bZqPKYm0VW3Ec/ww1lPVXOd5Z/q7d+ea1SwED2 mMEODHV1cwxdQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FykYB4W59z9rxW; Sun, 6 Jun 2021 19:50:06 +0200 (CEST) From: Holger Sunke To: development@lists.ipfire.org Subject: [PATCH 2/2] Added new node_exporter package. Date: Sun, 6 Jun 2021 17:48:56 +0000 Message-Id: <20210606174856.177205-3-holger.sunke@posteo.de> In-Reply-To: <20210606174856.177205-1-holger.sunke@posteo.de> References: <20210606174856.177205-1-holger.sunke@posteo.de> MIME-Version: 1.0 ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=posteo.de header.s=2017 header.b=gM4CkTrA; spf=pass (mail01.ipfire.org: domain of holger.sunke@posteo.de designates 185.67.36.66 as permitted sender) smtp.mailfrom=holger.sunke@posteo.de ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1623001808; a=rsa-sha256; cv=none; b=tzvsitkxyzKgPVsj+vXDA0TRtZ8tqzZdJ25JiiXuiBfXg02XN/DxYu6zQIrMBC6x16c6Dy Hy77r4edB6WAnTtXNnbWTxkoa4cIbOCUT4OzXVXtUXaq1amVYlOQtkPToyJXFvOzl4eYTR 1CG7Fqrfs7Mgvo46SZRcnu4AufXy5+h2a5SDOqsEkVfg93iMozvF6lW5hxyc6YtBHvy7jh EvsTqGcV1hkRkv6BPlBH/dWHzQ+FSSL4VchBhHqa7DCWn2NylztMK2cgrFLlVYkBmc1sVf IQwnU25Bnh0rvod6b5jTdF/WH1TbImw9X1ta6fgvoSnNdtVUjdvEGiriAJpDww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1623001808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zYxUr6huFMxS3NGAh+ZAZ1FbQkeP7SUUszxaqevGmf0=; b=T+PlQshFgCAOykO8h7js3BPxvuohe2JZj+mwZUyigHXTRF/R3ljOlWkaQf7Wy+TxkdLDfQ bVSt0qdkumTSGVDZOPYvDwbqq9K5Onlhgk54mL/l+XZygMlhx/2E4Wl/nTxjShF9hKR2Qk Wx6lF2rWztm0a6OVpeDk201RofrXn+ClYADUwgMuSsdjkVQ0rS2Im0EsGCje9SQ7AY5P4c V+ZKGFaP/g7qarw0+4RnQkmOykOsMDtbQPaDbBf0Hcg77pkupb5uK983l0QxMnnxFN65Si JqS0uz2GRcRIoqz+9PbPY+N6gmf6poU53CeE6CqrxqjxQNHoswcyv3RTW/naAA== X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [-2.28 / 11.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; IP_REPUTATION_HAM(-1.24)[asn: 8495(-0.37), country: DE(-0.01), ip: 185.67.36.66(-0.86)]; R_SPF_ALLOW(-0.20)[+ip4:185.67.36.0/23]; BROKEN_CONTENT_TYPE(1.50)[]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[posteo.de:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[posteo.de,none]; MX_GOOD(-0.01)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8495, ipnet:185.67.36.0/23, country:DE]; BAYES_HAM(-3.00)[99.99%]; RCVD_IN_DNSWL_LOW(-0.10)[185.67.36.66:from]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[posteo.de:s=2017]; FROM_HAS_DN(0.00)[]; SPF_REPUTATION_HAM(-0.94)[-0.93924995306909]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[development@lists.ipfire.org]; DWL_DNSWL_LOW(-1.00)[posteo.de:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RWL_MAILSPIKE_VERYGOOD(0.00)[185.67.36.66:from]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4FykYD2Md0z13j Authentication-Results: mail01.ipfire.org; dkim=pass header.d=posteo.de header.s=2017 header.b=gM4CkTrA; spf=pass (mail01.ipfire.org: domain of holger.sunke@posteo.de designates 185.67.36.66 as permitted sender) smtp.mailfrom=holger.sunke@posteo.de; dmarc=pass (policy=none) header.from=posteo.de X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" --- config/node_exporter/node_exporter_options | 203 +++++++++++++++++++++ config/rootfiles/packages/node_exporter | 3 + lfs/node_exporter | 94 ++++++++++ make.sh | 1 + src/initscripts/packages/node_exporter | 42 +++++ src/paks/node_exporter/install.sh | 31 ++++ src/paks/node_exporter/uninstall.sh | 30 +++ src/paks/node_exporter/update.sh | 27 +++ 8 files changed, 431 insertions(+) create mode 100644 config/node_exporter/node_exporter_options create mode 100644 config/rootfiles/packages/node_exporter create mode 100644 lfs/node_exporter create mode 100644 src/initscripts/packages/node_exporter create mode 100644 src/paks/node_exporter/install.sh create mode 100644 src/paks/node_exporter/uninstall.sh create mode 100644 src/paks/node_exporter/update.sh diff --git a/config/node_exporter/node_exporter_options b/config/node_exporter/node_exporter_options new file mode 100644 index 000000000..f614b1102 --- /dev/null +++ b/config/node_exporter/node_exporter_options @@ -0,0 +1,203 @@ +# Customize node_exporter startup command line flags by editing OPTIONS below: + +export OPTIONS="--web.listen-address=:9100" + +#Flags: +# -h, --help Show context-sensitive help (also try +# --help-long and --help-man). +# --collector.bcache.priorityStats +# Expose expensive priority stats. +# --collector.cpu.info Enables metric cpu_info +# --collector.cpu.info.flags-include=COLLECTOR.CPU.INFO.FLAGS-INCLUDE +# Filter the `flags` field in cpuInfo with a +# value that must be a regular expression +# --collector.cpu.info.bugs-include=COLLECTOR.CPU.INFO.BUGS-INCLUDE +# Filter the `bugs` field in cpuInfo with a value +# that must be a regular expression +# --collector.diskstats.ignored-devices="^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$" +# Regexp of devices to ignore for diskstats. +# --collector.filesystem.ignored-mount-points="^/(dev|proc|sys|var/lib/docker/.+)($|/)" +# Regexp of mount points to ignore for filesystem +# collector. +# --collector.filesystem.ignored-fs-types="^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$" +# Regexp of filesystem types to ignore for +# filesystem collector. +# --collector.ipvs.backend-labels="local_address,local_port,remote_address,remote_port,proto,local_mark" +# Comma separated list for IPVS backend stats +# labels. +# --collector.netclass.ignored-devices="^$" +# Regexp of net devices to ignore for netclass +# collector. +# --collector.netdev.device-include=COLLECTOR.NETDEV.DEVICE-INCLUDE +# Regexp of net devices to include (mutually +# exclusive to device-exclude). +# --collector.netdev.device-exclude=COLLECTOR.NETDEV.DEVICE-EXCLUDE +# Regexp of net devices to exclude (mutually +# exclusive to device-include). +# --collector.netstat.fields="^(.*_(InErrors|InErrs)|Ip_Forwarding|Ip(6|Ext)_(InOctets|OutOctets)|Icmp6?_(InMsgs|OutMsgs)|TcpExt_(Listen.*|Syncookies.*|TCPSynRetrans)|Tcp_(ActiveOpens|InSegs|OutSegs|OutRsts|PassiveOpens|RetransSegs|CurrEstab)|Udp6?_(InDatagrams|OutDatagrams|NoPorts|RcvbufErrors|SndbufErrors))$" +# Regexp of fields to return for netstat +# collector. +# --collector.ntp.server="127.0.0.1" +# NTP server to use for ntp collector +# --collector.ntp.protocol-version=4 +# NTP protocol version +# --collector.ntp.server-is-local +# Certify that collector.ntp.server address is +# not a public ntp server +# --collector.ntp.ip-ttl=1 IP TTL to use while sending NTP query +# --collector.ntp.max-distance=3.46608s +# Max accumulated distance to the root +# --collector.ntp.local-offset-tolerance=1ms +# Offset between local clock and local ntpd time +# to tolerate +# --path.procfs="/proc" procfs mountpoint. +# --path.sysfs="/sys" sysfs mountpoint. +# --path.rootfs="/" rootfs mountpoint. +# --collector.perf.cpus="" List of CPUs from which perf metrics should be +# collected +# --collector.perf.tracepoint=COLLECTOR.PERF.TRACEPOINT ... +# perf tracepoint that should be collected +# --collector.powersupply.ignored-supplies="^$" +# Regexp of power supplies to ignore for +# powersupplyclass collector. +# --collector.qdisc.fixtures="" +# test fixtures to use for qdisc collector +# end-to-end testing +# --collector.runit.servicedir="/etc/service" +# Path to runit service directory. +# --collector.supervisord.url="http://localhost:9001/RPC2" +# XML RPC endpoint. +# --collector.systemd.unit-include=".+" +# Regexp of systemd units to include. Units must +# both match include and not match exclude to be +# included. +# --collector.systemd.unit-exclude=".+\\.(automount|device|mount|scope|slice)" +# Regexp of systemd units to exclude. Units must +# both match include and not match exclude to be +# included. +# --collector.systemd.enable-task-metrics +# Enables service unit tasks metrics +# unit_tasks_current and unit_tasks_max +# --collector.systemd.enable-restarts-metrics +# Enables service unit metric +# service_restart_total +# --collector.systemd.enable-start-time-metrics +# Enables service unit metric +# unit_start_time_seconds +# --collector.textfile.directory="" +# Directory to read text files with metrics from. +# --collector.vmstat.fields="^(oom_kill|pgpg|pswp|pg.*fault).*" +# Regexp of fields to return for vmstat +# collector. +# --collector.wifi.fixtures="" +# test fixtures to use for wifi collector metrics +# --collector.arp Enable the arp collector (default: enabled). +# --collector.bcache Enable the bcache collector (default: enabled). +# --collector.bonding Enable the bonding collector (default: +# enabled). +# --collector.btrfs Enable the btrfs collector (default: enabled). +# --collector.buddyinfo Enable the buddyinfo collector (default: +# disabled). +# --collector.conntrack Enable the conntrack collector (default: +# enabled). +# --collector.cpu Enable the cpu collector (default: enabled). +# --collector.cpufreq Enable the cpufreq collector (default: +# enabled). +# --collector.diskstats Enable the diskstats collector (default: +# enabled). +# --collector.drbd Enable the drbd collector (default: disabled). +# --collector.edac Enable the edac collector (default: enabled). +# --collector.entropy Enable the entropy collector (default: +# enabled). +# --collector.fibrechannel Enable the fibrechannel collector (default: +# enabled). +# --collector.filefd Enable the filefd collector (default: enabled). +# --collector.filesystem Enable the filesystem collector (default: +# enabled). +# --collector.hwmon Enable the hwmon collector (default: enabled). +# --collector.infiniband Enable the infiniband collector (default: +# enabled). +# --collector.interrupts Enable the interrupts collector (default: +# disabled). +# --collector.ipvs Enable the ipvs collector (default: enabled). +# --collector.ksmd Enable the ksmd collector (default: disabled). +# --collector.loadavg Enable the loadavg collector (default: +# enabled). +# --collector.logind Enable the logind collector (default: +# disabled). +# --collector.mdadm Enable the mdadm collector (default: enabled). +# --collector.meminfo Enable the meminfo collector (default: +# enabled). +# --collector.meminfo_numa Enable the meminfo_numa collector (default: +# disabled). +# --collector.mountstats Enable the mountstats collector (default: +# disabled). +# --collector.netclass Enable the netclass collector (default: +# enabled). +# --collector.netdev Enable the netdev collector (default: enabled). +# --collector.netstat Enable the netstat collector (default: +# enabled). +# --collector.network_route Enable the network_route collector (default: +# disabled). +# --collector.nfs Enable the nfs collector (default: enabled). +# --collector.nfsd Enable the nfsd collector (default: enabled). +# --collector.ntp Enable the ntp collector (default: disabled). +# --collector.perf Enable the perf collector (default: disabled). +# --collector.powersupplyclass +# Enable the powersupplyclass collector (default: +# enabled). +# --collector.pressure Enable the pressure collector (default: +# enabled). +# --collector.processes Enable the processes collector (default: +# disabled). +# --collector.qdisc Enable the qdisc collector (default: disabled). +# --collector.rapl Enable the rapl collector (default: enabled). +# --collector.runit Enable the runit collector (default: disabled). +# --collector.schedstat Enable the schedstat collector (default: +# enabled). +# --collector.sockstat Enable the sockstat collector (default: +# enabled). +# --collector.softnet Enable the softnet collector (default: +# enabled). +# --collector.stat Enable the stat collector (default: enabled). +# --collector.supervisord Enable the supervisord collector (default: +# disabled). +# --collector.systemd Enable the systemd collector (default: +# disabled). +# --collector.tcpstat Enable the tcpstat collector (default: +# disabled). +# --collector.textfile Enable the textfile collector (default: +# enabled). +# --collector.thermal_zone Enable the thermal_zone collector (default: +# enabled). +# --collector.time Enable the time collector (default: enabled). +# --collector.timex Enable the timex collector (default: enabled). +# --collector.udp_queues Enable the udp_queues collector (default: +# enabled). +# --collector.uname Enable the uname collector (default: enabled). +# --collector.vmstat Enable the vmstat collector (default: enabled). +# --collector.wifi Enable the wifi collector (default: disabled). +# --collector.xfs Enable the xfs collector (default: enabled). +# --collector.zfs Enable the zfs collector (default: enabled). +# --collector.zoneinfo Enable the zoneinfo collector (default: +# disabled). +# --web.listen-address=":9100" +# Address on which to expose metrics and web +# interface. +# --web.telemetry-path="/metrics" +# Path under which to expose metrics. +# --web.disable-exporter-metrics +# Exclude metrics about the exporter itself +# (promhttp_*, process_*, go_*). +# --web.max-requests=40 Maximum number of parallel scrape requests. Use +# 0 to disable. +# --collector.disable-defaults +# Set all collectors to disabled by default. +# --web.config="" [EXPERIMENTAL] Path to config yaml file that +# can enable TLS or authentication. +# --log.level=info Only log messages with the given severity or +# above. One of: [debug, info, warn, error] +# --log.format=logfmt Output format of log messages. One of: [logfmt, +# json] +# --version Show application version. + diff --git a/config/rootfiles/packages/node_exporter b/config/rootfiles/packages/node_exporter new file mode 100644 index 000000000..994c8365b --- /dev/null +++ b/config/rootfiles/packages/node_exporter @@ -0,0 +1,3 @@ +usr/bin/node_exporter +etc/node_exporter_options +etc/rc.d/init.d/node_exporter diff --git a/lfs/node_exporter b/lfs/node_exporter new file mode 100644 index 000000000..942816754 --- /dev/null +++ b/lfs/node_exporter @@ -0,0 +1,94 @@ +############################################################################## +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 1.1.2 + +THISAPP = node_exporter-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = https://github.com/prometheus/node_exporter/archive/v$(VER)/ +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) +SUP_ARCH = x86_64 i586 aarch64 armv5tel +PROG = node_exporter +PAK_VER = 1 + +DEPS = "" + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = 33c2be846dbd502f9c0efab149a8cbc5 + +install : $(TARGET) +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download : $(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +dist : + @$(PAK) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && make build $(MAKETUNING) $(EXTRA_MAKE) + + # install compiled binary + cd $(DIR_APP) && cp node_exporter /usr/bin + + # install configuration file + install -v -m 644 $(DIR_SRC)/config/node_exporter/node_exporter_options \ + /etc/node_exporter_options + + # Install initscript + $(call INSTALL_INITSCRIPT,node_exporter) + + @rm -rf $(DIR_APP) + @$(POSTBUILD) + diff --git a/make.sh b/make.sh index 4af0081e9..671f15558 100755 --- a/make.sh +++ b/make.sh @@ -1632,6 +1632,7 @@ buildipfire() { lfsmake2 socat lfsmake2 libcdada lfsmake2 pmacct + lfsmake2 node_exporter } buildinstaller() { diff --git a/src/initscripts/packages/node_exporter b/src/initscripts/packages/node_exporter new file mode 100644 index 000000000..b9cbc6ab9 --- /dev/null +++ b/src/initscripts/packages/node_exporter @@ -0,0 +1,42 @@ +#!/bin/sh +######################################################################## +# Begin $rc_base/init.d/ +# +# Description : Prometheus Node Exporter daemon +# +######################################################################## + +. /etc/sysconfig/rc +. ${rc_functions} + +# read configurable OPTIONS +. /etc/node_exporter_options + +case "${1}" in + start) + boot_mesg "Starting..." + loadproc /usr/bin/node_exporter $OPTIONS > /dev/null 2>&1 & + ;; + + stop) + boot_mesg "Stopping..." + killproc /usr/bin/node_exporter + ;; + + restart) + ${0} stop + sleep 1 + ${0} start + ;; + + status) + statusproc /usr/bin/node_exporter + ;; + + *) + echo "Usage: ${0} {start|stop|restart|status}" + exit 1 + ;; +esac + +# End $rc_base/init.d/ diff --git a/src/paks/node_exporter/install.sh b/src/paks/node_exporter/install.sh new file mode 100644 index 000000000..e9272d7cb --- /dev/null +++ b/src/paks/node_exporter/install.sh @@ -0,0 +1,31 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_files +restore_backup ${NAME} +start_service --background ${NAME} + +ln -svf ../init.d/node_exporter /etc/rc.d/rc0.d/K30node_exporter +ln -svf ../init.d/node_exporter /etc/rc.d/rc3.d/S40node_exporter +ln -svf ../init.d/node_exporter /etc/rc.d/rc6.d/K30node_exporter diff --git a/src/paks/node_exporter/uninstall.sh b/src/paks/node_exporter/uninstall.sh new file mode 100644 index 000000000..710baf8b4 --- /dev/null +++ b/src/paks/node_exporter/uninstall.sh @@ -0,0 +1,30 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +/etc/init.d/node_exporter stop +make_backup ${NAME} +remove_files + +rm -rfv /etc/rc.d/rc*.d/*node_exporter + diff --git a/src/paks/node_exporter/update.sh b/src/paks/node_exporter/update.sh new file mode 100644 index 000000000..99776659c --- /dev/null +++ b/src/paks/node_exporter/update.sh @@ -0,0 +1,27 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007-2020 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_backup_includes +./uninstall.sh +./install.sh