Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7dec83b190 | |||
| 2b2056171e | |||
| 913d971663 | |||
| 0f6d7874de |
+1
-1
@@ -1 +1 @@
|
|||||||
0.8.2.2
|
0.8.6
|
||||||
|
|||||||
@@ -4,14 +4,14 @@ Python=/home/cvtt/.pyenv/python3.10-venv/bin/python3.10
|
|||||||
RootDir=/home/cvtt/prod
|
RootDir=/home/cvtt/prod
|
||||||
export PYTHONPATH=${RootDir}
|
export PYTHONPATH=${RootDir}
|
||||||
|
|
||||||
host=$(hostname)
|
host=${1}
|
||||||
if [ "${host}" == "cvttdata" ]
|
if [ "${host}" == "cvttdata" ]
|
||||||
then
|
then
|
||||||
ArchiveRootDir=/home/cvtt/prod/archive/md_archive
|
ArchiveRootDir=/home/cvtt/prod/archive/md_archive/cvttdata
|
||||||
CredKey=TSDB_MD_CVTTDATA_RO
|
CredKey=TSDB_MD_CVTTDATA_RO
|
||||||
elif [ "${host}" == "cloud21.cryptovaltrading.com" ]
|
elif [ "${host}" == "cloud21" ]
|
||||||
then
|
then
|
||||||
ArchiveRootDir=/opt/store/cvtt/archive/md_archive
|
ArchiveRootDir=/home/cvtt/prod/archive/md_archive/cloud21
|
||||||
CredKey=TSDB_MD_CLD21_RO
|
CredKey=TSDB_MD_CLD21_RO
|
||||||
else
|
else
|
||||||
echo "Unknown host ${host}. ${0} Aborted."
|
echo "Unknown host ${host}. ${0} Aborted."
|
||||||
@@ -21,7 +21,7 @@ fi
|
|||||||
mkdir -p ${ArchiveRootDir}
|
mkdir -p ${ArchiveRootDir}
|
||||||
|
|
||||||
yesterday=$(date -d "yesterday" +%Y%m%d)
|
yesterday=$(date -d "yesterday" +%Y%m%d)
|
||||||
Schemas=${1}
|
Schemas=${2}
|
||||||
if [ "${Schemas}" == "" ]
|
if [ "${Schemas}" == "" ]
|
||||||
then
|
then
|
||||||
Schemas="coinbase,bnbspot,bnbfut"
|
Schemas="coinbase,bnbspot,bnbfut"
|
||||||
|
|||||||
@@ -38,20 +38,13 @@ Metrics=()
|
|||||||
TempFiles=
|
TempFiles=
|
||||||
|
|
||||||
function cleanup {
|
function cleanup {
|
||||||
|
echo Cleaing up temporary files: ${TempFiles}
|
||||||
if [ "" != "${TempFiles}" ]; then
|
if [ "" != "${TempFiles}" ]; then
|
||||||
echo rm -f ${TempFiles}
|
|
||||||
rm -f ${TempFiles}
|
rm -f ${TempFiles}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
|
||||||
function new_tempfile {
|
|
||||||
tmpfile=$(mktemp)
|
|
||||||
TempFiles="${TempFiles} ${tmpfile}"
|
|
||||||
echo ${tmpfile}
|
|
||||||
}
|
|
||||||
|
|
||||||
function space_alert() {
|
function space_alert() {
|
||||||
ALERT_USAGE=75%
|
ALERT_USAGE=75%
|
||||||
for metric in "${Metrics[@]}"
|
for metric in "${Metrics[@]}"
|
||||||
@@ -105,8 +98,12 @@ function storage_check() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpfile=$(new_tempfile)
|
tmpfile=$(mktemp)
|
||||||
tmpfile2=$(new_tempfile)
|
TempFiles="${TempFiles} ${tmpfile}"
|
||||||
|
|
||||||
|
tmpfile2=$(mktemp)
|
||||||
|
TempFiles="${TempFiles} ${tmpfile2}"
|
||||||
|
|
||||||
storage_check > ${tmpfile2}
|
storage_check > ${tmpfile2}
|
||||||
|
|
||||||
echo "## :card_file_box: STORAGE HEALTH CHECK" >> ${tmpfile}
|
echo "## :card_file_box: STORAGE HEALTH CHECK" >> ${tmpfile}
|
||||||
@@ -116,8 +113,9 @@ echo "| --- | --- | --- |" >> ${tmpfile}
|
|||||||
cat ${tmpfile2} | sort -h -r | awk -F'%' '{printf "%s%%%s\n",$2,$3}' >> ${tmpfile}
|
cat ${tmpfile2} | sort -h -r | awk -F'%' '{printf "%s%%%s\n",$2,$3}' >> ${tmpfile}
|
||||||
cat ${tmpfile} | ${Sender} ${StatusChannel}
|
cat ${tmpfile} | ${Sender} ${StatusChannel}
|
||||||
|
|
||||||
Measurements=()
|
tmpfile=$(mktemp)
|
||||||
tmpfile=$(new_tempfile)
|
TempFiles="${TempFiles} ${tmpfile}"
|
||||||
|
|
||||||
space_alert > ${tmpfile}
|
space_alert > ${tmpfile}
|
||||||
if [ -s ${tmpfile} ]
|
if [ -s ${tmpfile} ]
|
||||||
then
|
then
|
||||||
|
|||||||
Reference in New Issue
Block a user