commit 57878c9f39d3a1e1420ea053f18ac4d36b3e7d8c
Author: Elan Ruusamäe <[email protected]>
Date:   Sat Nov 7 14:35:45 2015 +0200

    move plugin config as file

 check_postgres.cfg                | 20 ++++++++++++++++++++
 nagios-plugin-check_postgres.spec | 26 ++------------------------
 2 files changed, 22 insertions(+), 24 deletions(-)
---
diff --git a/nagios-plugin-check_postgres.spec 
b/nagios-plugin-check_postgres.spec
index 7c4c323..8c5ee28 100644
--- a/nagios-plugin-check_postgres.spec
+++ b/nagios-plugin-check_postgres.spec
@@ -12,6 +12,7 @@ License:      BSD
 Group:         Networking
 Source0:       http://bucardo.org/downloads/check_postgres-%{version}.tar.gz
 # Source0-md5: 0ac4a8bae7b633fbfacdf58be5a1975f
+Source1:       %{plugin}.cfg
 URL:           https://bucardo.org/wiki/Check_postgres
 BuildRequires: perl-devel >= 1:5.8.0
 BuildRequires: rpm-perlprov >= 4.1-13
@@ -36,34 +37,11 @@ cp %{plugin}.pl %{plugin}
 %{__sed} -i -e 's,/usr/local/nagios/perl/lib,%{plugindir},' %{plugin}
 %{__sed} -i -e '1s,^#!.*perl,#!%{__perl},' %{plugin}
 
-cat > %{plugin}.cfg <<'EOF'
-# Usage:
-# %{plugin}
-define command {
-       command_name    %{plugin}
-       command_line    %{plugindir}/%{plugin} -H $HOSTADDRESS$ $ARG1$
-}
-
-define service {
-       use                     generic-service
-       name                    template
-       service_description     template
-       register                0
-
-       normal_check_interval   5
-       retry_check_interval    1
-
-       notification_interval   10
-
-       check_command           %{plugin}
-}
-EOF
-
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{plugindir}}
 install -p %{plugin} $RPM_BUILD_ROOT%{plugindir}/%{plugin}
-cp -p %{plugin}.cfg $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.cfg
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.cfg
 
 %clean
 rm -rf $RPM_BUILD_ROOT
diff --git a/check_postgres.cfg b/check_postgres.cfg
new file mode 100644
index 0000000..eff334c
--- /dev/null
+++ b/check_postgres.cfg
@@ -0,0 +1,20 @@
+# Usage:
+# check_postgres
+define command {
+       command_name    check_postgres
+       command_line    /usr/lib/nagios/plugins/check_postgres -H $HOSTADDRESS$ 
$ARG1$
+}
+
+define service {
+       use                     generic-service
+       name                    template
+       service_description     template
+       register                0
+
+       normal_check_interval   5
+       retry_check_interval    1
+
+       notification_interval   10
+
+       check_command           check_postgres
+}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nagios-plugin-check_postgres.git/commitdiff/af2b320cb6c89e76c4964356944c380e808205c6

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to