added mobots
This commit is contained in:
parent
56c14def07
commit
890383cdbe
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue