-
Notifications
You must be signed in to change notification settings - Fork 3
1-5-2-1-SpikeScript #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
oam1809
wants to merge
62
commits into
master
Choose a base branch
from
1-5-2-1-SpikeScript
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
94d8be1
Add existing file
oam1809 5fee566
Add SpikeScript
oam1809 edc05fd
Add SpikeScript.conf
oam1809 88b3bf5
Add SpikeScript.sh
oam1809 b0b3284
test-Setup
oam1809 1c8a51a
test-Setup
oam1809 15ffb00
test-Setup
oam1809 c3ed07d
Script Updated
oam1809 0cc2e0b
conf file Updated
oam1809 59f6340
test server connection
oam1809 4267100
updated script
oam1809 71b05dc
retrieve-metrics
oam1809 762a455
retrieve metrics from server
oam1809 840cbc7
Push data to InfluxDB
oam1809 867b7c6
updated conf file
oam1809 cc77207
Create Make
oam1809 4f8bdd8
updated file
oam1809 08f8f90
updating Makefile
oam1809 325f4df
updated Makefile
oam1809 8adbbef
updated
oam1809 51a304a
updated
oam1809 742659c
updated
oam1809 e3a2ac4
updated
oam1809 b59c9fc
Test improvements + db name correction
6dc83d3
Add existing file
oam1809 744edff
Add SpikeScript
oam1809 479afec
Add SpikeScript.conf
oam1809 1e4976c
Add SpikeScript.sh
oam1809 3a5fc2a
test-Setup
oam1809 34f08a1
test-Setup
oam1809 dcbc346
test-Setup
oam1809 cdd601d
Script Updated
oam1809 4f1b785
conf file Updated
oam1809 ca1a0b3
test server connection
oam1809 e33fb92
updated script
oam1809 5538c90
retrieve-metrics
oam1809 94f511b
retrieve metrics from server
oam1809 168c293
Push data to InfluxDB
oam1809 2bbc2cc
updated conf file
oam1809 a1695b5
Create Make
oam1809 2ee6bd4
updated file
oam1809 b9e70f2
updating Makefile
oam1809 a9c60e8
updated Makefile
oam1809 a97b5b2
updated
oam1809 f14028a
updated
oam1809 787ab3c
updated
oam1809 336f38e
updated
oam1809 b5e1fa1
resolved merge conflicts
14bfaab
resolved conflict for 40-PushToInflux
f30e393
add test/SpikeScript/40-pushtoinflux.sh
722c2c0
demo
644753c
Dashboard corrections
eae2e63
Verbose wget.
mrrusof ec89267
Merge branch 'Demo' into 1-5-2-1-SpikeScript
oam1809 3ee167f
commit branch
oam1809 a24d37f
Delete 20-server-connection-test.sh.orig
oam1809 7f1f1de
Delete 40-pushtoinflux.sh.orig
oam1809 7bd2df9
Delete 50-verify-data.sh.orig
oam1809 a53eb77
Delete 90-teardown.sh.orig
oam1809 e3080e6
Delete Makefile.orig
oam1809 5f95626
Delete spike-script.conf.orig
oam1809 f378a97
Delete Makefile.orig
oam1809 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| *~ | ||
| *~ | ||
| *.Ds_store |
This file contains hidden or 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
This file contains hidden or 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,12 @@ | ||
| FROM ubuntu:xenial | ||
|
|
||
| MAINTAINER [email protected] | ||
|
|
||
| RUN apt-get update && apt-get install -y openssh-server | ||
| RUN apt-get install -y curl | ||
| RUN apt-get install -y iproute2 | ||
| RUN apt-get install -y sshpass | ||
| COPY SpikeScript.sh / | ||
| COPY SpikeScript.conf / | ||
| COPY start-and-initialize.sh / | ||
| CMD ["/start-and-initialize.sh"] |
This file contains hidden or 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,4 @@ | ||
| USERNAME="root" | ||
| PASSWORD="root" | ||
| IPADDRESS="monitor_system" | ||
| HOST="influx_system" | ||
This file contains hidden or 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,50 @@ | ||
| #!/bin/bash | ||
|
|
||
| end=$((SECONDS+2400000)) | ||
| # | ||
| #need to add check if sysstat is installed. | ||
| # | ||
|
|
||
| source SpikeScript.conf | ||
| echo $USERNAME | ||
| echo $PASSWORD | ||
| echo $IPADDRESS | ||
| while [ $SECONDS -lt $end ]; do | ||
| ################## | ||
| #get data from external server | ||
| ################## | ||
|
|
||
| NOW=$(date +"%s") | ||
|
|
||
| MEMORY=$(sshpass -p "$PASSWORD" ssh -tt -o "StrictHostKeyChecking no" $USERNAME@$IPADDRESS free -m | awk 'NR==2{printf "%.2g", $3*100/$2 }') | ||
|
|
||
| CPU=$(sshpass -p "$PASSWORD" ssh -tt $USERNAME@$IPADDRESS top -bn1 | grep load | awk '{printf "%.2g", $(NF-2)}') | ||
|
|
||
| #For the following metrics, sysstat needs to be installed | ||
| DISKREADSEC=$(sshpass -p "$PASSWORD" ssh -tt $USERNAME@$IPADDRESS iostat -dx | tail -n 2 | awk '{ print $4; }') | ||
| DISKWRITESEC=$(sshpass -p "$PASSWORD" ssh -tt $USERNAME@$IPADDRESS iostat -dx | tail -n 2 | awk '{ print $5; }') | ||
|
|
||
| ################## | ||
| #POST to InfluxDB | ||
| ################## | ||
|
|
||
| #meaningful db name - spikescript | ||
|
|
||
| #POST CPU utilization to Influxdb | ||
| curl -i -XPOST 'http://'$HOST':8086/write?db=snapshot&precision=s' --data-binary 'cpu_load_short,host=server01,region=us-west value='$CPU' '$NOW'' | ||
|
|
||
| #POST Memory utilization to Influxdb | ||
| curl -i -XPOST 'http://'$HOST':8086/write?db=snapshot&precision=s' --data-binary 'mem_load_short,host=server01,region=us-west value='$MEMORY' '$NOW'' | ||
|
|
||
| #POST Disk read to Influxdb | ||
| curl -i -XPOST 'http://'$HOST':8086/write?db=snapshot&precision=s' --data-binary 'disk_read_short,host=server01,region=us-west value='$DISKREADSEC' '$NOW'' | ||
|
|
||
| #POST Disk write to Influxdb | ||
| curl -i -XPOST 'http://'$HOST':8086/write?db=snapshot&precision=s' --data-binary 'disk_write_short,host=server01,region=us-west value='$DISKWRITESEC' '$NOW'' | ||
|
|
||
| #printf "Memory\t\tDisk\t\tCPU\n" | ||
| #echo "$CPU $MEMORY $DISKWRITESEC" | ||
|
|
||
| sleep 10 | ||
| done | ||
|
|
This file contains hidden or 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,4 @@ | ||
| #!/bin/bash | ||
|
|
||
| #run spikescript | ||
| ./SpikeScript.sh |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,11 +1,9 @@ | ||
| all: test | ||
| all: test | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove trailing space |
||
|
|
||
| test: | ||
| @for d in ./test/*; do \ | ||
| echo TEST $$d; \ | ||
| cd $$d; \ | ||
| $(MAKE); \ | ||
| cd -; \ | ||
| done | ||
|
|
||
| .PHONY: all test | ||
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,14 +1,33 @@ | ||
| version: '3' | ||
|
|
||
| #do not change container names | ||
|
|
||
| services: | ||
| influxdb: | ||
| build: influxdb | ||
| container_name: influx_system | ||
| ports: | ||
| - 8086:8086 | ||
| - 2003:2003 | ||
| grafana: | ||
| build: grafana | ||
| container_name: grafana_system | ||
| ports: | ||
| - 3000:3000 | ||
| depends_on: | ||
| - influxdb | ||
|
|
||
| monitor: | ||
| build: monitor | ||
| container_name: monitor_system | ||
|
|
||
| spike: | ||
| build: 1-5-2-1-SpikeScript | ||
| container_name: spike_system | ||
| depends_on: | ||
| - monitor | ||
|
|
||
| jmeter: | ||
| build: jmeter | ||
| container_name: jmeter_system | ||
|
|
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -2,6 +2,12 @@ FROM influxdb:1.2 | |
|
|
||
| MAINTAINER [email protected] | ||
|
|
||
|
|
||
| RUN mkdir -p /workspace | ||
| COPY additional.conf /workspace | ||
| RUN cat /workspace/additional.conf >>/etc/influxdb/influxdb.conf | ||
|
|
||
|
|
||
| # Create databases | ||
| COPY start-and-initialize.sh / | ||
| CMD ["/start-and-initialize.sh"] | ||
| COPY start-and-initialize.sh /workspace | ||
| CMD ["/workspace/start-and-initialize.sh"] | ||
This file contains hidden or 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,12 @@ | ||
| [[graphite]] | ||
| enabled = true | ||
| bind-address = ":2003" | ||
| database = "jmeter" | ||
| retention-policy = "" | ||
| protocol = "tcp" | ||
| batch-size = 5000 | ||
| batch-pending = 10 | ||
| batch-timeout = "1s" | ||
| consistency-level = "one" | ||
| separator = "." | ||
| upd-read-buffer = 0 |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use this file instead of configuring this variables in compose.