Part of my day-job is based around monitoring a business critical group of servers at work, so it seemed natural to try and implement some monitoring on a server I help look after for LSU CompSoc.
Given the major differences between the two environments and their importance, I thought a basic shell script should do the job for now (tested on Ubuntu 8.04.3 LTS). The check’s I’ve implemented are Disk space checks, NIC errors, user changes (add/delete), package check, and checks for apache & mysql. Also I’ve made sure that the script will run as a normal user so no need for sudo access to anything.
I’ve attached the script incase anyone else finds it of use (You’ll need to modify the settings section as appropriate for your own server and create the relevant paths referenced in the settings. The script is also dependent on this Perl SMTP CLI mailer (you’ll need to download a copy onto your server). I plan to modify the script to support other mail methods but at present it just does what I needed from it.
I’ve also got another script to notify of any reboots and will add that here shortly.
Bash Monitoring Script (49)
One thing I tend to do is have a server on the net with “Opsview” installed, then any machine I need to monitor has the “Opsview agent” installed, then the opsview server monitors that agent – so it can check CPU, memory, disk space, apache processes, mysql replication etc.
The one down side to it is that you need a server to run the Opsview process on!
Of course, the one thing your package does is a bit of auditing, I tend to do this with etckeeper, but yours is far more integrated.
Seems quite nice, I’ll have to look into it!