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
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
hostname = "3c18ec3c89ea" | |
data_dir = "/var/lib/kapacitor" | |
skip-config-overrides = false | |
default-retention-policy = "" | |
[alert] | |
persist-topics = true | |
[http] | |
bind-address = ":9092" |
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
# | |
# 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 |
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
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 |
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
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 |
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
sudo firewall-cmd --zone=public --add-masquerade --permanent | |
sudo firewall-cmd --reload |
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
version: '3' | |
services: | |
redis: | |
image: redis | |
container_name: redis | |
ports: | |
- 6379:6379 | |
network_mode: host |
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
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 |
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
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] |
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
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()), |