1
1
Fork 0

added mobots

This commit is contained in:
David Starzengruber 2010-06-29 23:31:23 +02:00
parent 56c14def07
commit 890383cdbe
2 changed files with 63 additions and 0 deletions

21
mobots/df.conf Normal file
View File

@ -0,0 +1,21 @@
## df mobot configfile
## options
log="1"
logfile="/var/log/mobots/df.log"
jabber="1"
local_only="1"
user="nobody"
group="nobody"
### which disks you wanna check?
# if you do not define anything here
# i will get you informed about every
# disk reaching the 90% mark.
disk0="/dev/sda5"
disk1="/dev/sda1"
disk2="/dev/sda9"
disk3=""
disk4=""
# you can go on like this

42
mobots/df.sh Executable file
View File

@ -0,0 +1,42 @@
## disk_free jabber bot ##
##########################
## configuration section
configfilepath=$(pwd)
if [ -f $configfilepath/df.conf ]; then
source $configfilepath/df.conf
else
echo "Exiting because there is no config file."
exit 1
fi
## default config
if [ -z $logfile ]; then
# using default path
logfile="/var/log/mobots/df.log"
else
echo "using logfile defined in the config file"
fi
## ckeck environment
## get local disks
## check disks
data=$(df -Pl | grep $disk0)
echo $data
## actions (jabber, logfile)
## testing output
echo $logfile
## exiting
exit 0