[Pkg-nagios-devel] Bug#553300: nagios3: please provide a check interface to the init script

Stephen Gran sgran at debian.org
Fri Oct 30 00:01:42 UTC 2009


Package: nagios3
Version: 3.0.6-4~lenny2
Severity: wishlist
Tags: patch

Hi there,

It would be great if I could run 
/etc/init.d/nagios3 check

and find out if I've just screwed something up.  Something like:

--- /etc/init.d/nagios3 2009-01-25 18:15:10.000000000 +0000
+++ nagios3     2009-10-29 23:57:51.000000000 +0000
@@ -85,6 +85,10 @@
   echo $*
 }
 
+check () {
+  $DAEMON -v $NAGIOSCFG
+}
+
 check_config () {
   if $DAEMON -v $NAGIOSCFG >/dev/null 2>&1 ; then
     # First get the user/group etc Nagios is running as
@@ -227,8 +231,11 @@
   status)
     status
     ;;
+  check)
+    check
+    ;;
   *)
-    log_failure_msg "Usage: $0 {start|stop|restart|reload|force-reload|status}" >&2
+    log_failure_msg "Usage: $0 {start|stop|restart|reload|force-reload|status|check}" >&2
     exit 1
   ;;
 esac

Should do.  I know that the init script will already tell me when I try
to restart it, but I'd like an interface that could be run separately
from any action commands (restart/reload/etc).

Cheers,

-- System Information:
Debian Release: 5.0.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.31.5-dsa-ia32 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.utf8)
Shell: /bin/sh linked to /bin/bash

Versions of packages nagios3 depends on:
ii  libc6                  2.7-18            GNU C Library: Shared libraries
ii  libgd2-noxpm           2.0.36~rc1~dfsg-3 GD Graphics Library version 2 (wit
ii  libjpeg62              6b-14             The Independent JPEG Group's JPEG 
ii  libperl5.10            5.10.0-19lenny2   Shared Perl library
ii  libpng12-0             1.2.27-2+lenny2   PNG library - runtime
ii  nagios3-common         3.0.6-4~lenny2    support files for nagios3
ii  perl                   5.10.0-19lenny2   Larry Wall's Practical Extraction 
ii  zlib1g                 1:1.2.3.3.dfsg-12 compression library - runtime

nagios3 recommends no packages.

Versions of packages nagios3 suggests:
ii  nagios-nrpe-plugin            2.12-1     Nagios Remote Plugin Executor Plug

-- no debconf information





More information about the Pkg-nagios-devel mailing list