Hacking lfd csf v5.07 high 5 minute load average email to include MySQL Process List



joe /etc/csf/lfd.pl

Go to about line 1906, just before:


open (IN, "</etc/csf/loadalert.txt");

add:


my @mysql = `mysqladmin -uUSERNAME -pPASSWORD processlist`;

Go to line 1925, just before:


$line =~ s/\[boundary\]/$boundary/ig;

add:


$line =~ s/\[mysql\]/@mysql/ig;

Save and close /etc/csf/lfd.pl

———————————————–


joe /etc/csf/loadalert.txt

add just before the last line —[boundary]–:


--------------[boundary]
Content-Type: text/html;
name="mysql.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="mysql.txt"
 
MySQL Process List:
[mysql]

Save and close and restart LFD!

This entry was posted in General. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>