Hi All.
im a noob to scripting. could somone help me with a script please.
what i want to do is.
1. run a cmd in the script - qmqtool -s
this will give me an output similar to this.
Messages in local queue: 790
Messages in remote queue: 306
Messages in todo queue: 23
i then want to check if the message in the local queue is larger than the number of for example 100 ( but id like to be able to change this)
if its larger i want to do.
2. send email to
me@mydomain.com with the output of the qmqtool -s and saying something like this
mail checker script has detected more than 100 emails in the local queue.
Messages in local queue: 790
Messages in remote queue: 306
Messages in todo queue: 23
the script will automatically fix this issue.
3. service stop spamd
4. service stop drwebd
5. service restart xinetd
thats all for now. ill run this script as a cron job every 1 hr.
appreciate any help.
cheers aron.