One's and Zero's

Technology at its best and its worst

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

May 19th, 2010 by Nate


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!

Posted in General | No Comments »

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.