Skip to content

Instantly share code, notes, and snippets.

@runswithd6s
Last active August 29, 2015 14:08
Show Gist options
  • Save runswithd6s/8d443f9fd688a44493fe to your computer and use it in GitHub Desktop.
Save runswithd6s/8d443f9fd688a44493fe to your computer and use it in GitHub Desktop.
pagerduty-nagios-pl.spec File
# Currently, there is no version tag from Github
%global commit 6fecda34c8328487f0b0b256f51bfb1697179342
%global shortcommit %(echo %{commit}| head -c7)
Summary: Submit Nagios Host and Service events to PagerDuty
Name: pagerduty-nagios-pl
Version: 0.0
Release: 1.%{shortcommit}%{?dist}
License: BSD
Group: Applications/System
Source0: https://github.com/pagerduty/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz
URL: https://github.com/PagerDuty/pagerduty-nagios-pl
BuildArch: noarch
%description
PagerDuty (http://pagerduty.com) provides an alarm aggregation and
dispatching service for system administrators and support teams. It
collects alerts from your monitoring tools, gives you an overall view
of all of your monitoring alarms, and alerts an on duty engineer if
there’s a problem. This package provides a Perl script for integrating
with PagerDuty.
%prep
%setup -qn %{name}-%{commit}
%install
rm -rf %{buildroot}
# There is no Makefile, do it manually
install -m 755 -d %{buildroot}%{_bindir}
install -m 755 -d %{buildroot}%{_sysconfdir}/cron.d
install -p -m 755 pagerduty_nagios.pl %{buildroot}%{_bindir}/
# No example crontab available as a file, create it.
echo "* * * * * %{_bindir}/pagerduty_nagios.pl flush" > %{buildroot}%{_sysconfdir}/cron.d/pagerduty-nagios-pl
%files
# License contained in README.md
%doc README.md
# Include Nagios config file as a documented example
%doc pagerduty_nagios.cfg
%{_bindir}/pagerduty_nagios.pl
%defattr(644,root,root)
%config(noreplace) %{_sysconfdir}/cron.d/pagerduty-nagios-pl
%changelog
* Mon Nov 3 2014 Chad Walstrom <[email protected]> 0.0
- Initial version, tracking 'master'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment