Merge pull request #167 from ronivay/feat/remote-syslog
This commit is contained in:
@@ -106,3 +106,9 @@ PRESERVE="3"
|
||||
# options: true/false
|
||||
# default: true
|
||||
#INSTALL_REPOS="true"
|
||||
|
||||
# Send xo-server logs to remote syslog
|
||||
# syntax is: <protocol>://<target-address>:<port>
|
||||
# supported protocols are udp and tcp
|
||||
# example: tcp://syslog.company.lan:514
|
||||
#SYSLOG_TARGET=""
|
||||
|
@@ -47,6 +47,7 @@ ACME_CA="${ACME_CA:-"letsencrypt/production"}"
|
||||
USESUDO="${USESUDO:-"false"}"
|
||||
GENSUDO="${GENSUDO:-"false"}"
|
||||
INSTALL_REPOS="${INSTALL_REPOS:-"true"}"
|
||||
SYSLOG_TARGET="${SYSLOG_TARGET:-""}"
|
||||
|
||||
# set variables not changeable in configfile
|
||||
TIME=$(date +%Y%m%d%H%M)
|
||||
@@ -803,6 +804,12 @@ function InstallXO {
|
||||
runcmd "chown -R $XOUSER:$XOUSER $INSTALLDIR/mounts"
|
||||
fi
|
||||
|
||||
if [[ -n "$SYSLOG_TARGET" ]]; then
|
||||
printinfo "Enabling remote syslog in xo-server configuration file"
|
||||
runcmd "sed -i \"s%#\[logs.transport.syslog\]%\[logs.transport.syslog\]%\" $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server/sample.config.toml"
|
||||
runcmd "sed -i \"/^\[logs.transport.syslog.*/a target = '$SYSLOG_TARGET'\" $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server/sample.config.toml"
|
||||
fi
|
||||
|
||||
printinfo "Activating modified configuration file"
|
||||
runcmd "mkdir -p $CONFIGPATH/.config/xo-server"
|
||||
runcmd "mv -f $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server/sample.config.toml $CONFIGPATH/.config/xo-server/config.toml"
|
||||
|
Reference in New Issue
Block a user