/src/htools
/src/hconfd
/src/ganeti-confd
+/src/ganeti-mond
/src/rpc-test
# automatically-built Haskell files
src/Ganeti/HTools/Program \
src/Ganeti/Hypervisor \
src/Ganeti/Hypervisor/Xen \
+ src/Ganeti/Monitoring \
src/Ganeti/Query \
test/hs \
test/hs/Test \
$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
$(HS_BUILT_TEST_HELPERS) \
src/ganeti-confd \
+ src/ganeti-mond \
.hpc/*.mix src/*.tix test/hs/*.tix \
doc/hs-lint.html
if ENABLE_CONFD
HS_GENERATED_FILES += src/hconfd src/ganeti-confd
endif
+
+if ENABLE_MOND
+HS_GENERATED_FILES += src/ganeti-mond
+endif
endif
built_base_sources = \
# Haskell programs to be installed in the MYEXECLIB dir
HS_MYEXECLIB_PROGS=src/mon-collector
-# Haskell programs to compiled but not installed automatically
-# Usually they have their own specific installation rules
+# Haskell programs to be compiled by "make really-all"
HS_COMPILE_PROGS= \
+ src/ganeti-mond \
src/hconfd \
src/rpc-test
src/Ganeti/Jobs.hs \
src/Ganeti/Logging.hs \
src/Ganeti/Luxi.hs \
+ src/Ganeti/Monitoring/Server.hs \
src/Ganeti/Network.hs \
src/Ganeti/Objects.hs \
src/Ganeti/OpCodes.hs \
nodist_sbin_SCRIPTS += src/ganeti-confd
endif
+if ENABLE_MOND
+nodist_sbin_SCRIPTS += src/ganeti-mond
+endif
+
python_scripts = \
tools/cfgshell \
tools/cfgupgrade \
man/ganeti-confd.8 \
man/ganeti-listrunner.8 \
man/ganeti-masterd.8 \
+ man/ganeti-mond.8 \
man/ganeti-noded.8 \
man/ganeti-os-interface.7 \
man/ganeti-extstorage-interface.7 \
ENABLE_MOND=
AC_ARG_ENABLE([monitoring],
[AS_HELP_STRING([--enable-monitoring],
- [enable the ganeti monitoring agent (default: check)])],
+ [enable the ganeti monitoring daemon (default: check)])],
[],
[enable_monitoring=check])
AC_SUBST(ENABLE_CONFD, $has_confd)
AM_CONDITIONAL([ENABLE_CONFD], [test x$has_confd = xTrue])
-#extra modules for monitoring agent functionality
+#extra modules for monitoring daemon functionality
has_monitoring=False
if test "$enable_monitoring" != no; then
MONITORING_PKG=
AC_GHC_PKG_CHECK([attoparsec], [],
[MONITORING_PKG="$MONITORING_PKG attoparsec"])
+ AC_GHC_PKG_CHECK([snap-server], [],
+ [MONITORING_PKG="$MONITORING_PKG snap-server"])
if test -z "$MONITORING_PKG"; then
has_monitoring=True
elif test "$enable_monitoring" = check; then
AC_MSG_WARN(m4_normalize([The required extra libraries for the monitoring
- agent were not found ($MONITORING_PKG),
+ daemon were not found ($MONITORING_PKG),
monitoring disabled]))
else
AC_MSG_FAILURE(m4_normalize([The monitoring functionality was requested, but
fi
fi
if test "$has_monitoring" = True; then
- AC_MSG_NOTICE([Enabling the monitoring agent usage])
+ AC_MSG_NOTICE([Enabling the monitoring daemon usage])
fi
AC_SUBST(ENABLE_MOND, $has_monitoring)
AM_CONDITIONAL([ENABLE_MOND], [test "$has_monitoring" = True])
DAEMONS+=( ganeti-confd )
fi
+_mond_enabled() {
+ [[ "@CUSTOM_ENABLE_MOND@" == True ]]
+}
+
+if _mond_enabled; then
+ DAEMONS+=( ganeti-mond )
+fi
+
NODED_ARGS=
MASTERD_ARGS=
CONFD_ARGS=
RAPI_ARGS=
+MOND_ARGS=
# Read defaults file if it exists
if [[ -s $defaults_file ]]; then
noded)
echo "@GNTNODEDUSER@:@GNTDAEMONSGROUP@"
;;
+ mond)
+ echo "@GNTMONDUSER@:@GNTMONDGROUP@"
+ ;;
*)
echo "root:@GNTDAEMONSGROUP@"
;;
# daemon-name: ("proto", "default-port")
NODED: ("tcp", 1811),
CONFD: ("udp", 1814),
+ MOND: ("tcp", 1815),
RAPI: ("tcp", 5080),
SSH: ("tcp", 22),
}
DEFAULT_NODED_PORT = DAEMONS_PORTS[NODED][1]
DEFAULT_CONFD_PORT = DAEMONS_PORTS[CONFD][1]
+DEFAULT_MOND_PORT = DAEMONS_PORTS[MOND][1]
DEFAULT_RAPI_PORT = DAEMONS_PORTS[RAPI][1]
FIRST_DRBD_PORT = 11000
--- /dev/null
+ganeti-mond(8) Ganeti | Version @GANETI_VERSION@
+=================================================
+
+Name
+----
+
+ganeti-mond - Ganeti monitoring daemon
+
+.. vim: set textwidth=72 :
+.. Local Variables:
+.. mode: rst
+.. fill-column: 72
+.. End:
-{-| Ganeti configuration query daemon
+{-# LANGUAGE OverloadedStrings #-}
+
+{-| Implementation of the Ganeti confd server functionality.
-}
{-
-Copyright (C) 2009, 2011, 2012 Google Inc.
+Copyright (C) 2013 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-}
-module Main (main) where
+module Ganeti.Monitoring.Server
+ ( main
+ , checkMain
+ , prepMain
+ ) where
-import qualified Ganeti.Confd.Server
import Ganeti.Daemon
-import Ganeti.Runtime
-import qualified Ganeti.Constants as C
-
--- | Options list and functions.
-options :: [OptType]
-options =
- [ oNoDaemonize
- , oNoUserChecks
- , oDebug
- , oPort C.defaultConfdPort
- , oBindAddress
- , oSyslogUsage
- ]
+
+-- * Types and constants definitions
+
+-- | Type alias for checkMain results.
+type CheckResult = ()
+
+-- | Type alias for prepMain results.
+type PrepResult = ()
+
+-- * Helper functions
+
+-- | Check function for the monitoring agent.
+checkMain :: CheckFn CheckResult
+checkMain _ = return $ Right ()
+
+-- | Prepare function for monitoring agent.
+prepMain :: PrepFn CheckResult PrepResult
+prepMain _ _ = return ()
-- | Main function.
-main :: IO ()
-main =
- genericMain GanetiConfd options
- Ganeti.Confd.Server.checkMain
- Ganeti.Confd.Server.prepMain
- Ganeti.Confd.Server.main
+main :: MainFn CheckResult PrepResult
+main _ _ _ =
+ return ()
-{-| Ganeti configuration query daemon
+{-| Ganeti monitoring agent daemon
-}
{-
-Copyright (C) 2009, 2011, 2012 Google Inc.
+Copyright (C) 2013 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
module Main (main) where
-import qualified Ganeti.Confd.Server
+import qualified Ganeti.Monitoring.Server
import Ganeti.Daemon
import Ganeti.Runtime
import qualified Ganeti.Constants as C
[ oNoDaemonize
, oNoUserChecks
, oDebug
- , oPort C.defaultConfdPort
- , oBindAddress
- , oSyslogUsage
+ , oPort C.defaultMondPort
]
-- | Main function.
main :: IO ()
main =
- genericMain GanetiConfd options
- Ganeti.Confd.Server.checkMain
- Ganeti.Confd.Server.prepMain
- Ganeti.Confd.Server.main
+ genericMain GanetiMond options
+ Ganeti.Monitoring.Server.checkMain
+ Ganeti.Monitoring.Server.prepMain
+ Ganeti.Monitoring.Server.main
err "Please update $0, confd enable feature is missing"
fi
+if ! grep -q '^ENABLE_MOND = ' lib/_autoconf.py; then
+ err "Please update $0, mond enable feature is missing"
+fi
+
+DAEMONS_LIST="noded masterd rapi"
+STOPDAEMONS_LIST="rapi masterd noded"
+
if grep -q '^ENABLE_CONFD = True' lib/_autoconf.py; then
- DAEMONS="$(echo ganeti-{noded,masterd,rapi,confd})"
- STOPDAEMONS="$(echo ganeti-{confd,rapi,masterd,noded})"
-else
- DAEMONS="$(echo ganeti-{noded,masterd,rapi})"
- STOPDAEMONS="$(echo ganeti-{rapi,masterd,noded})"
+ DAEMONS_LIST="$DAEMONS_LIST confd"
+ STOPDAEMONS_LIST="confd $STOPDAEMONS_LIST"
fi
+if grep -q '^ENABLE_MOND = True' lib/_autoconf.py; then
+ DAEMONS_LIST="$DAEMONS_LIST mond"
+ STOPDAEMONS_LIST="mond $STOPDAEMONS_LIST"
+fi
+
+DAEMONS=$(echo $(for d in $DAEMONS_LIST; do echo "ganeti-$d"; done))
+STOPDAEMONS=$(echo $(for d in $STOPDAEMONS_LIST; do echo "ganeti-$d"; done))
+
$daemon_util >/dev/null 2>&1 &&
err "daemon-util succeeded without command"