]> git.pld-linux.org Git - packages/nagios-nrpe.git/commitdiff
move nrpe command definitions to nrpe.d/commands.cfg auto/ac/nagios-nrpe-2.15-4 auto/th/nagios-nrpe-2.15-4
authorElan Ruusamäe <glen@delfi.ee>
Mon, 25 May 2015 13:02:26 +0000 (16:02 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Mon, 25 May 2015 13:03:30 +0000 (16:03 +0300)
commands.cfg [new file with mode: 0644]
nagios-nrpe-config.patch
nagios-nrpe.spec

diff --git a/commands.cfg b/commands.cfg
new file mode 100644 (file)
index 0000000..4ff6c62
--- /dev/null
@@ -0,0 +1,39 @@
+# COMMAND DEFINITIONS
+# Command definitions that this daemon will run.  Definitions
+# are in the following format:
+#
+# command[<command_name>]=<command_line>
+#
+# When the daemon receives a request to return the results of <command_name>
+# it will execute the command specified by the <command_line> argument.
+#
+# Unlike Nagios, the command line cannot contain macros - it must be
+# typed exactly as it should be executed.
+#
+# Note: Any plugins that are used in the command lines must reside
+# on the machine that this daemon is running on!  The examples below
+# assume that you have plugins installed in a /usr/local/nagios/libexec
+# directory.  Also note that you will have to modify the definitions below
+# to match the argument format the plugins expect.  Remember, these are
+# examples only!
+
+
+# The following examples use hardcoded command arguments...
+
+#command[check_users]=/usr/lib/nagios/check_users -w 5 -c 10
+#command[check_load]=/usr/lib/nagios/check_load -w 15,10,5 -c 30,25,20
+#command[check_hda1]=/usr/lib/nagios/check_disk -w 20% -c 10% -p /dev/hda1
+#command[check_zombie_procs]=/usr/lib/nagios/check_procs -w 5 -c 10 -s Z
+#command[check_total_procs]=/usr/lib/nagios/check_procs -w 150 -c 200
+
+
+# The following examples allow user-supplied arguments and can
+# only be used if the NRPE daemon was compiled with support for
+# command arguments *AND* the dont_blame_nrpe directive in this
+# config file is set to '1'.  This poses a potential security risk, so
+# make sure you read the SECURITY file before doing this.
+
+#command[check_users]=/usr/lib/nagios/check_users -w $ARG1$ -c $ARG2$
+#command[check_load]=/usr/lib/nagios/check_load -w $ARG1$ -c $ARG2$
+#command[check_disk]=/usr/lib/nagios/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
+#command[check_procs]=/usr/lib/nagios/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
index 86785ba1a8daecee44b26dfe272db67623866bf3..54f0937bcd1020a3bf07f3584ef7ad34a257f380 100644 (file)
@@ -1,5 +1,5 @@
---- nrpe-2.12.new/sample-config/nrpe.cfg.in    2008-03-27 09:47:26.682398787 +0100
-+++ nrpe-2.12/sample-config/nrpe.cfg.in        2012-01-04 17:57:22.907296034 +0200
+--- nrpe-2.12/sample-config/nrpe.cfg.in        2012-01-04 17:57:22.907296034 +0200
++++ nrpe-2.15/sample-config/nrpe.cfg.in        2015-05-25 15:40:07.747598382 +0300
 @@ -23,7 +23,7 @@
  # number.  The file is only written if the NRPE daemon is started by the root
  # user and is running in standalone mode.
  
  
  
-@@ -196,11 +195,11 @@
- # The following examples use hardcoded command arguments...
+@@ -195,41 +194,2 @@
+-
+-
+-# COMMAND DEFINITIONS
+-# Command definitions that this daemon will run.  Definitions
+-# are in the following format:
+-#
+-# command[<command_name>]=<command_line>
+-#
+-# When the daemon receives a request to return the results of <command_name>
+-# it will execute the command specified by the <command_line> argument.
+-#
+-# Unlike Nagios, the command line cannot contain macros - it must be
+-# typed exactly as it should be executed.
+-#
+-# Note: Any plugins that are used in the command lines must reside
+-# on the machine that this daemon is running on!  The examples below
+-# assume that you have plugins installed in a /usr/local/nagios/libexec
+-# directory.  Also note that you will have to modify the definitions below
+-# to match the argument format the plugins expect.  Remember, these are
+-# examples only!
+-
+-
+-# The following examples use hardcoded command arguments...
+-
 -command[check_users]=@libexecdir@/check_users -w 5 -c 10
 -command[check_load]=@libexecdir@/check_load -w 15,10,5 -c 30,25,20
 -command[check_hda1]=@libexecdir@/check_disk -w 20% -c 10% -p /dev/hda1
 -command[check_zombie_procs]=@libexecdir@/check_procs -w 5 -c 10 -s Z
 -command[check_total_procs]=@libexecdir@/check_procs -w 150 -c 200 
-+#command[check_users]=@libexecdir@/check_users -w 5 -c 10
-+#command[check_load]=@libexecdir@/check_load -w 15,10,5 -c 30,25,20
-+#command[check_hda1]=@libexecdir@/check_disk -w 20% -c 10% -p /dev/hda1
-+#command[check_zombie_procs]=@libexecdir@/check_procs -w 5 -c 10 -s Z
-+#command[check_total_procs]=@libexecdir@/check_procs -w 150 -c 200 
- # The following examples allow user-supplied arguments and can
+-
+-
+-# The following examples allow user-supplied arguments and can
+-# only be used if the NRPE daemon was compiled with support for 
+-# command arguments *AND* the dont_blame_nrpe directive in this
+-# config file is set to '1'.  This poses a potential security risk, so
+-# make sure you read the SECURITY file before doing this.
+-
+-#command[check_users]=@libexecdir@/check_users -w $ARG1$ -c $ARG2$
+-#command[check_load]=@libexecdir@/check_load -w $ARG1$ -c $ARG2$
+-#command[check_disk]=@libexecdir@/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
+-#command[check_procs]=@libexecdir@/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
++# NOTE:
++# In PLD Linux, command definitions in file /etc/nagios/nrpe.d/commands.cfg
index 1acb27ad756012edc63345f5ada52151985bb597..e5fd9d90b223ee0edbe8c26c3eecf594027140e6 100644 (file)
@@ -2,7 +2,7 @@ Summary:        Nagios remote plugin execution service/plugin
 Summary(pl.UTF-8):     Demon i wtyczka zdalnego wywoływania wtyczek Nagios
 Name:          nagios-nrpe
 Version:       2.15
-Release:       3
+Release:       4
 License:       GPL v2
 Group:         Networking
 Source0:       http://downloads.sourceforge.net/nagios/nrpe-%{version}.tar.gz
@@ -10,6 +10,7 @@ Source0:      http://downloads.sourceforge.net/nagios/nrpe-%{version}.tar.gz
 Source1:       nrpe.init
 Source2:       nrpe-command.cfg
 Source3:       %{name}.tmpfiles
+Source4:       commands.cfg
 Patch0:                %{name}-config.patch
 Patch1:                nrpe_check_control.patch
 URL:           http://www.nagios.org/
@@ -88,6 +89,7 @@ install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/{plugins,nrpe.d},%{_l
        $RPM_BUILD_ROOT%{systemdtmpfilesdir}
 
 cp -p sample-config/nrpe.cfg $RPM_BUILD_ROOT%{_sysconfdir}/nrpe.cfg
+cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/nrpe.d
 sed -e 's,@plugindir@,%{_plugindir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/plugins/check_nrpe.cfg
 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/nrpe
 install -p src/nrpe $RPM_BUILD_ROOT%{_sbindir}
@@ -107,6 +109,20 @@ if [ "$1" = "0" ] ; then
        /sbin/chkconfig --del nrpe
 fi
 
+%triggerpostun -- %{name} < 2.15-4
+# skip *this* trigger on downgrade
+[ $1 -le 1 ] && exit 0
+
+# check if need to migrate
+grep -q '^command\['  %{_sysconfdir}/nrpe.cfg || exit 0
+
+# move command definitions to separate file
+mv -f  %{_sysconfdir}/nrpe.d/commands.cfg{,.rpmnew}
+grep '^command\['  %{_sysconfdir}/nrpe.cfg > %{_sysconfdir}/nrpe.d/commands.cfg
+cp -f %{_sysconfdir}/nrpe.cfg{,.rpmsave}
+sed -i -e '/^command\[/d' %{_sysconfdir}/nrpe.cfg
+%service nrpe restart
+
 %triggerpostun -- %{name} < 2.6-1.1
 %{__sed} -i -e 's,/var/run/nrpe.pid,/var/run/nrpe/nrpe.pid,' %{_sysconfdir}/nrpe.cfg
 
@@ -122,6 +138,7 @@ fi
 %doc Changelog LEGAL README* SECURITY
 %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nrpe.cfg
 %attr(750,root,nagios) %dir %{_sysconfdir}/nrpe.d
+%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nrpe.d/commands.cfg
 %attr(755,root,root) %{_sbindir}/nrpe
 %attr(754,root,root) /etc/rc.d/init.d/nrpe
 %dir %attr(775,root,nagios) /var/run/nrpe
This page took 0.07368 seconds and 4 git commands to generate.