-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit dfb1668
Showing
17 changed files
with
242 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
config/dev.yml | ||
config/private.yml | ||
releases/*.tgz | ||
dev_releases | ||
blobs | ||
.blobs | ||
.dev_builds | ||
.idea | ||
.final_builds/jobs/**/*.tgz | ||
.final_builds/packages/**/*.tgz | ||
releases/**/*.tgz | ||
.DS_Store | ||
tmp | ||
*.swp | ||
*.tgz | ||
*.zip | ||
*~ | ||
*# | ||
#* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# bosh-oneagent-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
name: dynatrace-oneagent | ||
director_uuid: 6da39200-116d-4af2-9b71-d3e615a13074 | ||
|
||
releases: | ||
- name: dynatrace-oneagent | ||
version: latest | ||
|
||
stemcells: | ||
- alias: default | ||
os: ubuntu-trusty | ||
version: latest | ||
|
||
update: | ||
canaries: 1 | ||
max_in_flight: 32 | ||
canary_watch_time: 1000-300000 | ||
update_watch_time: 1000-300000 | ||
serial: false | ||
|
||
instance_groups: | ||
- name: dynatrace-test-job | ||
instances: 0 | ||
jobs: | ||
- name: dynatrace-test-job | ||
release: dynatrace-oneagent | ||
vm_type: default | ||
stemcell: default | ||
persistent_disk_type: default | ||
azs: | ||
- default | ||
networks: | ||
- name: public | ||
- name: dynatrace-agent | ||
instances: 0 | ||
jobs: | ||
- name: dynatrace-agent | ||
release: dynatrace-agent | ||
vm_type: default | ||
azs: | ||
- default | ||
stemcell: default | ||
networks: | ||
- name: default | ||
|
||
properties: | ||
dynatrace: | ||
downloadurl: https://<environmentid>.live.dynatrace.com/installer/agent/unix/latest/<token> | ||
processhooking: 1 | ||
proxy: | ||
applogaccess: 1 | ||
test_message: Test Deployment of Dynatrace OneAgent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
check process dynatrace-oneagent | ||
with pidfile /var/vcap/sys/run/dynatrace-oneagent/dynatrace-watchdog.pid | ||
start program "/var/vcap/jobs/dynatrace-oneagent/bin/dynatrace-oneagent.sh start" | ||
with timeout 600 seconds | ||
stop program "/var/vcap/jobs/dynatrace-oneagent/bin/dynatrace-oneagent.sh stop" | ||
with timeout 120 seconds | ||
group vcap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
name: dynatrace-oneagent | ||
templates: | ||
dynatrace-oneagent.sh.erb: bin/dynatrace-oneagent.sh | ||
|
||
packages: | ||
- dynatrace-oneagent | ||
|
||
properties: | ||
dynatrace.downloadurl: | ||
description: 'Download URL for OneAgent' | ||
dynatrace.proxy: | ||
description: 'Proxy for Server' | ||
dynatrace.processhooking: | ||
description: 'Enable deep monitoring' | ||
dynatrace.applogaccess: | ||
description: 'Enable access to discovered application log files content' |
60 changes: 60 additions & 0 deletions
60
jobs/dynatrace-oneagent/templates/dynatrace-oneagent.sh.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
set -e -x | ||
|
||
export PATH="/var/vcap/packages/dynatrace-oneagent:$PATH" | ||
|
||
export PROXY=<%= properties.dynatrace.proxy %> | ||
export DOWNLOADURL=<%= properties.dynatrace.downloadurl %> | ||
export PROCESSHOOKING=<%= properties.dynatrace.processhooking %> | ||
export APP_LOG_CONTENT_ACCESS=<%= properties.dynatrace.applogaccess %> | ||
|
||
ARGS="" | ||
if [ "$PROXY" != "" ]; then | ||
ARGS="$ARGS PROXY=$PROXY" | ||
fi | ||
if [ "$PROCESSHOOKING" != "" ]; then | ||
ARGS="$ARGS PROCESSHOOKING=$PROCESSHOOKING" | ||
fi | ||
if [ "$APP_LOG_CONTENT_ACCESS" != "" ]; then | ||
ARGS="$ARGS APP_LOG_CONTENT_ACCESS=$APP_LOG_CONTENT_ACCESS" | ||
fi | ||
|
||
|
||
RUN_DIR=/var/vcap/sys/run/dynatrace-oneagent | ||
LOG_DIR=/var/vcap/sys/log/dynatrace-oneagent | ||
mkdir -p ${RUN_DIR} ${LOG_DIR} | ||
|
||
|
||
getWatchdogPid() { | ||
local AGENT_BIN=oneagentos | ||
local AGENT_WATCHDOG=oneagentwatchdog | ||
|
||
# grep -v "grep" is required, because ps -ef returns also "grep '${AGENT_WATCHDOG}.*${AGENT_BIN}"' process | ||
# grep -v "sudo" it is enough to use "direct" watchdog pids, filter sudo calls with watchdog params. | ||
ps -ef | grep "${AGENT_WATCHDOG}" | grep "${AGENT_BIN}" | grep -v "grep" | grep -v "sudo" | awk ' { print $2 } ' | ||
} | ||
|
||
|
||
if [ ! -d /opt/dynatrace/oneagent ]; then | ||
curl -L -o /tmp/Dynatrace-OneAgent-Linux.sh $DOWNLOADURL | ||
chmod 755 /tmp/Dynatrace-OneAgent-Linux.sh | ||
sh /tmp/Dynatrace-OneAgent-Linux.sh $ARGS >> $LOG_DIR/dynatrace-install.log 2>> $LOG_DIR/dynatrace-install.log | ||
fi | ||
|
||
case $1 in | ||
start) | ||
pid=$(getWatchdogPid) | ||
# If the watchdog was stopped or rolled over... | ||
if [ "$pid" == "" ]; then | ||
curl -L -o /tmp/Dynatrace-OneAgent-Linux.sh $DOWNLOADURL | ||
chmod 755 /tmp/Dynatrace-OneAgent-Linux.sh | ||
sh /tmp/Dynatrace-OneAgent-Linux.sh $ARGS >> $LOG_DIR/dynatrace-install.log 2>> $LOG_DIR/dynatrace-install.log | ||
pid=$(getWatchdogPid) | ||
fi | ||
echo $pid > ${RUN_DIR}/dynatrace-watchdog.pid | ||
;; | ||
|
||
stop) | ||
sh /opt/dynatrace/oneagent/agent/uninstall.sh | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
check process dynatrace-test-job | ||
with pidfile /var/vcap/sys/run/dynatrace-test-job/dynatrace-test-job.pid | ||
start program "/var/vcap/jobs/dynatrace-test-job/bin/dynatrace-test-job.sh start" | ||
with timeout 600 seconds | ||
stop program "/var/vcap/jobs/dynatrace-test-job/bin/dynatrace-test-job.sh stop" | ||
with timeout 120 seconds | ||
group vcap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: dynatrace-test-job | ||
templates: | ||
dynatrace-test-job.sh.erb: bin/dynatrace-test-job.sh | ||
|
||
packages: | ||
- dynatrace-oneagent | ||
|
||
properties: | ||
dynatrace.test_message: | ||
description: 'Dynatrace Test Job' |
24 changes: 24 additions & 0 deletions
24
jobs/dynatrace-test-job/templates/dynatrace-test-job.sh.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
set -e -x | ||
|
||
export PATH="/var/vcap/packages/dynatrace-oneagent:$PATH" | ||
|
||
export TEST_MSG=<%= properties.dynatrace.test_message %> | ||
|
||
RUN_DIR=/var/vcap/sys/run/dynatrace-test-job | ||
LOG_DIR=/var/vcap/sys/log/dynatrace-test-job | ||
mkdir -p ${RUN_DIR} ${LOG_DIR} | ||
|
||
|
||
|
||
case $1 in | ||
start) | ||
echo $TEST_MSG >> ${LOG_DIR}/dynatrace-test-job.log | ||
tail -f /dev/null & echo $! > ${RUN_DIR}/dynatrace-test-job.pid | ||
pid=$(echo $!) | ||
;; | ||
|
||
stop) | ||
kill -9 `cat ${RUN_DIR}/dynatrace-test-job.pid` | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# abort script on any command that exits with a non zero value | ||
set -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# abort script on any command that exits with a non zero value | ||
set -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
name: dynatrace-oneagent | ||
|
||
dependencies: | ||
|
||
files: | ||
- dynatrace-oneagent/placeholder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Change me | ||
VERSION=0.1 | ||
|
||
bosh deployment dynatrace-oneagent-deployment-manifest.yml | ||
bosh -n delete deployment dynatrace-oneagent | ||
bosh -n delete release dynatrace-oneagent | ||
rm -rf dev_releases | ||
bosh create release --with-tarball --version $VERSION | ||
bosh upload release | ||
bosh -n deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
bosh deployment dynatrace-oneagent-deployment-manifest.yml | ||
bosh -n delete deployment dynatrace-oneagent | ||
bosh -n delete release dynatrace-oneagent | ||
bosh create release | ||
bosh upload release | ||
bosh -n deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
releases: | ||
- name: dynatrace-oneagent | ||
version: 0.1 | ||
|
||
addons: | ||
- name: dynatrace-oneagent | ||
jobs: | ||
- name: dynatrace-oneagent | ||
release: dynatrace-oneagent | ||
|
||
properties: | ||
dynatrace: | ||
downloadurl: https://<environmentid>.live.dynatrace.com/installer/agent/unix/latest/<token> | ||
processhooking: 1 | ||
proxy: | ||
applogaccess: 1 |
Empty file.