The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 07-09-2007
blowtorch's Avatar
blowtorch blowtorch is offline
Supporter
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,332
To get the local queue, pipe the output of 'qmqtool -s' through awk.
Code:
lqueue_length=$(qmqtool -s | awk '/local queue/ {print $NF}')
if [ $lqueue_length -gt 100 ]; then
   # send mail using mailx or whatever tool you use
   # fix the problem in the next three lines
   service stop spamd
   service stop drwebd
   service restart xinet
fi
Reply With Quote