This will be needed for the data collectors of the monitoring agent.
* Detection of the library
* Creation of the appropriate variables
* Update to the installation documentation
INSTALL | 13 ++++++++-----
Makefile.am | 6 ++++++
configure.ac | 34 ++++++++++++++++++++++++++++++++++
lib/constants.py | 1 +
4 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/INSTALL b/INSTALL
index 0087e53..44088b6 100644
--- a/INSTALL
+++ b/INSTALL
@@ -168,9 +168,9 @@ Haskell optional features
Optionally, more functionality can be enabled if your build machine has
a few more Haskell libraries enabled: RAPI access to remote cluster from
-htools (``--enable-htools-rapi``) and enabling the ``ganeti-confd``
-daemon (``--enable-confd``). The list of extra dependencies for these
-is:
+htools (``--enable-htools-rapi``), the ``ganeti-confd``
+daemon (``--enable-confd``) and the monitoring agent
+(``--enable-monitoring``). The list of extra dependencies for these is:
- `curl <
http://hackage.haskell.org/package/curl>`_, tested with
versions 1.3.4 and above
@@ -182,16 +182,19 @@ is:
- `hinotify <
http://hackage.haskell.org/package/hinotify>`_
- `regex-pcre <
http://hackage.haskell.org/package/regex-pcre>`_,
bindings for the ``pcre`` library
+- `attoparsec <
http://hackage.haskell.org/package/attoparsec>`_
These libraries are available in Debian Wheezy (but not in Squeeze, with
the exception of curl), so you can use either apt::
$ apt-get install libghc-hslogger-dev libghc-crypto-dev libghc-text-dev \
- libghc-hinotify-dev libghc-regex-pcre-dev libghc-curl-dev
+ libghc-hinotify-dev libghc-regex-pcre-dev libghc-curl-dev \
+ libghc-attoparsec-dev
or ``cabal``::
- $ cabal install hslogger Crypto text hinotify regex-pcre curl
+ $ cabal install hslogger Crypto text hinotify regex-pcre curl \
+ attoparsec
to install them.
diff --git a/Makefile.am b/Makefile.am
index d6bf864..06e2e21 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -627,6 +627,7 @@ $(HS_ALL_PROGS): %: %.hs $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS) Makefile
$(GHC) --make \
$(HFLAGS) \
$(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) $(HTOOLS_REGEX_PCRE) \
+ $(NO_ATTOPARSEC) \
-osuf $(notdir $@).o -hisuf $(notdir $@).hi \
$(HEXTRA) $(HEXTRA_INT) $@
@touch "$@"
@@ -1251,6 +1252,7 @@ lib/_autoconf.py: Makefile | stamp-directories
echo "QEMUIMG_PATH = '$(QEMUIMG_PATH)'"; \
echo "HTOOLS = True"; \
echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
+ echo "ENABLE_MONITORING = $(ENABLE_MONITORING)"; \
echo "XEN_CMD = '$(XEN_CMD)'"; \
echo "ENABLE_SPLIT_QUERY = $(ENABLE_SPLIT_QUERY)"; \
} > $@
@@ -1615,6 +1617,9 @@ hs-apidoc: $(HS_BUILT_SRCS)
if [ "$(HTOOLS_REGEX_PCRE)" ]; \
then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_REGEX_PCRE)"; \
fi; \
+ if [ "$(NO_ATTOPARSEC)" ]; \
+ then OPTGHC="$$OPTGHC --optghc=$(NO_ATTOPARSEC)"; \
+ fi; \
RELSRCS="$(HS_LIB_SRCS:htools/%=%) $(patsubst htools/%,%,$(filter htools/%,$(HS_BUILT_SRCS)))"; \
for file in $$RELSRCS; do \
hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
@@ -1633,6 +1638,7 @@ TAGS: $(GENERATED_FILES)
$(GHC) -e ":etags" -v0 \
$(filter-out -O -Werror,$(HFLAGS)) \
$(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) $(HTOOLS_REGEX_PCRE) \
+ $(NO_ATTOPARSEC) \
$(HS_LIBTEST_SRCS)
find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
-path './daemons/ganeti-*' -o -path './tools/*' -o \
diff --git a/
configure.ac b/
configure.ac
index 14554a3..a430cc8 100644
--- a/
configure.ac
+++ b/
configure.ac
@@ -416,6 +416,13 @@ AC_ARG_ENABLE([confd],
[],
[enable_confd=check])
+ENABLE_MONITORING=
+AC_ARG_ENABLE([monitoring],
+ [AS_HELP_STRING([--enable-monitoring],
+ [enable the ganeti monitoring agent (default: check)])],
+ [],
+ [enable_monitoring=check])
+
# Check for ghc
AC_ARG_VAR(GHC, [ghc path])
AC_PATH_PROG(GHC, [ghc], [])
@@ -492,6 +499,33 @@ fi
AC_SUBST(ENABLE_CONFD, $has_confd)
AM_CONDITIONAL([ENABLE_CONFD], [test x$has_confd = xTrue])
+#extra modules for monitoring agent functionality
+has_monitoring=False
+if test "$enable_monitoring" != "no"; then
+ NO_ATTOPARSEC=-DNO_ATTOPARSEC
+ MONITORING_PKG=
+ AC_GHC_PKG_CHECK([attoparsec], [NO_ATTOPARSEC=], [MONITORING_PKG="$MONITORING_PKG attoparsec"])
+ if test -z "$MONITORING_PKG"; then
+ has_monitoring=True
+ else
+ if test "$enable_monitoring" = "check"; then
+ AC_MSG_WARN(m4_normalize([The required extra libraries for the monitoring
+ agent were not found ($MONITORING_PKG),
+ monitoring disabled]))
+ else
+ AC_MSG_FAILURE(m4_normalize([The monitoring functionality was requested, but
+ required libraries were not found:
+ $MONITORING_PKG]))
+ fi
+ fi
+fi
+if test "$has_monitoring" = "True"; then
+ AC_MSG_NOTICE([Enabling the monitoring agent usage])
+fi
+AC_SUBST(ENABLE_MONITORING, $has_monitoring)
+AC_SUBST(NO_ATTOPARSEC)
+AM_CONDITIONAL([ENABLE_MONITORING], [test x$has_monitoring = xTrue])
+
# development modules
HTOOLS_NODEV=
AC_GHC_PKG_CHECK([QuickCheck-2.*], [], [HTOOLS_NODEV=1], t)
diff --git a/lib/constants.py b/lib/constants.py
index 5bcccd9..218b191 100644
--- a/lib/constants.py
+++ b/lib/constants.py
@@ -139,6 +139,7 @@ ADOPTABLE_BLOCKDEV_ROOT = "/dev/disk/"
ENABLE_FILE_STORAGE = _autoconf.ENABLE_FILE_STORAGE
ENABLE_SHARED_FILE_STORAGE = _autoconf.ENABLE_SHARED_FILE_STORAGE
ENABLE_CONFD = _autoconf.ENABLE_CONFD
+ENABLE_MONITORING = _autoconf.ENABLE_MONITORING
ENABLE_SPLIT_QUERY = _autoconf.ENABLE_SPLIT_QUERY
NODED = "ganeti-noded"
--
1.7.7.3