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
apiVersion: extensions/v1beta1 | |
kind: DaemonSet | |
metadata: | |
name: sematext-agent | |
spec: | |
template: | |
metadata: | |
labels: | |
app: sematext-agent | |
spec: |
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
# Run Job Definition: nomad run sematext-agent-docker.nomad | |
# https://www.hashicorp.com/blog/nomad.html | |
# More Info: https://hub.docker.com/r/sematext/sematext-agent-docker/ | |
# http://blog.sematext.com/2015/12/15/docker-logging-partner-sematext-logsene/ | |
job "sematext-agent-docker" { | |
# set your region here | |
region = "global" | |
# Mandatory, parameter pls. change! | |
datacenters = ["us-west-1"] | |
# run this job globally |
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
spm-client: | |
image: sematext/spm-client | |
container_name: spm-client | |
# share the network with the host to reach ES on localhost:9200 | |
net: host | |
environment: | |
# SPM Token from http://apps.sematext.com | |
- SPM_CONFIG=${SPM_TOKEN} es standalone | |
volumes: | |
# spm-client > v1.31.65 requires access to docker socket |
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
export SLACK_TOKEN=slack_token_here # https://api.slack.com/web | |
export LOGSENE_TOKEN=logsene_token_here # https://sematext.com/logsene | |
export LOGSENE_URL=https://logsene-receiver.sematext.com:443 | |
node ./slack.js $SLACK_TOKEN | logagent -t $LOGSENE_TOKEN |
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
export UUSER=seti123 | |
export UHOST=aldebaran.uberspace.de | |
cd ~/.ssh | |
ssh-keygen -t rsa -b 4096 -f uberspace_rsa4096 | |
cat ~/.ssh/uberspace_rsa4096.pub | ssh -p 4022 $UUSER@$UHOST 'cat >> .ssh/authorized_keys' | |
cat <<EOF >> ~/.ssh/config | |
Host $UHOST | |
Port 22 | |
IdentityFile ~/.ssh/uberspace_rsa4096 |
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
export SWARM_TOKEN=$(docker run swarm create) | |
docker-machine create \ | |
-d virtualbox \ | |
--engine-env 'DOCKER_OPTS="-H unix:///var/run/docker.sock"' \ | |
--swarm \ | |
--swarm-master \ | |
--swarm-discovery token://$SWARM_TOKEN \ | |
swarm-master | |
for NODE in {1..3}; |
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
export SPM_TOKEN=TOUR_SPM_TOKEN | |
export LOGSENE_TOKEN=YOUR_LOGSENE_TOKEN | |
export NODES=$(docker-machine ls | grep Running | grep -v error | awk '{printf $1 "\t"}') | |
echo Swarm nodes: "$NODES" | |
for node in $NODES; do | |
echo "get docker-machine env $node" | |
eval "$(docker-machine env $node)" | |
echo "Using docker host: $DOCKER_HOST" | |
echo "deploy sematext-agent-docker to $node" | |
docker rm -f sematext-agent 2>1 /dev/null |
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
curl -XPOST -H "Content-type: application/json" http://your_marathon_server:8080/v2/apps -d ' | |
{ | |
"container": { | |
"type": "DOCKER", | |
"docker": { | |
"image": "sematext/sematext-agent-docker" | |
}, | |
"volumes": [ | |
{ | |
"containerPath": "/var/run/docker.sock", |
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
wget https://download.elastic.co/kibana/kibana/kibana-4.2.0-linux-x64.tar.gz | |
cd kibana-4.2.0-linux-x64 | |
./bin/kibana plugin --install elastic/sense | |
echo -e "kibana.enabled: false # disable the standard kibana discovery, visualize & dashboard plugins\n | |
elasticsearch.enabled: false # do not require a running Elasticsearch 2.0 instance" >> config/kibana.yml | |
./bin/kibana |
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
export SPM_TOKEN=YOUR_TOKEN_HERE | |
# Name two Elasticsearch nodes | |
export ES1="ES-1" | |
export ES2="ES-2" | |
# let's configure 2 nodes in this example | |
export SPM_CFG="${SPM_TOKEN} es javagent jvmname:${ES1};${SPM_TOKEN} es javagent jvmname:${ES2}" | |
docker run --name spm-client -e HOSTNAME=$HOSTNAME --restart=always -e SPM_CFG sematext/spm-client | |
# start the 2 Elasticsearch nodes, one exposes 9200 to the public | |
docker run --name $ES1 -h $ES1 p 9200:9200 -d --volumes-from spm-client -e ES_JAVA_OPTS="-Dcom.sun.management.jmxremote -javaagent:/opt/spm/spm-monitor/lib/spm-monitor-es.jar=${SPM_TOKEN}::${ES1} -es.node.name=${ES1}" elasticsearch |