Get the most out of your Centmin Mod LEMP stack
Become a Member

Beta Branch add /etc/csf/load.sh script for additional server stats

Discussion in 'Centmin Mod Github Commits' started by eva2000, Apr 19, 2018.

  1. eva2000

    eva2000 Administrator Staff Member

    36,342
    7,981
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,290
    Local Time:
    3:01 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    add /etc/csf/load.sh script for additional server stats

    - When csf firewall's lfd daemon detects & triggers a high cpu load alert (over 15 min interval) defined in /etc/csf/csf.conf config file with related PT_LOAD variables, it usually sends an lfd email alert. CSF Firewall can also be configured via PT_LOAD_ACTION setting to run a custom script i.e. /etc/csf/load.sh when high cpu alert is triggered. This update configures a custom /etc/csf/load.sh script on Centmin Mod 123.09beta01 and newer versions which will call cminfo top and netstat commands outlined at Beta Branch - update cminfo cmd with top related server statistics and Beta Branch - update cminfo command with netstat flag option and send a 2nd high cpu alert email to the email address defined in LF_ALERT_TO in /etc/csf/csf.conf if the email in LF_ALERT_TO is empty it sends email to root system user's inbox.
    - Also previously the PT_LOAD_LEVEL was hardcoded to value of 8 in /etc/csf/csf.conf, but on this update it will be changed to the value equal to number of cpu threads detected on the server which is a more accurate value to monitor and alert for.

    Continue reading...

    123.09beta01 branch
     
    • Like Like x 2
  2. upgrade81

    upgrade81 Premium Member Premium Member

    133
    6
    18
    Sep 5, 2016
    Italy
    Ratings:
    +8
    Local Time:
    7:01 PM
    1.13.8
    10
  3. eva2000

    eva2000 Administrator Staff Member

    36,342
    7,981
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,290
    Local Time:
    3:01 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    restarting a service due to high cpu loads isn't the answer, you need to figure out what is causing the high cpu loads instead.
     
..