Charles Steinkuehler wrote:
> 
> > > - Alter weblet disk-checking script to ignore CD-ROM (always 100% full)
> >
> > I am not following the weblet CD-ROM issue.  I am running weblet 1.2.0
> > off of DCD 1.0.2.  I've clicked all around on the weblet web pages and I
> > do not see where the CD-ROM is reported at all.
> 
> If you mount the CD-ROM, the weblet disk-check script will report an error.
> This only occurs when the CD-ROM is actually mounted (ie it shows up in the
> output of df).  The disk monitoring script should probably be modified to
> ignore read-only media.
> 
ahhhhhh.  I see the problem now after I mounted the cdrom.  I didn't
save the original file to do a diff on it, but a weblet checkdisk
solution is listed below.  I am not posting all of it because my message
would get bounced because of html content.  I simply added a case
statement and ignored all lines that are not /dev/ram?  Four lines of
comments explain my rational in the code below.

I hope this helps,
Greg Morgan

for line in `df | grep /dev/` ; do
   # Look at the greped line returned from df.
   # We are only concerned about shortage of space on the ram drives.
   # All other mounted media is presumed to be some sort of boot media.
   # The default case statement will ignore it especially cdroms.
   case $line in
   *ram*)
        IFS=$OIFS
        set -- $line

        DEV=${1#/dev/}
        
        used=${5%\%}
        used=${used:-100}

        free=${4:-0}
        pcnt=$(( ${free} * 100 / ${2:-1} ))

        eval WRN_PCNT=\$WRN_DISK_${DEV}_PCNT
        eval WRN_K=\$WRN_DISK_${DEV}_K
        eval ERR_PCNT=\$ERR_DISK_${DEV}_PCNT
        eval ERR_K=\$ERR_DISK_${DEV}_K

        WRN_PCNT=${WRN_PCNT:-$WRN_DISK_PCNT}
        WRN_K=${WRN_K:-$WRN_DISK_K}
        ERR_PCNT=${ERR_PCNT:-$ERR_DISK_PCNT}
        ERR_K=${ERR_K:-$ERR_DISK_K}

        [ "$pcnt" -le "${WRN_PCNT}" ] && setwarn
        [ "$free" -le "${WRN_K}" ] && setwarn
        [ "$pcnt" -le "${ERR_PCNT}" ] && seterror
        [ "$free" -le "${ERR_K}" ] && seterror
        ;;
   *) 
        continue
        ;;
   esac
done

_______________________________________________
Leaf-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-user

Reply via email to