Hi shell experts,
I would like to have a shell script running in a redhat server for monitoring the mailqueue status. I have already installed the qmHandle and I am using it to get a status of the mail queue in daily basis. I am executing the qmhandle in the cron.
Now I am planning to execute the qmhandle every hour and the status been mailed to me only, if the amount of mails in the queue meet certain criteria.
e.g. I need the notification been send only if the mails in the remote queue exceeds more than 1000 mails or in the local queue more than 10 mails.
Any help appreciated. Thank you.
The qmhandle will be executed with following command
./qmHandle -s
The out put may be:
Messages in local queue: 3
Messages in remote queue: 583
getting following error:
mailcheck_2.sh: line 6: 530
Messages in remote queue : syntax error in expression (error token is "Messages in remote queue ")
You want to send an email about all emails in queue when that email will be last in queue and by the time it is send reports about emails which where in queue but are already out of queue?
Good point. never thought about it. anyway do you have any other suggestion to get the admin notified about the mail queue? though the notification mail will be placed in the Remote queue. and it will still work for incomming mails. but most of the cases, the outgoing mails are the problem. not incomming mails.