SECURITY: lfd PT_LOAD_ACTION

.

The default server load alert for lfd running on cPanel only shows Apache stats.

To get a more in depth report on what is going on with the server you can configure  lfd to send an additional more detailed report using PT_LOAD_ACTION

This directive executes a specified script once high load alert is triggered.

You can no longer edit this specified script via the UI in cPanel so you have to edit the csf config script directly as root admin. 

Create a file call /etc/csf/loadalert.sh with the following contents:

[code language=”bash”] #!/bin/sh
>/etc/csf/csf.report
iostat -d 1 5 >> /etc/csf/csf.report
iostat -x -d 1 5 >> /etc/csf/csf.report
mpstat -P ALL >> /etc/csf/csf.report
top -b -n 1 >> /etc/csf/csf.report
netstat -autpn
mail -s "Load Report" root < /etc/csf/csf.report
[/code]

chmod +x /etc/csf/loadalert.sh

Then edit csf.conf and change:

PT_LOAD_ACTION = “/etc/csf/loadalert.sh”