General system healthcheck report that provides an email notification containing the following information:
- Hostname and system uptime
- CPU percentage usage
- System load averages
- Memory consumption
- Disk usage
- IO stats
- Currently logged in users
- Last 10 logins
- Top 10 processes by CPU
- Top 10 processes by memory
The following dependencies are required:
sendmail- Available via most package managers, for example:
- Debian variants:
apt-get install sendmail - Red Hat variants:
yum install sendmail
- Debian variants:
- The script will pipe the contents of the report into the
sendmailexecutable for email delivery.
- Available via most package managers, for example:
Note that these instructions do not detail the installation and configuration of the above package.
The following variables must be set in the script:
TO_EMAIL- The email addess to which the bandwidth report is sent by
sendmail.
- The email addess to which the bandwidth report is sent by
CMD_SENDMAIL- The path to the installed
sendmailexecutable.
- The path to the installed
The script can be invoked manually, however ideally it should be invokved through a cron job.
Alternatively, the script can be placed into the /etc/cron.daily, /etc/cron-weekly and / or the /etc/cron.monthly directories, which will be automatically invoked at the respective frequencies. Note that in order for the script to be detected in these directories, the extension .sh should be removed.
- All logs generated by the script are redirected to
stdout. It is normally the responsbility of the invoker to handle the log output.
Bandwidth reporting script that utilises vnstat to provide email notifications to system administrators with bandwidth usage details for the previous week, day or month.
The following dependencies are required:
vnstat- Provides bandwidth monitoring via the terminal.
- Available via most package managers, for example:
- Debian variants:
apt-get install vnstat - Red Hat variants:
yum install vnstat
- Debian variants:
sendmail- Available via most package managers, for example:
- Debian variants:
apt-get install sendmail - Red Hat variants:
yum install sendmail
- Debian variants:
- The script will pipe the contents of the report into the
sendmailexecutable for email delivery.
- Available via most package managers, for example:
Note that these instructions do not detail the installation and configuration of the above packages.
The following variables must be set in the script:
MODE- Determines the range of bandwidth information reported, must be one of
daily,weeklyormonthly.
- Determines the range of bandwidth information reported, must be one of
TO_EMAIL- The email addess to which the bandwidth report is sent by
sendmail.
- The email addess to which the bandwidth report is sent by
CMD_VNSTAT- The path to the installed
vnstatexecutable.
- The path to the installed
CMD_SENDMAIL- The path to the installed
sendmailexecutable.
- The path to the installed
The script can be invoked manually, however ideally it should be invokved through a cron job.
Alternatively, the script can be placed into the /etc/cron.daily, /etc/cron-weekly and / or the /etc/cron.monthly directories, which will be automatically invoked at the respective frequencies. Note that in order for the script to be detected in these directories, the extension .sh should be removed.
### Notes
- All logs generated by the script are redirected to
stdout. It is normally the responsbility of the invoker to handle the log output.