summaryrefslogtreecommitdiffstats
path: root/abs/core/xymon/hobbit-myth-orphan.sh
blob: 5cba136521042d39596e376b15b97f347cd107fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
TMPFILE=/tmp/oprhan.result
MYTHCONFDIR=/usr/share/mythtv /usr/LH/bin/find_orphans.py --printonly > $TMPFILE


COLUMN=orphan    # Name of the column
COLOR=green      # By default, everything is OK
MSG="All OK"




#yellow
for i in "Orphaned video files" "Orphaned snapshots" "Database backups" "Other files"
do
   grep -q  "$i" $TMPFILE
   status=$?
   if [ $status -eq 0 ]
   then
       COLOR="yellow"
       MSG="Problems found"
   fi
done

#red
for i in "Recordings with missing files" "Zero byte recordings"
do
   grep -q  "$i" $TMPFILE
   status=$?
   if [ $status -eq 0 ]
   then
       COLOR="red"
       MSG="Problems found"
   fi
done

MSG="
    ${MSG}
    `cat $TMPFILE` "
# Tell Hobbit about it
$BB $BBDISP "status $MACHINE.$COLUMN $COLOR `date`
   ${MSG}
   " 
exit 0