diff options
author | Holger Weiss <hweiss@users.sourceforge.net> | 2009-04-22 00:28:53 +0200 |
---|---|---|
committer | Holger Weiss <hweiss@users.sourceforge.net> | 2009-05-10 13:37:35 +0200 |
commit | 006597a12d28d9cd752b3eeb56dff3bc97049f4c (patch) | |
tree | 26e322d4b996b901e0d928e11bba46658646b30f /configure.in | |
parent | dd52d7e5e7acfd42243bc1ce173a0bf5d62fe347 (diff) | |
download | monitoring-plugins-refs/heads/hw/output/functions.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.in | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 68ac0a00..a4b5e968 100644 --- a/configure.in +++ b/configure.in | |||
@@ -39,6 +39,39 @@ INSTALL="$INSTALL $extra_install_args" | |||
39 | INSTALL_STRIP_PROGRAM="$INSTALL_STRIP_PROGRAM $extra_install_args" | 39 | INSTALL_STRIP_PROGRAM="$INSTALL_STRIP_PROGRAM $extra_install_args" |
40 | AC_SUBST(INSTALL) | 40 | AC_SUBST(INSTALL) |
41 | 41 | ||
42 | dnl Configure the plugin output format | ||
43 | default_output_format="%s %x: %i\n" | ||
44 | AC_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"]) | ||
53 | AC_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"]) | ||
62 | AS_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=""]) | ||
70 | AC_DEFINE_UNQUOTED([STANDARD_OUTPUT_FORMAT], ["$standard_output_format"], | ||
71 | [Define the standard plugin output format.]) | ||
72 | AC_DEFINE_UNQUOTED([VERBOSE_OUTPUT_FORMAT], ["$verbose_output_format"], | ||
73 | [Define the verbose plugin output format.]) | ||
74 | |||
42 | AC_PROG_CC | 75 | AC_PROG_CC |
43 | gl_EARLY | 76 | gl_EARLY |
44 | AC_PROG_GCC_TRADITIONAL | 77 | AC_PROG_GCC_TRADITIONAL |
@@ -150,6 +183,11 @@ AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket") | |||
150 | AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv") | 183 | AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv") |
151 | AC_SUBST(SOCKETLIBS) | 184 | AC_SUBST(SOCKETLIBS) |
152 | 185 | ||
186 | dnl check for basename(3) which needs -lgen on some systems (e.g. IRIX) | ||
187 | AC_CHECK_HEADERS([libgen.h]) | ||
188 | AC_SEARCH_LIBS([basename], [gen]) | ||
189 | AC_CHECK_FUNCS([basename]) | ||
190 | |||
153 | dnl | 191 | dnl |
154 | dnl check for math-related functions needing -lm | 192 | dnl check for math-related functions needing -lm |
155 | AC_CHECK_HEADERS(math.h) | 193 | AC_CHECK_HEADERS(math.h) |