From: Bill Erickson Date: Wed, 6 Jan 2016 16:42:52 +0000 (-0500) Subject: JBAS-947 SIP monthly login counts reporter X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8edb4660002bc478f2a202eb64910cba0341098b;p=working%2FEvergreen.git JBAS-947 SIP monthly login counts reporter Generate monthly sip login counts and email. Signed-off-by: Bill Erickson --- diff --git a/KCLS/log-scripts/sip-login-counts-monthly.sh b/KCLS/log-scripts/sip-login-counts-monthly.sh new file mode 100644 index 0000000000..3e9a020ea9 --- /dev/null +++ b/KCLS/log-scripts/sip-login-counts-monthly.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Count the number of logins per SIP account for the previous month +# and email the output the to address(es) listed below. +EMAIL="lhill@kcls.org" +LOGINS=(lyndasip hooplasip2) + +DATE=$(date -d "-1 month" +'%m %Y'); +MONTH=$(echo $DATE | cut -d' ' -f1); +YEAR=$(echo $DATE | cut -d' ' -f2); + +FILE="/tmp/sip-logins-$YEAR-$MONTH.txt" + +for LOGIN in ${LOGINS[@]}; do + ./sip-login-counts.sh -l $LOGIN -y $YEAR -m $MONTH >> $FILE +done + +cat $FILE | mailx -s "SIP Login Counts $YEAR/$MONTH" $EMAIL + +# rm $FILE +# Leave file in place. it's tiny and may be useful. +