-
Notifications
You must be signed in to change notification settings - Fork 22
/
zenoss_startup_config
executable file
·78 lines (66 loc) · 2.38 KB
/
zenoss_startup_config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#! /usr/bin/env bash
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2007, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
##############################################################################
# This script is intended to contain database/application settings required
# during zenoss startup and upgrade
#
# Note: it is run by root
#
function get_var {
VAR_NAME=$1
OUTPUT=`su $RUNUSER -l -c "$ZENHOME/bin/zenglobalconf -p $VAR_NAME"`
if [ $? != 0 ]; then
exit 1
fi
echo $OUTPUT
}
export OS_USERNAME="**OS_USERNAME**"
export RUNUSER=$OS_USERNAME
export OS_UID="**OS_UID**"
export ZENHOME="**ZENHOME**"
export ZOPEPASSWORD="**ZOPE_PASSWD**"
export ZOPEHOME="**ZOPEHOME**"
export PYTHON="**PYTHON**"
export ZOPE_LISTEN_PORT="**ZOPE_LISTEN_PORT**"
export ZOPE_USERNAME="**ZOPE_USERNAME**"
export PYTHONPATH="**PYTHONPATH**"
if [ ! -d "$ZENHOME" ]; then
echo "ZENHOME is not set properly: $ZENHOME"
exit 1
fi
# global conf must be set before we continue
if [ ! -f $ZENHOME/etc/global.conf ]; then
su $RUNUSER -l -c "cp -p $ZENHOME/etc/global.conf.example $ZENHOME/etc/global.conf"
chmod 0600 $ZENHOME/etc/global.conf
fi
# to change the following startup parameters
# modify $ZENHOME/etc/global.conf
export ZODB_DB_TYPE=`get_var zodb-db-type`
export ZODB_HOST="`get_var zodb-host`"
export ZODB_DB="`get_var zodb-db`"
export ZODB_PORT="`get_var zodb-port`"
export ZODB_ADMIN_USER="`get_var zodb-admin-user`"
export ZODB_ADMIN_PASSWORD="`get_var zodb-admin-password`"
export ZODB_USER="`get_var zodb-user`"
export ZODB_PASSWORD="`get_var zodb-password`"
export ZODB_SOCKET="`get_var zodb-socket`"
export ZEP_DB_TYPE="`get_var zep-db-type`"
export ZEP_HOST="`get_var zep-host`"
export ZEP_DB="`get_var zep-db`"
export ZEP_PORT="`get_var zep-port`"
export ZEP_ADMIN_USER="`get_var zep-admin-user`"
export ZEP_ADMIN_PASSWORD="`get_var zep-admin-password`"
export ZEP_USER="`get_var zep-user`"
export ZEP_PASSWORD="`get_var zep-password`"
export RABBITMQ_HOST="`get_var amqphost`"
export RABBITMQ_SSL="`get_var amqpusessl`"
export RABBITMQ_PORT="`get_var amqpport`"
export RABBITMQ_VHOST="`get_var amqpvhost`"
export RABBITMQ_USER="`get_var amqpuser`"
export RABBITMQ_PASS="`get_var amqppassword`"