diff --git a/alertmanager-0.21.0.linux-amd64.tar.gz b/alertmanager-0.21.0.linux-amd64.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9bf9ba1f4acf73c18eaf87a1e6dc29e7ed2e2932 Binary files /dev/null and b/alertmanager-0.21.0.linux-amd64.tar.gz differ diff --git a/alertmanager-0.21.0.linux-arm64.tar.gz b/alertmanager-0.21.0.linux-arm64.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..fa4fd8a74b4a823bb71ab43324f1b82b80dd0e32 Binary files /dev/null and b/alertmanager-0.21.0.linux-arm64.tar.gz differ diff --git a/alertmanager.default b/alertmanager.default new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/alertmanager.service b/alertmanager.service new file mode 100644 index 0000000000000000000000000000000000000000..273dd8fbab249f8f798d219dc1eacd138d321392 --- /dev/null +++ b/alertmanager.service @@ -0,0 +1,20 @@ +# -*- mode: conf -*- + +[Unit] +Description=Prometheus Alertmanager. +Documentation=https://github.com/prometheus/alertmanager +After=network.target + +[Service] +EnvironmentFile=-/etc/default/alertmanager +User=prometheus +ExecStart=/usr/bin/alertmanager \ + --config.file=/etc/prometheus/alertmanager.yml \ + --storage.path=/var/lib/prometheus/alertmanager \ + $ALERTMANAGER_OPTS +ExecReload=/bin/kill -HUP $MAINPID +Restart=always +LimitNOFILE=65536 + +[Install] +WantedBy=multi-user.target diff --git a/alertmanager.spec b/alertmanager.spec new file mode 100644 index 0000000000000000000000000000000000000000..40e60100ca3b6d4073e52d3582ec6e0a87ff5d1f --- /dev/null +++ b/alertmanager.spec @@ -0,0 +1,72 @@ +%define debug_package %{nil} + +Name: alertmanager +Version: 0.21.0 +Release: 2%{?dist} +Summary: Prometheus Alertmanager. +License: ASL 2.0 +URL: https://github.com/prometheus/%{name} + +%ifarch aarch64 +%global hostarch arm64 +%endif +%ifarch x86_64 +%global hostarch amd64 +%endif + +Source0: https://github.com/prometheus/%{name}/releases/download/v%{version}/%{name}-%{version}.linux-%{hostarch}.tar.gz +Source1: %{name}.service +Source2: %{name}.default + +%{?systemd_requires} +Requires(pre): shadow-utils + +%description + +The Alertmanager handles alerts sent by client applications such as the +Prometheus server. It takes care of deduplicating, grouping, and routing them to +the correct receiver integration such as email, PagerDuty, or OpsGenie. It also +takes care of silencing and inhibition of alerts. + +%prep +%setup -q -n %{name}-%{version}.linux-%{hostarch} + +%build +/bin/true + +%install +mkdir -vp %{buildroot}%{_sharedstatedir}/prometheus +install -D -m 644 alertmanager.yml %{buildroot}%{_sysconfdir}/prometheus/%{name}.yml +install -D -m 755 %{name} %{buildroot}%{_bindir}/%{name} +install -D -m 755 amtool %{buildroot}%{_bindir}/amtool +install -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service +install -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/default/%{name} + +%pre +getent group prometheus >/dev/null || groupadd -r prometheus +getent passwd prometheus >/dev/null || \ + useradd -r -g prometheus -d %{_sharedstatedir}/prometheus -s /sbin/nologin \ + -c "Prometheus services" prometheus +exit 0 + +%post +%systemd_post %{name}.service + +%preun +%systemd_preun %{name}.service + +%postun +%systemd_postun %{name}.service + +%files +%defattr(-,root,root,-) +%config(noreplace) %{_sysconfdir}/prometheus/%{name}.yml +%{_bindir}/%{name} +%{_bindir}/amtool +%{_unitdir}/%{name}.service +%config(noreplace) %{_sysconfdir}/default/%{name} +%dir %attr(755, prometheus, prometheus)%{_sharedstatedir}/prometheus + +%changelog +* Tue Aug 11 2020 houjian - 0.21.0-2 +- Package init \ No newline at end of file