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


--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to