I modified the email template usertracking.txt to include load averages. A simple cut and paste from the appropriate section of loadalert.txt. The variables aren't replaced?
I get as an email:
Code: Select all
lfd on {snip}: Excessive processes running under user {snip}
From: root@{snip}
To: root@{snip}
Time: Tue Mar 11 10:41:29 2014 -0500
Account: {snip}
Process Count: 32 (Not killed)
Load:
1 Min Load Avg: [loadavg1]
5 Min Load Avg: [loadavg5]
15 Min Load Avg: [loadavg15]
Running/Total Processes: [totprocs]
Process Information:
{snip}
Thanks,
Michael
Reference:
Modified, /usr/local/csf/tpl/usertracking.txt - for user process tracking alert emails
Code: Select all
root@server1 [/usr/local/csf/tpl]# cat usertracking.txt
From: root
To: root
Subject: lfd on [hostname]: Excessive processes running under user [user]
Time: [time]
Account: [user]
Process Count: [count]
Load:
1 Min Load Avg: [loadavg1]
5 Min Load Avg: [loadavg5]
15 Min Load Avg: [loadavg15]
Running/Total Processes: [totprocs]
Process Information:
[text]
Original, /usr/local/csf/tpl/loadalert.txt - for high load average alert emails
Code: Select all
root@server1 [/usr/local/csf/tpl]# cat loadalert.txt
From: root
To: root
Subject: lfd on [hostname]: High [loadavg] minute load average alert - [reportload]
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="------------[boundary]"
This is a multi-part message in MIME format.
--------------[boundary]
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Time: [time]
1 Min Load Avg: [loadavg1]
5 Min Load Avg: [loadavg5]
15 Min Load Avg: [loadavg15]
Running/Total Processes: [totprocs]
--------------[boundary]
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="ps.txt"
Output from ps:
[processlist]
--------------[boundary]
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="vmstat.txt"
Output from vmstat:
[vmstat]
--------------[boundary]
Content-Type: text/html;
name="apachestatus.html"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="apachestatus.html"
[apache]
--------------[boundary]--