From patchwork Wed Jul 28 20:38:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Sunke X-Patchwork-Id: 4577 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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4GZlrY2nGDz3xGp for ; Wed, 28 Jul 2021 20:39:25 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4GZlrW162Pz1Kv; Wed, 28 Jul 2021 20:39:23 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4GZlrV6GD1z2yHd; Wed, 28 Jul 2021 20:39:22 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4GZlrT54VHz2xB7 for ; Wed, 28 Jul 2021 20:39:21 +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 4GZlrS3rtzzQ0 for ; Wed, 28 Jul 2021 20:39:20 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 55F90240104 for ; Wed, 28 Jul 2021 22:39:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1627504756; bh=fd1sBplVGhp3qqoLh3hS6FPVD4vGkZpuhdyBFINpyS4=; h=From:To:Cc:Subject:Date:From; b=JvspErcRgByENwgYvBS8b6JkcH1f0a/jaFGnVz7jHKioNHDNKl5hXkjHSPhZekrJl YU6nhWXVSIg/uG21A5qXSriZCZmBbaDURQbcDGWL6Vlezb8MCoM6ics0cz6FsuN5y2 6TroXWKNzVCDHFKRg5paQkq8LKzYFbes+wTQrxdo9T7aKMD7E9M31RF9R/YAEW7oV/ WFq1wMUQ1wcOghqwfHz0JbQMVHrkxeHJtrj1xG+QAi38nxEowb7EFvqSXiHT8d/j7Z SKOQ3JbtP3az4RzJ1RhgTYJ2aszjUkc/TR4KQTaAEV5+KeEyCtlBQJeql6zOx/Joza 4jhy1cS0VKkTw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GZlrM4WTMz6tmS; Wed, 28 Jul 2021 22:39:15 +0200 (CEST) From: Holger Sunke To: development@lists.ipfire.org Subject: [PATCH 3/3] Added new node_exporter 1.2.0 package. Date: Wed, 28 Jul 2021 20:38:24 +0000 Message-Id: <20210728203824.3746758-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=JvspErcR; 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1627504760; 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:dkim-signature; bh=jo/UvLR/NtbqAaMmmfOTvFN3HUk9O8kUhNc/qQaWTzI=; b=YWrxSLgKMCBuq5JMWq8LIs6iEabZDMw9i1OBhqngmKJ8wgX1Jg+pUz9kLnBwPc8VrPQXKX 04Pyq1UQFhDoUrywRjExNA2GSWpLyDjs2Z83W7ts/a2LOiSWt5GNTa0P5kiBRi+Dnf4Lr3 O84Bc7cTe9dc5PHubY2dFSxkibO+ybbgfnHWR2EkDTtNb9ccy3G+IYDeTk3PXtSwhQmchw 6t2p8U8wNZRoyABUHGqTU2PfQ8iBwuAqzzYfZJq0FgD5OGtUKxE3anv7Mk5ugaxqfl6nlb 0PtiW7jFsWU0vcx8HIdwq08+pt0Q0dnWIXc84z+89RAHrYHC0PLgxT7zLDaoug== ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1627504760; a=rsa-sha256; cv=none; b=XF4QWLtGO8NK9ogGE+35ttaBRXZB7FGJEzTm8HUDq31OI2SUPPymnyWAv0nFfgRUpSOFRy iQNbgXSLb9jPo95p8VTSf2cWjcBV7/kD7O69SRTxxDD1mhoq7wku7QN7IUhdmn8T/GP0yh s9zitAy5kqEM25EmrllfLziMqZ2UsoNffHzP+JzGJNzxSLu0Mstk4pdg4ZxiKGUubpfEMh AxywaA2M7rZ3BDKt0WxAAFtATvXow9MUgq+DhYZfX1ZQTno8Kn6QzEXlMeTLQYe7nK1uiY TJDdjNXq/APu0ZIpDX5EGeAnsSclLlQuGlL2vUgHjKiFaiUR9uibcnMMTRMSPQ== Authentication-Results: mail01.ipfire.org; dkim=pass header.d=posteo.de header.s=2017 header.b=JvspErcR; 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-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [-0.45 / 11.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; IP_REPUTATION_HAM(-0.36)[asn: 8495(-0.35), country: DE(-0.01), ip: 185.67.36.66(0.00)]; 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]; MX_GOOD(-0.01)[]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[posteo.de,none]; DKIM_TRACE(0.00)[posteo.de:+]; 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(-2.98)[99.93%]; 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)[]; 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: 4GZlrS3rtzzQ0 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" removed node_exporter_starter.sh --- 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..02d41b0b4 --- /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.2.0 + +THISAPP = node_exporter-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = $(URL_IPFIRE) +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 = 54a096edcaa0a3e1100573d603864fa6 + +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 83bd9faeb..3dcfaf1db 100755 --- a/make.sh +++ b/make.sh @@ -1624,6 +1624,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..5c5c48eba --- /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 Node Exporter..." + loadproc -b /usr/bin/node_exporter $OPTIONS + ;; + + stop) + boot_mesg "Stopping Node Exporter..." + 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