Check_mk freeradius check
radius check na strane radius server a agenta check_mk
nano /usr/lib/check_mk_agent/local/radius
check:
#!/bin/bash
USER=testeduroam
PASSWORD=testingEduroam
HOST=127.0.0.1
SECRET=iguest
check_result=$(echo "User-Name=$USER,User-Password=$PASSWORD" | radclient -4 $HOST auth $SECRET 2>&1 | grep -oP '(?<=Received )[^ ]*')
if [ "$check_result" == "Access-Accept" ]; then
echo "0 Freeradius - OK: $check_result";
elif [ "$check_result" == "Access-Reject" ]; then
echo "1 Freeradius - WARN: $check_result";
else
echo "2 Freeradius - CRIT: $check_result";
fi
chmod +X /usr/lib/check_mk_agent/local/radius
Test:
check_mk_agent