Skip to content

Instantly share code, notes, and snippets.

hostname = "3c18ec3c89ea"
data_dir = "/var/lib/kapacitor"
skip-config-overrides = false
default-retention-policy = ""
[alert]
persist-topics = true
[http]
bind-address = ":9092"
#
# A "httpie" container
#
# docker build --network host -t wh13371/httpie .
# docker login
# docker push wh13371/httpie
# docker run -it --rm --network host wh13371/httpie
# Usage: / # http 10.20.30.40:46664
#
FROM alpine:latest
@wh13371
wh13371 / EK_docker-compose.yml
Created August 26, 2020 12:45
A simple Elasticsearch and Kibana stack
version: '3'
services:
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.0
container_name: es01
environment:
- node.name=es01
- cluster.name=es-docker-cluster
- cluster.initial_master_nodes=es01
- bootstrap.memory_lock=true
version: '3'
services:
influx2:
image: quay.io/influxdb/influxdb:2.0.0-beta
container_name: influx2
volumes:
- $PWD/data:/root/.influxdbv2
- $PWD/data/engine:/root/.influxdbv2/engine
command:
- --reporting-disabled

CentOS 8 - install "rsyslog"

sudo dnf install rsyslog -y
rpm -q rsyslog # check
dnf info rsyslog --verbose # check
sudo systemctl status rsyslog # status
sudo systemctl start rsyslog # start
sudo systemctl enable rsyslog # enable for reboot
echo "test message from fizz" | logger
sudo firewall-cmd --zone=public --add-masquerade --permanent
sudo firewall-cmd --reload
@wh13371
wh13371 / docker-compose_REDIS.yml
Created November 24, 2020 12:41
A Redis Docker Container
version: '3'
services:
redis:
image: redis
container_name: redis
ports:
- 6379:6379
network_mode: host
@wh13371
wh13371 / jq_install.sh
Created December 17, 2020 11:12
jq - install
cd tmp
wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -O jq
chmod +x jq
sudo cp jq /usr/bin
def start_redis_consumer():
dd("Starting Redis Consumer")
while True:
events = r.xread({REDIS_STREAM: '$'}, block=0, count=None)
for _, data in events:
stream = _
_redisid = data[0][0]
_redisdata = data[0][1]
@wh13371
wh13371 / send_scs_to_influxdb.py
Last active December 22, 2020 13:56
send scs alarm data to InfluxDB
def send_to_influxdb(redis_id, redis_data):
_data = [{
"measurement": "scs.alarms",
"tags": {
"host": redis_data.get(b'hostname'),
"app": redis_data.get(b'appname'),
"msgid": redis_data.get(b'msgid'),
},
"time": int(time.time()),