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-04-21 22:47:29 (GMT)
commit92bb86c484c3d52c5ffdfa790f7a5acf68edcc36 (patch)
treee2195501bf3b67b373c9c3ddd0a5f0330d0209ed /configure.in
parent05a980ba4bd3de0540771000955bd3235ad17acd (diff)
downloadmonitoring-plugins-92bb86c484c3d52c5ffdfa790f7a5acf68edcc36.tar.gz
Make C plugin output format configurable
*** THIS COMMIT WILL BE MODIFIED IN THE FUTURE! *** The development guidelines¹ currently state that the plugin output should be in the format "SERVICE STATUS: Information text". However, when a plugin is called via Nagios in order to perform a service check, adding SERVICE and STATUS to the output is redundant. And when a plugin is called on the command line for testing, there is no use in printing out the SERVICE string, either. However, for debugging, it does make sense to print out the STATUS so that the user won't have to check and interpret the exit code manually. But it should suffice to print such debug output only when called with "--verbose", not in production. Space for plugin output is sometimes scarce, so that we should try to keep the output "short and to the point" (as the guide states) and not waste space with redundant information. Therefore, we decided² to make the ("normal" and "verbose") plugin output configurable at compile time. ¹ http://nagiosplug.sf.net/developer-guidelines.html ² http://thread.gmane.org/gmane.network.nagios.plugins.devel/5155
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 9067978..474522d 100644
--- a/configure.in
+++ b/configure.in
@@ -40,6 +40,39 @@ INSTALL="$INSTALL $extra_install_args"
40INSTALL_STRIP_PROGRAM="$INSTALL_STRIP_PROGRAM $extra_install_args" 40INSTALL_STRIP_PROGRAM="$INSTALL_STRIP_PROGRAM $extra_install_args"
41AC_SUBST(INSTALL) 41AC_SUBST(INSTALL)
42 42
43dnl Configure the plugin output format
44default_output_format="%s %x: %i\n"
45AC_ARG_WITH([standard_output_format],
46 [AS_HELP_STRING([--with-standard-output-format=FORMAT],
47 [specify the standard plugin output FORMAT; %p, %s, %x, and %m
48 will be replaced by the plugin name, the service name, the
49 status string, and the information message, respectively; tabs
50 or newlines can be inserted using \t or \n
51 @<:@default="%s %x: %m\n"@:>@])],
52 [standard_output_format=$withval],
53 [standard_output_format="yes"])
54AC_ARG_WITH([verbose_output_format],
55 [AS_HELP_STRING([--with-verbose-output-format=FORMAT],
56 [specify the verbose plugin output FORMAT; %p, %s, %x, and %m
57 will be replaced by the plugin name, the service name, the
58 status string, and the information message, respectively; tabs
59 or newlines can be inserted using \t or \n
60 @<:@default="%s %x: %m\n"@:>@])],
61 [verbose_output_format=$withval],
62 [verbose_output_format="yes"])
63AS_IF([test "$standard_output_format" = yes],
64 [standard_output_format=$default_output_format],
65 [test "$standard_output_format" = no],
66 [standard_output_format=""],
67 [test "$verbose_output_format" = yes],
68 [verbose_output_format=$default_output_format],
69 [test "$verbose_output_format" = no],
70 [verbose_output_format=""])
71AC_DEFINE_UNQUOTED([STANDARD_OUTPUT_FORMAT], ["$standard_output_format"],
72 [Define the standard plugin output format.])
73AC_DEFINE_UNQUOTED([VERBOSE_OUTPUT_FORMAT], ["$verbose_output_format"],
74 [Define the verbose plugin output format.])
75
43AC_PROG_CC 76AC_PROG_CC
44gl_EARLY 77gl_EARLY
45AC_PROG_GCC_TRADITIONAL 78AC_PROG_GCC_TRADITIONAL
@@ -147,6 +180,11 @@ AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
147AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv") 180AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv")
148AC_SUBST(SOCKETLIBS) 181AC_SUBST(SOCKETLIBS)
149 182
183dnl check for basename(3) which needs -lgen on some systems (e.g. IRIX)
184AC_CHECK_HEADERS([libgen.h])
185AC_SEARCH_LIBS([basename], [gen])
186AC_CHECK_FUNCS([basename])
187
150dnl 188dnl
151dnl check for math-related functions needing -lm 189dnl check for math-related functions needing -lm
152AC_CHECK_HEADERS(math.h) 190AC_CHECK_HEADERS(math.h)