[packages/nagios-slack] initial, version 1.1 from .pl script

glen glen at pld-linux.org
Fri Mar 11 10:48:00 CET 2016


commit 5d33b445a89fd4c22bb14cef63d8cdffae087e63
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Mar 11 11:47:24 2016 +0200

    initial, version 1.1 from .pl script
    
    created from project readme

 nagios-slack.spec | 41 +++++++++++++++++++++++++++++++++++++++++
 slack_nagios.cfg  | 23 +++++++++++++++++++++++
 2 files changed, 64 insertions(+)
---
diff --git a/nagios-slack.spec b/nagios-slack.spec
new file mode 100644
index 0000000..6602d3b
--- /dev/null
+++ b/nagios-slack.spec
@@ -0,0 +1,41 @@
+Summary:	Nagios/Icinga Slack integration
+Name:		nagios-slack
+Version:	1.1
+Release:	0.2
+License:	Apache v2.0
+Group:		Networking
+Source0:	https://raw.github.com/tinyspeck/services-examples/master/nagios.pl
+# Source0-md5:	cea400bfa840ceffea318e5fd8d7c6d5
+Source1:	slack_nagios.cfg
+URL:		https://slack.com/apps/A0F81R747-nagios
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define		_sysconfdir	/etc/nagios/plugins
+%define		plugindir	%{_prefix}/lib/nagios/plugins
+
+%description
+Nagios is an IT management system that organizations use to identify
+and resolve IT infrastructure problems.
+
+This integration will post Nagios alerts to a channel.
+
+%prep
+%setup -qcT
+install -p %{SOURCE0} .
+cp -p %{SOURCE1} .
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{plugindir},%{_sysconfdir}}
+
+install -p nagios.pl $RPM_BUILD_ROOT%{plugindir}/slack_nagios
+cp -p slack_nagios.cfg $RPM_BUILD_ROOT%{_sysconfdir}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/slack_nagios.cfg
+%attr(755,root,root) %{plugindir}/slack_nagios
diff --git a/slack_nagios.cfg b/slack_nagios.cfg
new file mode 100644
index 0000000..930d9c5
--- /dev/null
+++ b/slack_nagios.cfg
@@ -0,0 +1,23 @@
+
+define contact {
+	contact_name                             slack
+	alias                                    Slack
+	service_notification_period              24x7
+	host_notification_period                 24x7
+	service_notification_options             w,u,c,r
+	host_notification_options                d,r
+	service_notification_commands            notify-service-by-slack
+	host_notification_commands               notify-host-by-slack
+}
+
+define command {
+	command_name     notify-service-by-slack
+	command_line     /usr/lib/nagios/slack_nagios -field "slack_channel=#alerts"
+}
+
+define command {
+	command_name     notify-host-by-slack
+	command_line     /usr/lib/nagios/slack_nagios -field "slack_channel=#ops"
+}
+
+# vim:ft=nagios:ts=4:sw=4:noet
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nagios-slack.git/commitdiff/5d33b445a89fd4c22bb14cef63d8cdffae087e63



More information about the pld-cvs-commit mailing list