1

I want a simple cron job for Debian which could check for basic things like disk full or high load.

I believe there is already made solutions, so I can save my time and not write my own script.

Any suggestions are welcome.

UPD: I will stick to monit because its easier to setup, but if I would need something more complicated I will use Nagios plugins.

Thanks everyone!

Max Tsepkov
  • 139
  • 2
  • 8

2 Answers2

5

As Bart notes, you can use Nagios/Nagios plugins to do this.

You can also set up Monit, which will give you some basic monitoring in a nice, simple package. Monit will also do "process healing", so, if, say, the ClamAV process falls over, Monit will notice that event, inform you of it, and restart it. Monit runs as a daemon, so you won't have to muck around with cron.

Besides the standard systems stuff (load, disk space, free RAM), here's some configuration sample for a variety of services: http://mmonit.com/wiki/Monit/ConfigurationExamples

Ah, Debian docs on Monit:

http://www.debian-administration.org/articles/269

cjc
  • 24,533
  • 2
  • 49
  • 69
4

I tend to use Nagios Plugins for this. They are meant for nagios, but you can just use them as standalone scripts. They will return OK, WARNING or ERROR, followed by some extra info.

Just take the bits you want to check and make a tiny script to run them, mail/save the results and put it in the crontab.

Bart De Vos
  • 17,761
  • 6
  • 62
  • 81
  • Looking at return codes can also be useful - http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN76 – andol Apr 23 '12 at 15:12