[packages/nagios-plugin-check_iface] - rel 2; add configs
arekm
arekm at pld-linux.org
Thu Dec 13 13:34:54 CET 2018
commit d59706ea0f040aff81857223c94f8e786007751b
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Dec 13 13:34:48 2018 +0100
- rel 2; add configs
check_iface.cfg | 34 ++++++++++++++++++++++++++++++++++
nagios-plugin-check_iface.spec | 20 ++++++++++++++++----
2 files changed, 50 insertions(+), 4 deletions(-)
---
diff --git a/nagios-plugin-check_iface.spec b/nagios-plugin-check_iface.spec
index a451418..3e0d9b0 100644
--- a/nagios-plugin-check_iface.spec
+++ b/nagios-plugin-check_iface.spec
@@ -1,20 +1,20 @@
-# TODO: add config
%define plugin check_iface
Summary: Nagios/Icinga plugin for checking network interface speed
Name: nagios-plugin-%{plugin}
Version: 1.0
-Release: 1.1
+Release: 2
License: GPL
Group: Networking
Source0: https://raw.githubusercontent.com/wifibox/linux-admin-tools/master/nagios/plugins/check_net_iface
# Source0-md5: 30366d25cf1e3b035cf49f2d5d556cbe
+Source1: check_iface.cfg
URL: https://github.com/wifibox/linux-admin-tools/blob/master/nagios/plugins/check_net_iface
Requires: nagios-common
-Requires: nagios-plugins-libs
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _sysconfdir /etc/nagios/plugins
+%define nrpeddir /etc/nagios/nrpe.d
%define plugindir %{_prefix}/lib/nagios/plugins
%description
@@ -30,10 +30,22 @@ install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{plugindir}}
install -p %{plugin} $RPM_BUILD_ROOT%{plugindir}/%{plugin}
+install -d $RPM_BUILD_ROOT%{nrpeddir}
+touch $RPM_BUILD_ROOT%{nrpeddir}/%{plugin}.cfg
+
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/check_iface.cfg
+
+%triggerin -- nagios-nrpe
+%nagios_nrpe -a %{plugin} -f %{_sysconfdir}/%{plugin}.cfg
+
+%triggerun -- nagios-nrpe
+%nagios_nrpe -d %{plugin} -f %{_sysconfdir}/%{plugin}.cfg
+
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-#%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg
+%ghost %{nrpeddir}/%{plugin}.cfg
%attr(755,root,root) %{plugindir}/%{plugin}
diff --git a/check_iface.cfg b/check_iface.cfg
new file mode 100644
index 0000000..fc9d416
--- /dev/null
+++ b/check_iface.cfg
@@ -0,0 +1,34 @@
+# Usage:
+# check_iface
+define command {
+ command_name check_iface
+ command_line /usr/lib/nagios/plugins/check_iface $ARG1$
+}
+
+# service template
+define service {
+ use generic-service
+ name check_iface
+ service_description interface params
+ register 0
+
+ normal_check_interval 30
+ retry_check_interval 5
+ notification_interval 3600
+
+ check_command check_iface
+}
+
+# sample check
+#define service {
+# use check_iface
+# host_name localhost
+#}
+
+# sample check via nrpe
+#define service {
+# use iface
+# hostgroups linux-servers
+# host_name localhost
+# check_command check_nrpe!-c check_iface -t 60
+#}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/nagios-plugin-check_iface.git/commitdiff/d59706ea0f040aff81857223c94f8e786007751b
More information about the pld-cvs-commit
mailing list