Linux & Sysadmin openstack and kvm journal

by Michał Błaszczak

Spam sending by one of Your users may have significant impact on the server's performance and ip reputation.
Here's the simple bash script to monitor the queue.

if [ `/usr/sbin/exim -bpc`-ge 100 ]; 
then mail -s "Alert: Over 100 Emails
in the queue!" << EOF Current Mail Queue : `/usr/sbin/exim -bpc` `/usr/sbin/exim -bp | /usr/sbin/exiqsumm` Thanks, EOF fi

High load can be caused by other factors too. By editing the script above You can monitor the load itself.

r=$(cat /proc/loadavg
| awk -F. '{print $1}') if [ $r -ge 7 ] then mail -s "Alert: Server load over
$r!" << EOF Server load over $r `/usr/bin/ps aux` `/usr/bin/sar` EOF fi