This file contains 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
SET @history_interval = 7; | |
SET @trends_interval = 90; | |
DELETE FROM alerts WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); | |
DELETE FROM acknowledges WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); | |
DELETE FROM events WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); | |
DELETE FROM history WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); | |
DELETE FROM history_uint WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); | |
DELETE FROM history_str WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); |
This file contains 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
apt-get install -y libaio1 alien | |
# Change version based on https://www.oracle.com/de/database/technologies/instant-client/linux-x86-64-downloads.html | |
# Example alternative: http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.5-basiclite-19.5.0.0.0-1.x86_64.rpm | |
wget http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm | |
sudo alien -i --scripts oracle-instantclient*.rpm | |
rm -f oracle-instantclient*.rpm | |
# Optionally install SQLPlus | |
wget http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.6-sqlplus-19.6.0.0.0-1.x86_64.rpm | |
sudo alien -i --scripts oracle-instantclient*.rpm |
This file contains 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
# If your pod container doesn't have bash in the path, you might need to replace `bash` with `/bin/bash/`, `/bin/sh` or `/bin/ash`. | |
# Simple string from the command line - puts the literal text 'AAA' into a new file /tmp/test.txt | |
echo 'AAA' > kubectl -n MyNamespace exec -ti $my_pod_id -c my-pod-container -- bash -c 'cat - > /tmp/test.txt' | |
# Copy / inject a file from the local filesystem into a new file in the pod in the remote kubernetes cluster | |
kubectl -n MyNamespace exec -i $my_pod_id -c my-pod-container -- bash -c 'cat - > /tmp/file.txt' </my/input/file.txt |
This file contains 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
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: index-template | |
stringData: | |
template: '{"index_patterns":["logstash-*"],"template":{"aliases":{"logstash":{}},"mappings":{"dynamic":"true","dynamic_date_formats":["strict_date_optional_time","yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"],"dynamic_templates":[]},"settings":{"index":{"lifecycle":{"name":"logstash_policy","rollover_alias":"logstash"},"number_of_shards":"1","number_of_replicas":"0"}}}}' |