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
cat my.har | jq 'del(.log.entries[].response.content.text)' | jq 'del(.log.entries[].request.headers[])' |
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
#! /bin/bash | |
_LOGFILE=/home/genesys/.@/$0.log | |
_NOW=$(date +"%Y-%m-%d %H:%M:%S.%6N") | |
_EPOCH=$(date +"%s.%6N") | |
_NOW_UTC=$(date --utc +%FT%T.%6N%Z) | |
_MSG="test message @ $_NOW_UTC" | |
_LOG="$(printf '{"timestamp": "%s", "epoch": "%s", "timestamp_utc": "%s", "message": "%s"}' "${_NOW}" "${_EPOCH}" "${_NOW_UTC}" "${_MSG}")" |
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_mattermost(mm_url, mm_channel, mm_username, redis_id, redis_data): | |
_text = {'@timestamp': get_now_iso(), | |
'epoch': int(get_epoch()), | |
"condid": int(redis_data.get(b'condid').decode()), | |
"condname": redis_data.get(b'condname').decode(), | |
"conddesc": redis_data.get(b'conddesc').decode(), | |
"msgid": int(redis_data.get(b'msgid').decode()), | |
"msgtext": redis_data.get(b'msgtext').decode(), | |
"appid": int(redis_data.get(b'appid').decode()), |
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()), |
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
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
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
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: | |
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 |
NewerOlder