email notifactions
Forum
  1. Forums
  2. CloudLinux and Control Panels
  3. CloudLinux and cPanel
  1. Frank Doud
  2. Monday, 29 September 2014
  3.  Subscribe via email
Hi,


Following accounts experienced issues in the past 1 hours
 
==========================================================================
| Username | Domain | Name | CPU | IO |  Memory | EP | NPROC |
==========================================================================
| username  |domain name | ---  |  0  | 0  | 27.5 MB | 0  |   0   |
==========================================================================

Are the items shown at time of issue? Because their is no limit being it according to info above. And if the data sent is not at time of issue. what steps do I need to take to make that appear correct?

Thanks
Frank
Rate this post:
  1. 29.09.2014 14:09:22
  2. # 1
Scott Neader Accepted Answer
Posts: 89
Joined: 12.06.2014
0
Votes
Undo
Completely useless notifications.  Really strange that this has not been fixed yet.

- Scott
  1. 17.10.2014 12:10:09
  2. # 2
Ryan Smith Accepted Answer
Posts: 2
Joined: 17.02.2012
0
Votes
Undo
Since there\'s zero documentation on email notifications and I feel that they are absolutely critical as client\'s hitting their resource limits often blame the host for being slow without knowing it\'s their website causing the problems I\'m wondering what settings everyone is using in regards to frequency and faults triggered.

I don\'t want to send emails too frequently as that would annoy the customer so I was thinking one per day would work but how many faults do you suggest be the minimum to send an email to the client?
  1. 19.10.2014 18:10:02
  2. # 3
Host Provider Accepted Answer
Posts: 48
Joined: 31.01.2012
0
Votes
Undo
These emails are less than useless since they don't actually provide any useful information to the end-user or the admin.

At best, the end-user will login to their cpanel and click the Resource Usage link.  At worst, they'll log a support ticket and start badgering the helpdesk to explain what is the problem, how it isn't possible their tiny little wordpress website isn't exceeding anything, etc.  and then we must try to prove them wrong with no helpful information.
  1. 04.12.2014 13:12:34
  2. # 4
Kevin Morrison Accepted Answer
Posts: 11
Joined: 25.09.2013
0
Votes
Undo
Can a developer elaborate on this? There has to be some obvious reason why this report is failing to produce anything useful. If not how in the world can it be turned off?
  1. 04.12.2014 13:12:01
  2. # 5
Scott Neader Accepted Answer
Posts: 89
Joined: 12.06.2014
0
Votes
Undo
I find it incredibly frustrating that such a needed service (notification of faults) is not working.  If you want to stay in the hosting business, you need to provide good customer service.  We cannot do this, without timely and accurate and useful fault notifications.

- Scott
  1. 04.12.2014 14:12:54
  2. # 6
Kevin Morrison Accepted Answer
Posts: 11
Joined: 25.09.2013
0
Votes
Undo
I agree with Scott and I find it rather rude that a dev has not made a comment here or offered any assistance to resolve this obvious problem. Not at all a professional way to conduct business!
  1. 04.12.2014 16:12:53
  2. # 7
Marcus Kerr Accepted Answer
Posts: 4
Joined: 23.10.2014
0
Votes
Undo
You can find the settings within the Options tab of the cPanel / WHM login
I have mine set to :
send an eMail to admin only
once per hour
at least one fault

I receive mine at xx:13 every hour
If there were no faults in the previous hour I do not receive an eMail

Whilst I agree this notification is a little misleading, login to the clients account (fr om the provided Domain Name) and you can determine wh ere the issue resides
However, this can take time as you may need to look at the raw access logs and the latest visitor list

It can be quicker to simply leave the LVE Manager in view and watch for specific accounts that remain visible and do not disappear

Now for the misleading part
For each account you set the Memory Limit
This is the number of 4KB pages, not the actual amount of memory
Depending on the packages, I have set 256, 512, 1024, and 2048
This equates to 1MB, 2MB, 4MB, and 8MB respectively
I then receive notifications which exceed these limits
You just need to remember to convert the number of pages into MB
These limits may appear incredibly low when the server has a limit of 2,048MB but this pretty much spreads the availability across accounts
In turn customers whose websites are regularly reaching the lim it can then be encouraged to upgrade to a more appropriate account, which in turn gives them more access to higher resources
  1. 04.12.2014 17:12:14
  2. # 8
Kevin Morrison Accepted Answer
Posts: 11
Joined: 25.09.2013
0
Votes
Undo
Misleading is not the word I would use to describe this. I get this alert for all accounts telling me there is a resource issue and yet the report does not show any account that is even close to the limits set. The fact is it is sending me this report for no reason what so ever because none of the accounts are misbehaving. Plus when the report is sending

I have set my parameters like yours, will see if that makes a difference. Thanks for the help...;)
  1. 04.12.2014 17:12:14
  2. # 9
Marcus Kerr Accepted Answer
Posts: 4
Joined: 23.10.2014
0
Votes
Undo
Mine works perfectly well
Therefore this suggests an installation issue
As you can see below, I receive two eMails; one fr om LVE (cloudlinux) and one from LFD (firewall)
This confirms an issue exists with this account and the cause

Recent example of mine, this account has a lim it of 512 (1MB) :

Subject : Hosting account resources exceeded
==========================================================================
| Username | Domain | Name | CPU | IO | Memory | EP | NPROC |
==========================================================================
| [username] | [Domain Name] | --- | 0 | 0 | 3.0 MB | 0 | 0 |
==========================================================================

Subject : lfd on [server name]: Excessive processes running under user [username]
Time: Thu Oct 30 23:03:01 2014 +0000
Account: [username]
Process Count: 13 (Not killed)
User:[username] PID:677783 PPID:677532 Run Time:4(secs) Memory:226912(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/[username]/public_html/forum/posting.php
  1. 04.12.2014 17:12:56
  2. # 10
Scott Neader Accepted Answer
Posts: 89
Joined: 12.06.2014
0
Votes
Undo
Marcus, this has nothing to do with LFD.  We are only talking about alerts from CloudLinux (which can be sent to the root owner, reseller and/or end customer).

The example you showed confirms what we are saying.  It says that "Hosting account resources exceeded" but it does not specify which resource and it does not say by how much.

Your example email says 0 under NPROC.  0 processes?  How is that excessive processes?  

- Scott
  1. 05.12.2014 01:12:15
  2. # 11
Bogdan Accepted Answer
Posts: 709
Joined: 26.06.2013
0
Votes
Undo
I believe this happens when Minimum number of faults to notify admin is set to 0, simply it notify you every time how notification period is configured even when there were no faults. Yes that is a bit frustrating, maybe we need some explanation in WHM > CL LVE Manager > Options for this.
  1. 05.12.2014 01:12:38
  2. # 12
Scott Neader Accepted Answer
Posts: 89
Joined: 12.06.2014
0
Votes
Undo
No, we have ours set to minimum fault of 1 for admin notifications.

The notifications are accurate... when we receive a notification, I can see that there was a fault for that customer.  The problem is the notifications are not very useful.  They do not tell you which fault the customer hit.  The notifications give you CURRENT data about that customer (usually this is after the fault has occurred and the traffic has settled down), not the HISTORICAL data that triggered the fault.

Someone fr om CloudLinux has explained this in another thread somewh ere.  I believe they know about this problem, but just can't seem to find the time to FIX it.

- Scott
  1. 05.12.2014 03:12:24
  2. # 13
Host Provider Accepted Answer
Posts: 48
Joined: 31.01.2012
0
Votes
Undo
Hi everyone.  I agree 100% that the notification email sent by CloudLinux is less than useless.  It does not help the customer at all unless they are already technical people.  At best, it just creates questions for them and then they will contact support for help...

Since the built-in notification system in Cloudlinux is not good, I have created my own email notification system.  Here is an example of what our customer's receive if they exceed any of their LVE limits:



Your "username" web hosting account exceeded one or more of its resource limits within the last 24 hours:
 
- Exceeded the CPU limit of 13% of total server CPU. Your website was forced to load slower to reduce its CPU usage.

- Exceeded the maximum of 75 concurrent website connections. Your website was not available 67 times because of this problem.

- Exceeded the maximum of 116 total account processes. Your website was not available 385 times because of this problem.
 
To view full details about your web hosting account's resource usage, including the time of each incident listed above, please click the link below and log into your cpanel hosting control panel, then click the "Resource Usage" link under the "Logs and Statistics" section. 

 http://domainname.com/cpanel
 
If your account is regularly exceeding it's available resources, please consider upgrading to a higher level hosting plan that includes more resources. If you have any questions or need help with anything, just reply to this email and let us know.



I think this notification is MUCH better than what CloudLinux has, because it includes very specific details about what limit was exceeded, what is the limit, and by how much it was exceeded.

I have already provided the script I am using to create this notification to CloudLinux developers, and I am disappointed they have not bothered to "fix" the useless notification system that is built-in.  It shows how much the company is operated by very smart technical people, but have not too much business skill or understanding of what end-user hosting customers actually need.
  1. 05.12.2014 08:12:17
  2. # 14
Marcus Kerr Accepted Answer
Posts: 4
Joined: 23.10.2014
0
Votes
Undo
The example you showed confirms what we are saying. It says that \"Hosting account resources exceeded\" but it does not specify which resource and it does not say by how much.

Your example email says 0 under NPROC. 0 processes? How is that excessive processes?


I have set several process limits, this includes the Virtual Memory Limit and Physical Memory Limit
As above, you can find these settings in the LVE tab

The settings I have in place are confirmed from the LFD eMail, which then allows me to determine what exactly the cause is, as it lists the files causing the account to be limited
  1. 05.12.2014 10:12:51
  2. # 15
Kevin Morrison Accepted Answer
Posts: 11
Joined: 25.09.2013
0
Votes
Undo
Thanks Marcus, I changed the minimum number of faults to 1 and now I am getting a more realistic representation of the real problems.
  1. 05.12.2014 11:12:56
  2. # 16
Marcus Kerr Accepted Answer
Posts: 4
Joined: 23.10.2014
0
Votes
Undo
It took me almost all of the 14 day free trial period to work out how these notifications worked and their subsequent eMail notices
I agree, there is a complete lack of (easily found) documentation but it is there

The first thing to be aware of is that all the items being monitored are classed as processes; CPU, Memory, IO, and NPROC
The first slightly misleading item is the NPROC

As per my reply #8
The Memory is not the actual memory in RAM, but the number of 4KB pages
This just means you need to remember to either multiply or divide by 4, depending on what you are trying to achieve

However, I had severe problems trying to work out where to find the cause of an account reporting Excessive Account Resources
Once I had all these settings within LVE I then transferred them to LFD, and this resolved the issue
I now receive an hourly eMail from LVE (if an account exceeds a resource) followed by one from LFD explaining the actual cause
  1. 16.12.2014 22:12:48
  2. # 17
Ryan Smith Accepted Answer
Posts: 2
Joined: 16.12.2014
0
Votes
Undo
Any chance you\'d be willing to release your modified version to the community Host Provider?
  1. 19.12.2014 13:12:57
  2. # 18
Host Provider Accepted Answer
Posts: 48
Joined: 31.01.2012
0
Votes
Undo
Sure.  Here is the code that I am using.  It needs to be tweaked a bit to send to the account holders, as for now we have it sent only to admin. But it gives a much better report than the useless one CloudLinux is doing...

It's PHP code, and needs to run via cron with whatever frequency you want.



//---------------
$email_from = "[email protected]";
$email_cc = ""; //[email protected]";   // Leave blank if not needed.
$email_subject = "Hosting account resources exceeded";
$lveinfo_period = 24;   // Number of hours for the lveinfo to report.
//---------------

//==================================================================================================
$lveinfo_cmd = '/usr/sbin/lveinfo --period="'.$lveinfo_period.'h" --by-fault="any" --display-username --csv --limit=999';
// lveinfo --period="2h" --by-fault="any" --display-username --limit=999
// Get list of users who have had faults or exceeded limits.
exec($lveinfo_cmd, $lve_cmd_output);
array_shift($lve_cmd_output);   // Remove 1st line of output array, since it is just header info.
// For each user in the list…
foreach ($lve_cmd_output as $line) {
  //echo "$line\n";
  // Put the line into usable variables.
  list($ID,$aCPU,$mCPU,$lCPU,$aEP,$mEP,$lEP,$aVMem,$mVMem,$lVMem,$VMemF,$EPf,$aPMem,$mPMem,$lPMem,$aNproc,$mNproc,$lNproc,$PMemF,$NprocF,$aIO,$mIO,$lIO) = explode(",", $line);
  //echo "$ID,$aCPU,$mCPU,$lCPU,$aEP,$mEP,$lEP,$aVMem,$mVMem,$lVMem,$VMemF,$EPf,$aPMem,$mPMem,$lPMem,$aNproc,$mNproc,$lNproc,$PMemF,$NprocF,$aIO,$mIO,$lIO \n";
  $message = "** ATTENTION **\n\nYour \"".$ID."\" web hosting account exceeded one or more of its resource limits within the last ".$lveinfo_period." hours:\n\n";
  // Determine what had a fault and/or exceeded a limit and make a message for user.
  // CPU
  if ( $mCPU >= $lCPU ) {
$message = $message . "- Exceeded the CPU limit of $lCPU% of total server CPU. Your website was forced to load slower to reduce its CPU usage.\n";
  }
  // Concurrent Connections
  if ( $EPf >> 0 ) {
$message = $message . "- Exceeded the maximum of $lEP concurrent website connections. Your website was not available $EPf times because of this problem.\n";
  }
  // Virtual Memory
  if ( $VMemF >> 0 ) {
$message = $message . "- Exceeded the ".displayFileSize($lVMem)." virtual memory limit. Your website was not available $VMemF times because of this problem.\n";
  }
  // Physical Memory
  if ( $PMemF >> 0 ) {
$message = $message . "- Exceeded the ".displayFileSize($lPMem)." physical memory limit. Your website was not available $PMemF times because of this problem.\n";
  }
  // Number of Processes
  if ( $NprocF >> 0 ) {
$message = $message . "- Exceeded the maximum of $mNproc total account processes. Your website was not available $NprocF times because of this problem.\n";
  }
  // Disk IO
  if ( $mIO >> $lIO ) {
$message = $message . "- Exceeded the maximum disk io rate. You used ".displayFileSize($mIO)." of ".displayFileSize($lIO).". The disk io speed for your account was slowed as a result of this problem. \n";
  }
  //
  // Number of Inodes
  //
  // Get user's contact email(s) from cpanel account info.
  $cpanel_account_info = file("/var/cpanel/users/".$ID);
  array_shift($cpanel_account_info); // Remove 1st two lines.
  array_shift($cpanel_account_info);
  foreach ($cpanel_account_info as $line) {
    if (strpos($line,'CONTACTEMAIL=') !== false) {  // Does the string contain first contact email?
$values = explode("=", $line);
$CONTACTEMAIL = rtrim($values[1] ;) ;
    }
    elseif (strpos($line,'CONTACTEMAIL2=') !== false) {     // Does the string contain second contact email?
$values = explode("=", $line);
$CONTACTEMAIL2 = rtrim($values[1] ;) ;
    }
    elseif (strpos($line,'DNS=') !== false) {
$values = explode("=", $line);
$WEBSITE = rtrim($values[1] ;) ;
    }
    elseif (strpos($line,'OWNER=') !== false) {
$values = explode("=", $line);
$RESELLER = rtrim($values[1] ;) ;
    }
  }
  // Only send emails to our direct customers... not reseller's accounts.
  if ($RESELLER == "hostvaul" ;) {
    // Add some helpful instructions for more info.
    $message = $message . "\nTo view full details about your web hosting account's resource usage, including the time of each incident listed above, please click the link below and log into your cpanel hosting control panel, then click the \"Resource Usage\" link under the \"Logs and Statistics\" section.\n\n";
    $message = $message . "     http://".$WEBSITE."/cpanel\n\n";
    $message = $message. "If your account is regularly exceeding it's available resources, please consider upgrading to a higher level hosting plan that includes more resources.  If you have any questions or need help with anything, just reply to this email and let us know.\n\n";
    $message = $message. "Sincerely,\n\nThe My Company Support Team\n\n";
    $message = $message. "------------\nMy Company - http://www.mycompany.com\nOur customers sleep better.\n\n";
    // Send user the notification.
    $email_to = $CONTACTEMAIL;
    if (rtrim($CONTACTEMAIL2) != "" ;) {  $email_to = $email_to.",".$CONTACTEMAIL2; }
    // For testing.
    $message = $message . "------------------------------------------\n";
    $message = $message . "Email to: ".$email_to."\n";
    $email_to = "[email protected]";
    // End of testing.
    $headers = "From: ".$email_from;
    if (rtrim($send_cc) != "" ;) {  $headers =  $headers. "\r\n" ."CC: ".$email_cc; }
    mail($email_to,$email_subject,$message,$headers);
    echo $message;
  }
}

function displayFileSize($size,$unit="" ;) {
  if( (!$unit && $size >= 1<<30) || $unit == "GB" ;)
    return number_format($size/(1<<30))."GB";
  if( (!$unit && $size >= 1<<20) || $unit == "MB" ;)
    return number_format($size/(1<<20))."MB";
  if( (!$unit && $size >= 1<<10) || $unit == "KB" ;)
    return number_format($size/(1<<10))."KB";
  return number_format($size)." bytes";
}

?>
  1. 30.09.2017 12:09:16
  2. # 19
Sanel K Accepted Answer
Posts: 0
Joined: 23.08.2019
0
Votes
Undo
These notifications are most stupid thing any progeammer ever introduce...I just had server overload with your stupid notifications to resellers's end users...one reseller had 4 accounts with bots and while LVM worked perfektly to limit server resource abuse from users and reseller but than it abuse it it self by sending few thousand emails and mail in queue there was about 10000 emails...what I don't get it how it can send such huge number of emails when it was configure to send notification every 1 hour ...also why I as server owner can't disable sending notifications to reseller's users???You should set this feature completly optional since it is completly useless...now I have set "Minimum number of Faults to notify end user" to 1+ nice amount of ziro's and if this doesn't work I will remove it completly and maybe even move to Centos .
  1. 30.09.2017 12:09:42
  2. # 20
Sanel K Accepted Answer
Posts: 0
Joined: 23.08.2019
0
Votes
Undo
20 minutes after I empty mail queue ..142 records and 230 already sent ...372 emails for 20 minutes..
https://s25.postimg.org/wur1jkian/Screenshot_32.png
  • Page :
  • 1
  • 2


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.