munin/wifi_auth: graphing des auths TTLS/PEAP

This commit is contained in:
Daniel STAN 2014-03-04 23:45:37 +01:00
parent bd7bd8eb09
commit e142825b19

View file

@ -42,6 +42,12 @@ if [ "$1" = "config" ]; then
echo 'success.label Succès'
echo 'success.draw AREASTACK'
echo 'success.colour 00FF00'
echo 'peap.label Authentifications PEAP'
echo 'ttls.label Authentifications TTLS'
echo 'peap.draw LINE1'
echo 'peap.colour 000000'
echo 'ttls.draw LINE2'
echo 'ttls.colour F6FF00'
exit 0
fi
@ -53,16 +59,23 @@ TEMP_FILE=$(mktempfile munin-radius-wifi.XXXXXX)
if [ -n "$TEMP_FILE" -a -f "$TEMP_FILE" ]
then
if [ $ARGS != 0 ]; then
$LOGTAIL -f ${FREERADIUS_LOG} -o ${STATEFILE} | grep 'freeradius\[.*\]:' > ${TEMP_FILE}
$LOGTAIL -f ${FREERADIUS_LOG} -o ${STATEFILE} > ${TEMP_FILE}
else
$LOGTAIL ${FREERADIUS_LOG} ${STATEFILE} | grep 'freeradius\[.*\]:' > ${TEMP_FILE}
$LOGTAIL ${FREERADIUS_LOG} ${STATEFILE} > ${TEMP_FILE}
fi
success=$(grep -c 'Login OK' ${TEMP_FILE})
failures=$(grep -c 'Login incorrect' ${TEMP_FILE})
peap=$(grep -c 'authenticated - EAP type: 25' ${TEMP_FILE})
ttls=$(grep -c 'authenticated - EAP type: 21' ${TEMP_FILE})
/bin/rm -f $TEMP_FILE
fi
echo "success.value ${success}"
echo "failures.value ${failures}"
# NB: chaque authentification réussie en TTLS ou PEAP produit deux "succès"
# (inner et outer-tunnels)
echo "peap.value ${peap}"
echo "ttls.value ${ttls}"