Módosítások

FederationStats

988 bájt hozzáadva, 2010. május 19., 10:58
Running the log statistics collector
#Config section
PARSER_COMMAND="/usr/localopt/shibboleth-vhoidp/bin/audit_r7.py"SOURCEDIR="/usr/localopt/shibboleth-vhoidp/logs"
TARGETDIR="/tmp"
ENTITYID="idp-entity-id""
APIKEY="aaa..."
LOCATION2PUT="https://fedstats.example.org/import_stats"
fi
</source>
 
The script below can be used the collect statistics from all the idp audit logs placed in a folder.
 
<source lang="bash">
#!/bin/bash
 
#Config section
PARSER_COMMAND="/opt/shibboleth-idp/bin/audit_r7.py"
SOURCEDIR="/opt/shibboleth-idp/logs"
TARGETDIR="/tmp"
 
ENTITYID="idp-entity-id"
APIKEY="aaa..."
LOCATION2PUT="https://fedstats.example.org/import_stats"
 
FILES="idp-audit-*.log"
 
#Should not edit below this
cd $SOURCEDIR
for f in $FILES
do
if [ -f $f ]
then
echo "Processing $f file..."
DATE=${f:10:10}
LOGINS=`$PARSER_COMMAND -l $f`
UNIQUE_LOGINS=`$PARSER_COMMAND -u $f`
SERVICES=`$PARSER_COMMAND -p $f | sed '/^[0-9]/p' -n`
 
TARGETFILE="stat-$DATE.log"
 
echo "ENTITYID $ENTITYID
APIKEY $APIKEY
DATE $DATE
 
STAT AUTH
$LOGINS
 
STAT USER_COUNT
$UNIQUE_LOGINS
 
STAT SSO_TO_SERVICE
$SERVICES
" > $TARGETDIR/$TARGETFILE
 
wget -q --no-check-certificate --post-file=$TARGETDIR/$TARGETFILE $LOCATION2PUT -O /dev/null
rm $TARGETDIR/$TARGETFILE
fi
done
</source>

Navigációs menü