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
import tornado.web | |
import tornado.ioloop | |
class MainHandler(tornado.web.RequestHandler): | |
def get(self): | |
self.write() | |
application = tornado.web.Application([ | |
(r"/", MainHandler), |
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
String url = "http://api.openweathermap.org/data/2.5/weather?q=London,uk"; | |
OkHttpClient client = new OkHttpClient(); | |
try{ | |
Request request = new Request.Builder() | |
.url(url) | |
.build(); | |
Response response = client.newCall(request).execute(); | |
System.out.println(response.body().string()); |
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
import boto.ec2 | |
import os | |
access = os.environ['aws_access_key_id'] | |
secret = os.environ['aws_secret_access_key'] | |
conn = boto.ec2.connect_to_region(region, aws_access_key_id=access, | |
aws_secret_access_key=secret) | |
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
import boto | |
ec2 = boto.connect_ec2() | |
res = ec2.get_all_instances() | |
instances = [i for r in res for i in r.instances] | |
vol = ec2.get_all_volumes() | |
def attachedvolumes(): | |
print 'Attached Volume ID - Instance ID','-','Device Name' | |
for volumes in vol: | |
if volumes.attachment_state() == 'attached': | |
filter = {'block-device-mapping.volume-id':volumes.id} |
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
import json | |
import click | |
import requests | |
def get_status(node): | |
es_stats = requests.get("http://%s:8080/_cluster/health?level=indices" % node) | |
indices = es_stats.json()['indices'] | |
bad_indices = {k:v['status'] for k,v in indices.items() if 'green' not in v['status'] and 'nginx' in k} | |
for k,v in bad_indices.items(): |
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
FROM sdurrheimer/alpine-glibc | |
MAINTAINER The Prometheus Authors <prometheus-developers@googlegroups.com> | |
WORKDIR /gopath/src/github.com/prometheus/prometheus | |
COPY . /gopath/src/github.com/prometheus/prometheus | |
RUN apk add --update -t build-deps tar openssl git make bash curl\ | |
&& source ./scripts/goenv.sh /go /gopath \ | |
&& make build \ | |
&& cp prometheus promtool /bin/ \ |
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
FROM prom/prometheus | |
EXPOSE 9090 | |
VOLUME [ "/prometheus" ] | |
WORKDIR /prometheus | |
ENTRYPOINT [ "/bin/prometheus" ] | |
CMD [ "-config.file=/etc/prometheus/prometheus.yml", \ | |
"-storage.local.path=/prometheus", \ | |
"-alertmanager.url=http://localhost:9093", \ | |
"-web.console.libraries=/etc/prometheus/console_libraries", \ |
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
global: | |
slack_api_url: <hidden> | |
pagerduty_url: "https://events.pagerduty.com/generic/2010-04-15/create_event.json" | |
route: | |
# The labels by which incoming alerts are grouped together. For example, | |
# multiple alerts coming in for cluster=A and alertname=LatencyHigh would | |
# be batched into a single group. | |
group_by: ['alertname','host'] | |
group_wait: 30s |
This file has been truncated, but you can view the full file.
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
2016/05/27 06:36:09 http: Accept error: accept tcp [::]:9093: accept4: too many open files; retrying in 1s | |
2016/05/27 06:36:10 http: Accept error: accept tcp [::]:9093: accept4: too many open files; retrying in 1s | |
2016/05/27 06:36:11 http: Accept error: accept tcp [::]:9093: accept4: too many open files; retrying in 1s | |
2016/05/27 06:36:12 http: Accept error: accept tcp [::]:9093: accept4: too many open files; retrying in 1s | |
2016/05/27 06:36:13 http: Accept error: accept tcp [::]:9093: accept4: too many open files; retrying in 1s | |
2016/05/27 06:36:14 http: Accept error: accept tcp [::]:9093: accept4: too many open files; retrying in 1s | |
2016/05/27 06:36:15 http: Accept error: accept tcp [::]:9093: accept4: too many open files; retrying in 1s | |
2016/05/27 06:36:16 http: Accept error: accept tcp [::]:9093: accept4: too many open files; retrying in 1s | |
2016/05/27 06:36:17 http: Accept error: accept tcp [::]:9093: accept4: too many open files; retrying in 1s | |
2016/05/27 06:36:18 http: Accept error: accept tcp [::]:9093: |
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
lrwx------ 1 prometheus prometheus 64 May 27 14:16 0 -> /dev/null | |
lrwx------ 1 prometheus prometheus 64 May 27 14:16 1 -> /dev/pts/3 | |
lrwx------ 1 prometheus prometheus 64 May 27 14:16 10 -> socket:[285801553] | |
lrwx------ 1 prometheus prometheus 64 May 27 14:16 100 -> socket:[285878671] | |
lrwx------ 1 prometheus prometheus 64 May 27 14:16 101 -> socket:[285878812] | |
lrwx------ 1 prometheus prometheus 64 May 27 14:16 102 -> socket:[285877980] | |
lrwx------ 1 prometheus prometheus 64 May 27 14:16 103 -> socket:[285881817] | |
lrwx------ 1 prometheus prometheus 64 May 27 14:16 104 -> socket:[285882535] | |
lrwx------ 1 prometheus prometheus 64 May 27 14:16 105 -> socket:[285882580] | |
lrwx------ 1 prometheus prometheus 64 May 27 14:16 106 -> socket:[285884665] |
OlderNewer