May 182013

This is a simple email alert for when your server process load reaches a defined threshold.

I wish I had retained the (StackExchange?) link I had found to give me the code below. Thank you to the original author. If you have a link to the source post for this code, please give credit in the comments below.

Save the code below as and execute via crontab every 15 minutes. It will email you at [email protected] a list of the top 10 cpu consuming running processes when the load average reaches 6.0 or higher.

SUBJECT="`hostname` server load is high"
[email protected]
uptime > /tmp/load
if [ `uptime | awk '{ print$10 }' | cut -d. -f1` -gt 6 ];
echo "============================================" >> /tmp/load
`ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10 >> /tmp/load `
mail -s "$SUBJECT" $TO < /tmp/load

Adjust -gt 6 to be any minimum load number you prefer to receive the alert.

Remove “| head -10″ if you would prefer to see the entire list of running processes.

Helpful resources:

Apr 032012

Passive mode ftp requires some or all “unprivileged” (1024-65534) ports to be open on the webserver. The default Plesk firewall configuration blocks all ports except for those single ports required for system services (HTTP, POP, etc.)

To enable passive mode ftp on a Plesk server:

SSH into your server and as root, edit /etc/proftpd.conf.

Add the line in the <global> section:

PassivePorts 60000 65534

* I prefer to limit the number of available ports for greater security.


Enable passive FTP in Plesk with this firewall rule

Enable passive FTP in Plesk with this firewall rule

Login to your Plesk Panel.

Go to Modules -> Firewall to access your firewall configuration.
Select Edit Firewall Configuration.

Add a new Rule:

 Name of the rule: FTPD Passive Ports
 Match direction: Incoming (only)
 Action: Allow
 Add port or port range: 60000-65534
 Select TCP
 Click Add

Click OK and then click Activate (twice)

More information about Passive vs. Active FTP