monitoring scripts

Here you will find scripts for monitoring various things. I currently have 4 different monitoring scripts. The most recent is to let you know when new POP accounts are added. It was added March 15, 2006.

These scripts are run by a cron job and can be placed just about anywhere. I usually place mine in a subdirectory of the servers /scripts directory. The scripts themselves include full instructions.

Scroll down the page or use these links to go to the one you want.

- monitor changes - watch for changes anywhere you want on the server
- watch wwwacct - monitor customizations to WHM's wwwacct script
- monitor server load - monitor your server load with auto emails
- monitor POP accounts - get emailed when new POP accounts are added added March 15, 2006
        might help watch for spammers

be sure to upload scripts in ascii mode


Monitor Changes script

Script to notify you of changes in specified directories: PWSmonitorchanges V2.0
  Created - in 2003 (V1.0)
  Modified - September 12, 2004 (V2.0)
        rewrote script to make usable by others
  Last Modified - November 30, 2004 (V2.1)
        now also gives owner and group of modified files(*)
(*) feature not in free version

This script allows you to monitor changes to any directories on your server.

You specify the directories to watch, and the file extensions you want to watch for, and you are emailed whenever there is a change. The uses for this script are only limited by you. It was originally to watch the activity of new customers, but can be used for much more.

Save the following files to wherever you prefer on your server. I use /scripts/custom. Rename the PWSmonitorchanges.txt file to PWSmonitorchanges.cgi.

Monitor Changes script V2.0 (free version) - rename to PWSmonitorchanges.cgi
"Scripts Club" members know where to find the "added features" version.
directories file - specifies what directories to watch
(modify the directories list any way you want)

Read the instructions at the beginning of the script, then start watching for new emails.


Watch wwwacct script

Script to monitor wwwacct script customizations: PWSwatchwwwacct V1.1
  Created - in 2003 (V1.0)
  Modified - September 12, 2004 (V1.1)
        minor modifications to make usable by others

If you make any customizations to the wwwacct script, you need this to monitor it.

What this script does is compare your custom wwwacct script to a copy of it. If a cpanel update changes the wwwacct script, this script will notice the change. Many upgrades only change the wwwacct script back to what it was originally. If it's changed, this script compares the new wwwacct to a copy of the original one. If the update merely wrote the original one back, it would match the copy. This script would then take the copy of your custom one and reuse it. If the update altered the script, you would be emailed and told that your customizations are lost and that you will need to redo them. The script does tell you where changes were made to help with reapplying your customizations. I customized my wwwacct script over a year ago and have only had to redo the changes maybe half a dozen times.

Save the following file to wherever you prefer on your server. I use /scripts/custom. Rename the PWSwatchwwwacct.txt file to PWSwatchwwwacct.cgi.

Watch wwwacct script - rename to PWSwatchwwwacct.cgi

Read the instructions at the beginning of the script, then relax. You won't need to redo your customizations every time cpanel updates.


Monitor Server Load script

Script to monitor server load automatically: PWSservermonitor V5.1
  Created - October 20, 2004 (V1.0)
  Modified - October 20, 2004 (V2.0)
        added ability to ignore some commands or users(*)
        added ability to specify minimum time between emails(*)
  Modified - October 21, 2004 (V2.1)
        changed how it finds the starting point
  Modified - October 22, 2004 (V2.2)
        adjustment for output on multiple CPU server
  Modified - October 23, 2004 (V3.0)
        added monitoring of average server load
        adjustment for operation on multiple CPU server
  Last Modified - October 23, 2004 (V3.5)
        changed how output is deciphered
        gives a cleaner output for your email
        added notification if output doesn't appear to work with script
  Modified - November 27, 2004 (V4.0)
        adjusted for long running processes
        sends email warning for processes using over 1000 minutes CPU time
  Modified - January 27, 2005 (V4.5)
        activated multiple checks per minute feature(*)
        modified email subject to give more detail for easier quick looking(*)
  Modified - May 10, 2005 (V5.0)
        now ignores short term high load processes(*)
        commands to ignore option is less specific(*)
  Last Modified - July 9, 2006 (V5.1)
        modified for top outputs with no decimal in CPU % and with decimal in time
(*) features not in free version

This script monitors your server load and emails you when it goes over a point you set.

Save the following file to wherever you prefer on your server. I use /scripts/custom. Rename the PWSservermonitor.txt file to PWSservermonitor, set some variables, and set a cron job to run it.

Server Monitor script V5.1 (free version) - rename to PWSservermonitor
"Scripts Club" members know where to find the "added features" version.

Read the instructions at the beginning of the script, then sit back and relax.


Monitor POP accounts

Script to notify you of new POP accounts: PWSmonitorPOPs V1.0
  Created - March 15, 2006 (V1.0)

This script is quite simple. It gets a list of current POP accounts, then at whatever frequency you specify, it gets a new list and compares the 2 to see if any new POP accounts have been created since the last check. If so, it emails you the new POP email address and the path to its folder.

Save the following file to wherever you prefer on your server. I use /scripts/custom. Rename the PWSmonitorPOPs.txt file to PWSmonitorPOPs.cgi.

Watch wwwacct script - rename to PWSmonitorPOPs.cgi

Read the instructions at the beginning of the script, set a couple variables, then set the cron job for your desired frequency.


Custom Scripts main page

Scripts Club
for a small donation you get access to the WHM scripts and improved versions of other scripts,
as well as other luxuries of being a "Scripts Club" member.

Go Back

Photography everything - daphotography.com