I would like assistance on a script that could send a text message to my mobile phone when I run a command and the text should be send only if a condition is met. I want to have a cron-job running every 10 minutes to check the system for overload conditons with a command:
more logfile.log | grep overloaded | wc -l
If the output of this command is greater than zero I want an SMS to be send to my mobile number. I would also want to customize the message to read, " Overload on Server 2"