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 Source Code Form is subject to the terms of the Mozilla Public | |
-- License, v. 2.0. If a copy of the MPL was not distributed with this | |
-- file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
--[[ | |
--]] | |
local l = require 'lpeg' |
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
{ | |
"description": "build th base image", | |
"min_packer_version": "0.8.0", | |
"variables": { | |
"user": "centos", | |
"image": "d5f2c6b8-ae55-41d3-b9ba-15e0f2350659", | |
"flavor": "2", | |
"role1": "common", | |
"role2": "common", | |
"role3": "common", |
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
--[[ | |
Inspired by: https://github.com/mozilla-services/lua_sandbox/pull/22 | |
*Haproxy log-format Directive* | |
log-format %ci:%cp\ [%t]\ %ft\ %b/%s\ %Tq/%Tw/%Tc/%Tr/%Tt\ %ST\ %B\ %CC\ %CS\ %tsc\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq\ %hr\ %hs\ %{+Q}r | |
*Example Config* | |
[haproxy_udp_input] | |
type = "UdpInput" |
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
local l = require "lpeg" | |
require "cjson" | |
l.locale(l) | |
local sp = l.space^0 | |
local unreserved = l.digit + l.alnum + l.S"/=-.,_~ " | |
local name = l.C(unreserved^1) * sp | |
local comment = l.P"#" * (1 - l.P"\n")^1 * l.P"\n" | |
local sep = l.P(read_config("pair_separator")) |
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
local l = require 'lpeg' | |
l.locale(l) | |
local sp = l.space^1 | |
local unreserved = l.alnum + l.S"/=-.,_~" | |
local name = l.C(unreserved^1) | |
local prefix = l.P"STAT " | |
local pair = prefix^-1 * l.Cg(name * sp * name) * sp | |
local grammar = l.Cf(l.Ct("") * pair^0, rawset) |
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
assumes centos 7 host, typical configuration | |
- disable selinux: SELINUX=permissive in /etc/sysconfig/selinux | |
- disable auditd: systemctl disable auditd.service | |
- enable journald persistence: `Storage=persistent` in /etc/systemd/journald.conf | |
- mkdir /var/lib/container | |
- yum -y --nogpg --releasever=7 --installroot=/var/lib/container/centos install systemd passwd yum vim-minimal openssh-server | |
- systemd-nspawn -D /var/lib/container/centos | |
- set root passwd, set ssh port (e.g. 2222) | |
- set up systemd-nspawn service: |
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
# heka.toml | |
[hekad] | |
base_dir = '/tmp/heka' | |
[boot] | |
type = "LogstreamerInput" | |
log_directory = '/var/log' | |
file_match = 'boot\.log' | |
[pulse] |
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
heat_template_version: 2015-04-30 | |
description: set up the redis cluster | |
parameters: | |
default_image: | |
type: string | |
label: default base image | |
description: glance image id of the base image | |
default: centos-7.2 |
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
vrrp_script chk_redis_master { | |
script "redis-cli info replication | grep -q 'role:master'" | |
interval 2 | |
weight 2 | |
rise 2 | |
fall 2 | |
} | |
vrrp_instance redis_vip { | |
interface eth0 |
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
#!/usr/bin/env python | |
from sensu_plugin import SensuPluginCheck | |
import alooma | |
class AloomaRestreamCheck(SensuPluginCheck): | |
def setup(self): | |
self.parser.add_argument( | |
'-w', | |
'--warning', |