From b678c5bfea0f1b142c2a4a5bdee1e3309a021887 Mon Sep 17 00:00:00 2001 From: zhipengh Date: Tue, 22 Dec 2015 15:04:53 +0800 Subject: JIRA:PARSER-15 Provide Standalone Heat-Translator Liberty Pypi Packages --- .../data/CSAR/tosca_elk/Scripts/rsyslog/config.sh | 30 ++++++++++++++++++++++ .../data/CSAR/tosca_elk/Scripts/rsyslog/create.sh | 5 ++++ .../data/CSAR/tosca_elk/Scripts/rsyslog/start.sh | 4 +++ 3 files changed, 39 insertions(+) create mode 100644 tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/config.sh create mode 100755 tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/create.sh create mode 100755 tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/start.sh (limited to 'tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog') diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/config.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/config.sh new file mode 100644 index 0000000..630767d --- /dev/null +++ b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/config.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# This script configures the output for rsyslogd to send logs to the +# logstash server port 2514 using the RELP protocol +# The environment variable logstash_ip is expected to be set up +echo "module(load=\"omrelp\") +action(type=\"omrelp\" target=\"$logstash_ip\" port=\"2514\")" > /etc/rsyslog.d/tosca_elk.conf + +# Remove the /dev/xconsole configuration as xconsole +# is not available by default +l=`awk '/=warn.*\|.*\/dev\/xconsole/{print NR - 1}' /etc/rsyslog.d/50-default.conf` +if [ ! -z $l ]; then + l=`expr $l + 1` + line=`cat /etc/rsyslog.d/50-default.conf | head -n $l | tail -1` + if [[ ! $line == \#* ]]; then + l0=`expr $l - 3` + sed -i -r -e "${l0},${l}s/^.{0}/&#/" /etc/rsyslog.d/50-default.conf + fi +fi + +# Enable nodejs logs for rsyslog +if ! grep -q nodeapp "/etc/rsyslog.conf"; then + sed -i 's/\$PrivDropToGroup\ syslog/\$PrivDropToGroup adm/' /etc/rsyslog.conf + echo "\$ModLoad imfile.so +\$InputFileName /var/log/nodeapp.log +\$InputFileTag paypal_pizza: +\$InputFileStateFile stat-nodeapp +\$InputRunFileMonitor +\$InputFilePollInterval 1" >> /etc/rsyslog.conf +fi diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/create.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/create.sh new file mode 100755 index 0000000..affdd6e --- /dev/null +++ b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/create.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# This script installs rsyslog and the library for RELP + +apt-get update +apt-get install -y rsyslog rsyslog-relp diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/start.sh new file mode 100755 index 0000000..3de82d1 --- /dev/null +++ b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/start.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# This script starts rsyslogd as a service in init.d +service rsyslog stop +service rsyslog start -- cgit 1.2.3-korg