%global git_commit b36a2ea Name: node-exporter-textfile-collector-scripts Version: 0^20250116.git%{git_commit} Release: 1%{?dist} Summary: Textfile Collector Scripts License: Apache-2.0 URL: https://github.com/prometheus-community/node-exporter-textfile-collector-scripts Source0: https://codeload.github.com/prometheus-community/node-exporter-textfile-collector-scripts/tar.gz/%{git_commit}#/node-exporter-textfile-collector-scripts-%{version}.tar.gz BuildArch: noarch BuildRequires: systemd-rpm-macros Requires: moreutils Requires: /var/lib/prometheus/node-exporter Recommends: python3-prometheus_client %description These scripts are examples to be used with the Node Exporter textfile collector. %prep %autosetup -n %{name}-%{git_commit} %build for script in yum.sh do name=$(echo ${script} | sed 's/\..*//') printf '[Unit] Description=Collect %s metrics for prometheus-node-exporter [Service] Type=oneshot Environment=TMPDIR=/var/lib/prometheus/node-exporter ExecStart=/bin/bash -c "/usr/share/node-exporter-textfile-collector-scripts/%s | sponge /var/lib/prometheus/node-exporter/%s.prom"' ${name} ${script} ${name} > prometheus-node-exporter-${name}.service printf '[Unit] Description=Run %s metrics collection every 15 minutes [Timer] OnBootSec=0 OnUnitActiveSec=15min [Install] WantedBy=timers.target' ${name} > prometheus-node-exporter-${name}.timer done %install install -D -t %{buildroot}/%{_datadir}/%{name}/ *.sh *.py inotify-instances ipmitool lvm-prom-collector mellanox_hca_temp multipathd_info install -D -t %{buildroot}/%{_unitdir}/ *.timer *.service %files %license LICENSE %doc README.md %{_datadir}/%{name}/ %{_unitdir}/prometheus-node-exporter-*.service %{_unitdir}/prometheus-node-exporter-*.timer %changelog * Mon Apr 28 2025 Evgeni Golov 0^20250116.gitb36a2ea-1 - Update to b36a2ea * Sat Apr 20 2024 Evgeni Golov 0^20240213.gitef8c077-1 - initial packaging