Skip to content

Instantly share code, notes, and snippets.

View freeseacher's full-sized avatar
💭
(3↑↑↑↑3)+1. Yo. Not.

Aleksey Shirokih freeseacher

💭
(3↑↑↑↑3)+1. Yo. Not.
View GitHub Profile
import os
from alerta.app import app
from alerta.plugins import PluginBase
import telebot
LOG = app.logger
TELEGRAM_TOKEN = os.environ.get('TELEGRAM_TOKEN') or app.config['TELEGRAM_TOKEN']
# for i in 197/*; do /tmp/influx_inspect dumptsm $i; done
Summary:
File: 197/000001079-000000002.tsm
Time Range: 2016-07-25T00:00:00Z - 2016-07-25T23:59:59Z
Duration: 23h59m59s Series: 2418322 File Size: 2149904419
Statistics
Blocks:
Total: 2418322 Size: 1869836949 Min: 32 Max: 5409 Avg: 773
Index:
@freeseacher
freeseacher / telegram.py
Created January 19, 2017 16:52
telegram.py for alerta
import os
from alerta.app import app
from alerta.plugins import PluginBase
from jinja2 import Template
import telebot
import logging
reporting-disabled = true
[registration]
[meta]
dir = "/var/lib/influxdb/meta"
hostname = "db04"
bind-address = ":8088"
retention-autocreate = true
logging-enabled = true
FROM nginx:alpine
ENV CONSUL_TEMPLATE_VERSION=0.18.5
RUN apk add --update curl unzip ca-certificates \
&& curl -Ls https://releases.hashicorp.com/consul-template/${CONSUL_TEMPLATE_VERSION}/consul-template_${CONSUL_TEMPLATE_VERSION}_linux_amd64.zip -o consul-template.zip \
&& unzip consul-template.zip -d /bin \
&& rm -f consul-template* \
&& apk del curl unzip \
&& rm -rf /var/cache/apk/*
@freeseacher
freeseacher / after reload
Last active July 24, 2017 23:28
prom_client output
# HELP go_gc_duration_seconds A summary of the GC invocation durations.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 0.000129192
go_gc_duration_seconds{quantile="0.25"} 0.000190183
go_gc_duration_seconds{quantile="0.5"} 0.000248812
go_gc_duration_seconds{quantile="0.75"} 0.000615913
go_gc_duration_seconds{quantile="1"} 0.000747136
go_gc_duration_seconds_sum 0.002823651
go_gc_duration_seconds_count 8
# HELP go_goroutines Number of goroutines that currently exist.
- name: init check vars
set_fact:
consul_servers_count: 0
consul_bootstrap_count: 0
- name: check if bootstrap exists
set_fact:
consul_bootstrap_count: "{{consul_bootstrap_count | int+ 1}}"
with_items: "{{groups['svc-consul-exec']}}"
when: "'bootstrap' in hostvars[srv]['consul_power']"
# /etc/systemd/system/mtail.service
[Unit]
Description=mtail
Documentation=https://github.com/google/mtail
After=network.target
[Service]
User=nobody
Group=nobody
WorkingDirectory=/opt/mtail
version: '2'
services:
grafana:
image: grafana/grafana:latest
restart: always
ports:
- 3000:3000
volumes:
- $PWD/grafana:/etc/grafana
- name: notify deploy started
include_role:
name: deploy_notification
tasks_from: start
ignore_errors: true