Results 1 to 10 of 11
Threaded View
-
21st Jan 2011, 06:48 PM #1OPMemberWebsite's:
Elite.SO Defendos.com Motionite.com[PHP] SLN - Server Load Notifier v1.0 - Opensource
Hello, I've coded this small script to keep and eye out of my server
SLN - Server Load Notifier v1.0 - Coded by l0calh0st!
This script will notify your whenever your server load gets higher then $overmax value. Please ensure you have the following cronjob running:
"php /home/YOUR_USER_NAME/public_html/sln.php> /dev/null"
Without the quotes "", also don't forget to change YOUR_USER_NAME to the (cpanel) account username. 5 minutes interval should be fine.
PHP Code:<?php
/*
SLN - Server Load Notifier v1.0 - Coded by l0calh0st!
This script will notify your whenever your server load gets higher then $overmax value. Please ensure you have the following cronjob running:
"php /home/YOUR_USER_NAME/public_html/sln.php> /dev/null"
Without the quotes "", also don't forget to change YOUR_USER_NAME to the (cpanel) account username.
*/
// Edit the configurations below:
$overmax = "5"; // Maximum server load to notify. If the server load gets higher then this value, you will get mail :P
$email = "your@email.com"; // Server admin email, this script will email to the following email.
// DO NOT EDIT BELOW - Get current server load without exec. Most webhosts have this option disable for security reasons.
$load=file_get_contents("/proc/loadavg");
$load=explode(' ',$load);
$loadnow=$load[0];
// Detect if the server load get higher then your value.
if ($loadnow >= $overmax ) {
// Ooh noes! server load got higher! Start spammin'
$sub = "SLN Overload Detected!";
$mess = "Hello,\n\nOverload has been detected by SLN scripts.\n\nThe load was: $loadnow";
mail($email, $sub, $mess);
}
else
{
// die...
}
?>
"php /home/YOUR_USER_NAME/public_html/sln.php> /dev/null" without quotes. Doesn't matter which interval, 5minutes is okay.l0calh0st Reviewed by l0calh0st on . [PHP] SLN - Server Load Notifier v1.0 - Opensource Hello, I've coded this small script to keep and eye out of my server :) SLN - Server Load Notifier v1.0 - Coded by l0calh0st! This script will notify your whenever your server load gets higher then $overmax value. Please ensure you have the following cronjob running: "php /home/YOUR_USER_NAME/public_html/sln.php> /dev/null" Without the quotes "", also don't forget to change YOUR_USER_NAME to the (cpanel) account username. 5 minutes interval should be fine. <?php /* Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
How to decrease Server load on VPS
By Spartan in forum Server ManagementReplies: 21Last Post: 19th Jul 2012, 09:59 PM -
I need help with server, high load
By First-Dragon in forum Server ManagementReplies: 4Last Post: 22nd Jun 2012, 09:37 PM -
Server CPU load
By tractor3231 in forum Server ManagementReplies: 6Last Post: 10th Jul 2011, 04:52 AM -
Server Load
By Last Word in forum vBulletinReplies: 0Last Post: 3rd Apr 2010, 10:45 AM -
Server Load - [Help]
By G56Ace in forum Webmaster DiscussionReplies: 8Last Post: 10th Jun 2009, 06:52 PM
themaLeecher - leech and manage...
Version 5.02 released. Open older version (or...