Fix database switches and backend configuration

refs #4941
This commit is contained in:
Marius Hein 2013-10-22 17:49:49 +02:00
parent dd214bbe16
commit bcfc1b56bb
4 changed files with 57 additions and 33 deletions

10
aclocal.m4 vendored
View File

@ -72,3 +72,13 @@ AC_DEFUN([ICINGA_CHECK_DBTYPE], [
AC_MSG_ERROR([$1])
)
])
# ICINGA_CHECK_BACKENDTYPE(BACKENDTYPE, ARGUMENT_NAME)
# ------------------------------------------
AC_DEFUN([ICINGA_CHECK_BACKENDTYPE], [
AC_MSG_CHECKING([Testing backend type for $2])
AS_IF(echo "$1" | $GREP -q "^\(ido\|statusdat\|livestatus\)$",
AC_MSG_RESULT([OK ($1)]),
AC_MSG_ERROR([$1])
)
])

View File

@ -18,7 +18,7 @@ type = db
db = @internal_db_type@
host = @internal_db_host@
port = @internal_db_port@
password = @internal_db_pass@
password = @internal_db_password@
username = @internal_db_user@
dbname = @internal_db_name@
@ -27,14 +27,14 @@ type = db
db = @ido_db_type@
host = @ido_host@
port = @ido_port@
password = @ido_user@
password = @ido_password@
username = @ido_user@
dbname = @ido_database@
dbname = @ido_db_name@
[statusdat]
type = statusdat
status_file = /usr/local/icinga-mysql/var/status.dat
object_file = /usr/local/icinga-mysql/var/objects.cache
status_file = @statusdat_file@
object_file = @objects_cache_file@
[livestatus]
type = livestatus

44
configure vendored
View File

@ -600,7 +600,7 @@ statusdat_file
statusdat_enabled
ido_password
ido_user
ido_database
ido_db_name
ido_port
ido_host
ido_db_type
@ -614,7 +614,7 @@ ldap_binddn
ldap_rootdn
ldap_port
ldap_host
internal_db_pass
internal_db_password
internal_db_user
internal_db_port
internal_db_host
@ -688,7 +688,7 @@ with_internal_db_type
with_internal_db_name
with_internal_db_host
with_internal_db_port
with_internal_db_pass
with_internal_db_password
with_internal_db_user
with_internal_authentication
with_ldap_authentication
@ -703,7 +703,7 @@ with_icinga_backend
with_ido_db_type
with_ido_host
with_ido_port
with_ido_database
with_ido_db_name
with_ido_user
with_ido_password
with_statusdat_file
@ -1347,7 +1347,7 @@ Optional Packages:
--with-internal-db-port=PORT
database port to use for internal database (default:
3306 for mysql, 5432 for pgsql)
--with-internal-db-pass=PASS
--with-internal-db-password=PASS
database pass to use for internal database (default
icingaweb)
--with-internal-db-user=USER
@ -1385,10 +1385,10 @@ Optional Packages:
(default: localhost)
--with-ido-port=PORT backend to use for retrieving data from the ido db
(default: 3306 for mysql. 5432 for pgsql)
--with-ido-database=DATABASE
--with-ido-db-name=DATABASE
database name to use for retrieving data from the
ido db (default: icinga)
--with-ido-host=USER user to use for retrieving data from the ido db
--with-ido-user=USER user to use for retrieving data from the ido db
(default: icinga)
--with-ido-password=PASSWORD
password to use for retrieving data from the ido db
@ -2392,11 +2392,11 @@ fi
# Check whether --with-internal_db_pass was given.
if test "${with_internal_db_pass+set}" = set; then :
withval=$with_internal_db_pass; internal_db_pass=$withval
# Check whether --with-internal_db_password was given.
if test "${with_internal_db_password+set}" = set; then :
withval=$with_internal_db_password; internal_db_password=$withval
else
internal_db_pass=icingaweb
internal_db_password=icingaweb
fi
@ -2523,6 +2523,18 @@ else
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Testing backend type for --with-icinga-backend" >&5
$as_echo_n "checking Testing backend type for --with-icinga-backend... " >&6; }
if echo "$icinga_backend" | $GREP -q "^\(ido\|statusdat\|livestatus\)$"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: OK ($icinga_backend)" >&5
$as_echo "OK ($icinga_backend)" >&6; }
else
as_fn_error $? "$icinga_backend" "$LINENO" 5
fi
#
# Ido settings
#
@ -2570,11 +2582,11 @@ fi
# Check whether --with-ido_database was given.
if test "${with_ido_database+set}" = set; then :
withval=$with_ido_database; ido_database=$withval
# Check whether --with-ido_db_name was given.
if test "${with_ido_db_name+set}" = set; then :
withval=$with_ido_db_name; ido_db_name=$withval
else
ido_database="icinga"
ido_db_name="icinga"
fi
@ -2814,7 +2826,7 @@ fi
fi
#
# Comment out the disabled backends per default
# Disable authentication backends
#
ido_enabled="disabled = \"1\""

View File

@ -118,10 +118,10 @@ AC_ARG_WITH([internal_db_port],
internal_db_port=db_default_port
)
AC_ARG_WITH([internal_db_pass],
AS_HELP_STRING([--with-internal-db-pass=PASS], [database pass to use for internal database (default icingaweb)]),
internal_db_pass=$withval,
internal_db_pass=icingaweb
AC_ARG_WITH([internal_db_password],
AS_HELP_STRING([--with-internal-db-password=PASS], [database pass to use for internal database (default icingaweb)]),
internal_db_password=$withval,
internal_db_password=icingaweb
)
AC_ARG_WITH([internal_db_user],
@ -202,6 +202,8 @@ AC_ARG_WITH([icinga_backend],
icinga_backend="statusdat"
)
ICINGA_CHECK_BACKENDTYPE($icinga_backend, [--with-icinga-backend])
#
# Ido settings
#
@ -226,14 +228,14 @@ AC_ARG_WITH([ido_port],
ido_port=db_default_port
)
AC_ARG_WITH([ido_database],
AS_HELP_STRING([--with-ido-database=DATABASE], [database name to use for retrieving data from the ido db (default: icinga)]),
ido_database=$withval,
ido_database="icinga"
AC_ARG_WITH([ido_db_name],
AS_HELP_STRING([--with-ido-db-name=DATABASE], [database name to use for retrieving data from the ido db (default: icinga)]),
ido_db_name=$withval,
ido_db_name="icinga"
)
AC_ARG_WITH([ido_user],
AS_HELP_STRING([--with-ido-host=USER], [user to use for retrieving data from the ido db (default: icinga)]),
AS_HELP_STRING([--with-ido-user=USER], [user to use for retrieving data from the ido db (default: icinga)]),
ido_user=$withval,
ido_user="icinga"
)
@ -335,7 +337,7 @@ AS_IF([test "x$ido_db_type" = xpgsql], [
])
#
# Comment out the disabled backends per default
# Disable authentication backends
#
ido_enabled="disabled = \"1\""
@ -381,7 +383,7 @@ AC_SUBST(internal_db_name)
AC_SUBST(internal_db_host)
AC_SUBST(internal_db_port)
AC_SUBST(internal_db_user)
AC_SUBST(internal_db_pass)
AC_SUBST(internal_db_password)
# ldap setup
AC_SUBST(ldap_host)
@ -401,7 +403,7 @@ AC_SUBST(ido_enabled)
AC_SUBST(ido_db_type)
AC_SUBST(ido_host)
AC_SUBST(ido_port)
AC_SUBST(ido_database)
AC_SUBST(ido_db_name)
AC_SUBST(ido_user)
AC_SUBST(ido_password)