Script
#!/bin/sh
mysqldump -h 192.168.1.10 -u user -pPaSSwOrD dbname > filename.sql
if [ "$?" -eq 0 ]; then
echo "Success"
else
echo "Error"
fi
is successfully showing errors for connection timeouts, wrong dbname, wrong username and password. It only doesn't check integrity of dump taken, but it's another story.