summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorHolger Weiss <hweiss@users.sourceforge.net>2009-04-21 22:28:53 (GMT)
committerHolger Weiss <hweiss@users.sourceforge.net>2009-05-10 11:37:35 (GMT)
commit006597a12d28d9cd752b3eeb56dff3bc97049f4c (patch)
tree26e322d4b996b901e0d928e11bba46658646b30f /configure.in
parentdd52d7e5e7acfd42243bc1ce173a0bf5d62fe347 (diff)
downloadmonitoring-plugins-006597a12d28d9cd752b3eeb56dff3bc97049f4c.tar.gz
Make C plugin output format configurablehw/output/functions
The development guidelines¹ currently state that the plugin output should be in the format "SERVICE STATUS: Information text". However, the SERVICE and STATUS information is redundant, as the plugin caller (e.g., Nagios) should know which SERVICE is checked and the STATUS is returned via the plugin's exit code. After discussing² this issue on the development list, we decided to make the plugin output configurable at compile time (separately for "normal" and "verbose" output). ¹ http://nagiosplug.sf.net/developer-guidelines.html ² http://thread.gmane.org/gmane.network.nagios.plugins.devel/5155 Signed-off-by: Holger Weiss <hweiss@users.sourceforge.net>
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in38
1 files changed, 38 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 68ac0a0..a4b5e96 100644
--- a/configure.in
+++ b/configure.in
@@ -39,6 +39,39 @@ INSTALL="$INSTALL $extra_install_args"
39INSTALL_STRIP_PROGRAM="$INSTALL_STRIP_PROGRAM $extra_install_args" 39INSTALL_STRIP_PROGRAM="$INSTALL_STRIP_PROGRAM $extra_install_args"
40AC_SUBST(INSTALL) 40AC_SUBST(INSTALL)
41 41
42dnl Configure the plugin output format
43default_output_format="%s %x: %i\n"
44AC_ARG_WITH([standard_output_format],
45 [AS_HELP_STRING([--with-standard-output-format=FORMAT],
46 [specify the standard plugin output FORMAT; %p, %s, %x, and %m
47 will be replaced by the plugin name, the service name, the
48 status string, and the information message, respectively; tabs
49 or newlines can be inserted using \t or \n
50 @<:@default="%s %x: %m\n"@:>@])],
51 [standard_output_format=$withval],
52 [standard_output_format="yes"])
53AC_ARG_WITH([verbose_output_format],
54 [AS_HELP_STRING([--with-verbose-output-format=FORMAT],
55 [specify the verbose plugin output FORMAT; %p, %s, %x, and %m
56 will be replaced by the plugin name, the service name, the
57 status string, and the information message, respectively; tabs
58 or newlines can be inserted using \t or \n
59 @<:@default="%s %x: %m\n"@:>@])],
60 [verbose_output_format=$withval],
61 [verbose_output_format="yes"])
62AS_IF([test "$standard_output_format" = yes],
63 [standard_output_format=$default_output_format],
64 [test "$standard_output_format" = no],
65 [standard_output_format=""],
66 [test "$verbose_output_format" = yes],
67 [verbose_output_format=$default_output_format],
68 [test "$verbose_output_format" = no],
69 [verbose_output_format=""])
70AC_DEFINE_UNQUOTED([STANDARD_OUTPUT_FORMAT], ["$standard_output_format"],
71 [Define the standard plugin output format.])
72AC_DEFINE_UNQUOTED([VERBOSE_OUTPUT_FORMAT], ["$verbose_output_format"],
73 [Define the verbose plugin output format.])
74
42AC_PROG_CC 75AC_PROG_CC
43gl_EARLY 76gl_EARLY
44AC_PROG_GCC_TRADITIONAL 77AC_PROG_GCC_TRADITIONAL
@@ -150,6 +183,11 @@ AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
150AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv") 183AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv")
151AC_SUBST(SOCKETLIBS) 184AC_SUBST(SOCKETLIBS)
152 185
186dnl check for basename(3) which needs -lgen on some systems (e.g. IRIX)
187AC_CHECK_HEADERS([libgen.h])
188AC_SEARCH_LIBS([basename], [gen])
189AC_CHECK_FUNCS([basename])
190
153dnl 191dnl
154dnl check for math-related functions needing -lm 192dnl check for math-related functions needing -lm
155AC_CHECK_HEADERS(math.h) 193AC_CHECK_HEADERS(math.h)