First method:
Add the following lines to servers conf:
status /var/log/status.log 5
status-version 2
Second method:
Add the following lines to servers conf:
client-connect /path/to/your/connect_script.sh
client-disconnect /path/to/your/disconnect_script.sh
Start your server with '--script-security 2'
The scripts must be owned by the same user running the server. If your scripts are writing log files, check the log file directory permissions.
Third method:
Add the following lines to servers conf:
management localhost 7505
Now you can connect port 7507 via telnet and ask some stuff.