|
From: | Eric Pailleau |
Subject: | Re: [monit] Monitoring space on all disks |
Date: | Wed, 27 May 2009 14:13:40 +0200 |
User-agent: | Thunderbird 2.0.0.21 (X11/20090330) |
You certainly need to watch /proc/mounts for change and exec a script that create monit config file(s) in monit config include directory, then restart monit, that will include newly include files checking spaces.
Below an example that you may customize to you own way... (let call it 'mcfu.rc' ) --------8<----------------------------------------------------------------- #!/bin/bash ### mcfu.rc : monit config file update for i in `cat /proc/mounts | cut -d ' ' -f 1 | grep -v none | tr "\n" " "` ; do echo "### Checking $i" echo "check filesystem "`basename $i`" with path $i " echo " if space usage > 80 % then alert " echo "" ; done --------8<------------------------------------------------------------------ In your generic monit file, something like : --------8<----------------------------------------------------------------- check file mounts path /proc/mounts if changed sha1 checksum then exec "/usr/local/bin/mcfu.rc > /etc/monit/includes/checkspace.monit && /etc/init.d/monit restart" include /etc/monit/includes/checkspace.monit --------8<----------------------------------------------------------------- Regards
[Prev in Thread] | Current Thread | [Next in Thread] |