Skip to content
Snippets Groups Projects
Commit 62074707 authored by Jörg Sachse's avatar Jörg Sachse
Browse files

feat: add Bash functions to count SubApp error mails

parent 004ecbb7
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,31 @@ ...@@ -22,6 +22,31 @@
marker: "# {mark} ANSIBLE MANAGED BLOCK - SubApp-specific" marker: "# {mark} ANSIBLE MANAGED BLOCK - SubApp-specific"
state: present state: present
block: | block: |
ta_get_error_mails() (
if [[ $1 != "" ]]; then YEAR="$1"
else YEAR="$( date +%Y )"
fi
LOG="/var/log/subapp/$(hostname)/staff_mails.log"
( if [ -e ${LOG} ]; then
cat ${LOG}
fi
if compgen -G "${LOG}.*.lz" > /dev/null; then
lzip -cd "${LOG}.*.lz"
fi
if compgen -G "${LOG}.*.gz" > /dev/null; then
zcat "${LOG}.*.gz"
fi
) | grep "\[$YEAR" | grep -o "slub\.lza\.staff.*"
)
ta_get_error_mail_count_all() (
ta_get_error_mails $1 | wc -l
)
ta_get_error_mail_count_dedup() (
ta_get_error_mails $1 | sort | uniq | wc -l
)
cd ~ cd ~
- name: Add aliases for SubApp user - name: Add aliases for SubApp user
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment