diff --git a/blackbox_exporter.service b/blackbox_exporter.service new file mode 100644 index 0000000..1976ecd --- /dev/null +++ b/blackbox_exporter.service @@ -0,0 +1,16 @@ + +[Unit] +Description=Prometheus Blackbox prober exporter +Documentation=https://github.com/prometheus/blackbox_exporter +After=network.target + +[Service] +User=prometheus +Group=prometheus +WorkingDirectory=/var/lib/prometheus +ExecStart=/usr/bin/blackbox_exporter --config.file=/etc/prometheus/blackbox.yml +ExecReload=/bin/kill -HUP $MAINPID +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/blackbox_exporter.spec b/blackbox_exporter.spec new file mode 100644 index 0000000..41a84c6 --- /dev/null +++ b/blackbox_exporter.spec @@ -0,0 +1,45 @@ +%define __debug_install_post %{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}" %{nil} +%define debug_package %{nil} +Name: blackbox_exporter +Version: 0.19.0 +Release: 1 +Summary: Prometheus blackbox prober exporter +License: Apache-2.0 +Url: https://github.com/prometheus/blackbox_exporter +Source: https://github.com/prometheus/blackbox_exporter/archive/refs/tags/v%{version}.tar.gz +Source1: %{name}.service +Source2: vendor.tar.gz +BuildRequires: golang promu +Requires(pre): prometheus2 +%description +The blackbox exporter allows blackbox probing of endpoints over HTTP, HTTPS, DNS, TCP and ICMP. + +%prep +%setup -q -n %{name}-%{version} +tar xvf %{SOURCE2} -C . + +%build +export GOFLAGS="-mod=vendor" +promu build + +%install +mkdir -p %{buildroot}{%{_bindir},%{_unitdir},%{_sysconfdir}/prometheus} +install -m0755 %{name}-%{version} %{buildroot}%{_bindir}/%{name} +install -m0644 blackbox.yml %{buildroot}%{_sysconfdir}/prometheus/blackbox.yml +install -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service + +%post +%system_post %{name}.service + +%postun +%system_preun %{name}.service + +%files +%doc LICENSE README.md CONFIGURATION.md example.yml +%{_bindir}/* +%{_unitdir}/%{name}.service +%config(noreplace) %{_sysconfdir}/prometheus/blackbox.yml + +%changelog +* Thu Aug 5 2021 huanghaitao - 0.19.0-1 +- package init diff --git a/blackbox_exporter.yaml b/blackbox_exporter.yaml new file mode 100644 index 0000000..a79de4e --- /dev/null +++ b/blackbox_exporter.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: prometheus/blackbox_exporter +tag_prefix: "v" +separator: . diff --git a/v0.19.0.tar.gz b/v0.19.0.tar.gz new file mode 100644 index 0000000..280e0e1 Binary files /dev/null and b/v0.19.0.tar.gz differ diff --git a/vendor.tar.gz b/vendor.tar.gz new file mode 100644 index 0000000..2f5e410 Binary files /dev/null and b/vendor.tar.gz differ