How to disable Lfd excessive resource usage alert

If you are having own VPS or Dedicated server you will get this kind of alert messages often because you have installed CSF on your server and LFD will notify to you every time when the service or process take more time or memory which is assigned in your CSF configuration.

You can disable this kind of alert from below three methods but method-1 is standard one.

I will suggest you, don’t use method-2 & method-3 because this kind of alert is useful for you to monitor the server status.

If any service or user take too much of time & memory you have a look into that particular activity whether is there anything abnormal. So that you can run the server smooth condition.

I got below two LFD alert in my server.

  • Virtual Memory Size excessive resource usage alert
Time:         Tue Jul 15 06:23:10 2014 +0100
Account:      cloudana
Resource:     Virtual Memory Size
Exceeded:     280 > 200 (MB)
Executable:   /usr/bin/php
Command Line: /usr/bin/php /home/cloud2day/public_html/owncloud/remote.php
PID:          20571 (Parent PID:20435)
Killed:       No
  • Process Time excessive resource usage alert
Time:         Tue Jul 15 10:01:22 2014 +0530
Account:      rec247
Resource:     Process Time
Exceeded:     129399 > 1800 (seconds)
Executable:   /usr/bin/php
Command Line: /usr/bin/php /home/daygeek/public_html/news/rewrite.php
PID:          28929 (Parent PID:26541)
Killed:       No

Method-1

This one is standard method to disable the LFD alert. Use your favorite text editor to open the file csf.pignore and add the command line path except executable path, the common location in cpanel server /etc/csf/csf.pignore. Make sure you should not add only executable path, If you done it wont notify anything. Like in above alert its shows /usr/bin/php as a executable path. If you added it wont alert any of the php process on your server. So you need to add only the particular things. Process time also the same steps.

root@server [/etc/csf]# nano csf.pignore
  GNU nano 2.0.9                                           File: csf.pignore

exe:/usr/libexec/dovecot/pop3
exe:/usr/sbin/nsd
exe:/usr/libexec/dovecot/pop3-login
exe:/usr/libexec/dovecot/imap-login
exe:/var/cpanel/3rdparty/bin/php
exe:/usr/bin/postgres
exe:/usr/sbin/ntpd
exe:/sbin/ntpd
exe:/usr/local/cpanel/3rdparty/sbin/mydns
exe:/usr/local/cpanel/3rdparty/bin/webalizer_lang/english
exe:/usr/local/cpanel/3rdparty/perl/514/bin/spamd
exe:/usr/local/cpanel/bin/cpuwatch
exe:/u01/app/oracle/product/11.2.0/xe/bin/oracle
#exe:/usr/bin/php - This will exclude all the php process
#exe:/usr/bin/php /home/cloud2day/public_html/owncloud/index.php - This will not work
exe:/home/cloud2day/public_html/owncloud/index.php

Method-2

This will permanently disable to LFD alert. So its security issue. Use your favorite text editor to open the file csf.conf and set PT_USERMEM=0. Process time also the same and you need to changed PT_USERTIME value instead of changing PT_USERMEM values.

root@server [/etc/csf]# nano csf.conf
  GNU nano 2.0.9                                           File: csf.conf
                                                                                
# This User Process Tracking option sends an alert if any cPanel user process
# exceeds the memory usage set (MB). To ignore specific processes or users use
# csf.pignore
#
# Set to 0 to disable this feature
PT_USERMEM = "0"

# This User Process Tracking option sends an alert if any cPanel user process
# exceeds the time usage set (seconds). To ignore specific processes or users
# use csf.pignore
#
# Set to 0 to disable this feature
PT_USERTIME = "1800"

Method-3

Increase the PT_USERMEM=200 value more than 200. By default they are assigned 200. Use your favourite text editio to open the file csf.conf and set PT_USERMEM=500. . Process time also the same and you need to changed PT_USERTIME value instead of changing PT_USERMEM values.

root@server [/etc/csf]# nano csf.conf
  GNU nano 2.0.9                                           File: csf.conf
                                                                                
# This User Process Tracking option sends an alert if any cPanel user process
# exceeds the memory usage set (MB). To ignore specific processes or users use
# csf.pignore
#
# Set to 0 to disable this feature
PT_USERMEM = "500"

# This User Process Tracking option sends an alert if any cPanel user process
# exceeds the time usage set (seconds). To ignore specific processes or users
# use csf.pignore
#
# Set to 0 to disable this feature
PT_USERTIME = "1800"

Finally restart the CSF using below command.

root@server [/etc/csf]# csf -r
Flushing chain `INPUT'
Flushing chain `FORWARD'
Flushing chain `OUTPUT'
Flushing chain `ALLOWIN'
Flushing chain `ALLOWOUT'
.
.
.
Restarting bandmin acctboth chains for cPanel
acctboth  all opt -- in * out *  0.0.0.0/0  -> 0.0.0.0/0
acctboth  all opt -- in * out *  0.0.0.0/0  -> 0.0.0.0/0
acctboth  all opt -- in * out *  0.0.0.0/0  -> 0.0.0.0/0
acctboth  all opt -- in * out *  0.0.0.0/0  -> 0.0.0.0/0
LOCALOUTPUT  all opt -- in * out !lo  0.0.0.0/0  -> 0.0.0.0/0
LOCALINPUT  all opt -- in !lo out *  0.0.0.0/0  -> 0.0.0.0/0
LOCALOUTPUT  all opt    in * out !lo  ::/0  -> ::/0
LOCALINPUT  all opt    in !lo out *  ::/0  -> ::/0

We are preparing all articles in-depth to understand by all level/stage Linux administrators. If the article is useful for you, then please spend less than a minute to share your valuable comments in our commenting section.

Please stay tune with us…Good Luck.

About Magesh Maruthamuthu

Love to play with all Linux distribution

View all posts by Magesh Maruthamuthu

4 Comments on “How to disable Lfd excessive resource usage alert”

  1. Quick question. I normally stay logged in for an extended period of time via ssh. I tend to su to root and I constantly get messages about /bin/bash for my non-root user’s bash shell because it’s not doing anything. I’d like to disable the report for just my user with /bin/bash but keep it going for other users. So if someone else logs in and isn’t doing anything, I can kill their shell. Is there away to set it up so /bin/bash is ignored but only for one user? Thanks!

  2. That’s great, I can stop the alerts. But what is the alert about? Does my scripts work even though I exceeded the virtual memory? Can’t I add virtual memory allowance?

  3. I’m trying to determine what is a reasonable amount of memory usage; is more than 200 unreasonable?

Leave a Reply to Spork Schivago Cancel reply

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