This is monitoring files written in Perl. I use them on Amazon Linux.
It checks server resource and daemon status and sends e-mail.
- update
monitoring/config.pl
to adapt to your server. sudo file/root_setup.sh development ap
for development application server
sudo file/root_setup.sh development mail
for development mail server
sudo file/root_setup.sh production ap
for production application server
sudo file/root_setup.sh production mail
for production mail server
You can execute the above command everywhere.
Then, required Perl files are copied toroot
directory.
This checks resource and service status.
root_setup.sh
set the crontab to execute resource_check.pl
every 3 minutes and service_check.pl
every day.
- Service Check: check nginx status, and when they're down, reboot them and send mail.
- Service Check: check saslauthd and postfix status, and when they're down, reboot them and send mail.
- Resource Check: send the results of
df -h
andfree -m
as e-mail.
- If you want to check another services, change
root_setup.sh
andservice_check.pl
.root_setup.sh
defines programs to be checked according to the server type (ap or mail).service_check.pl
defines program information to be checked.