[Eisfair] Eisfair-1: Script läuft nicht mehr

Jürgen Witt j-witt at web.de
Di Dez 11 09:53:27 CET 2012


Hallo NG,

in einem Netzwerk mit 2 Eisfair-1-Servern habe ich folgendes Problem.

Dieses Script

#!/bin/bash
##-----------------------------------------------------------------------------
## Creation:     20091004  ms
## Last Update:  20100917  ms
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##-----------------------------------------------------------------------------

# symlink nach /etc/cron.hourly/
#
# Testet alle Filesystems von "df", ausser 
Filesystem|Dateisystem|tmpfs|cdrom
#

un=`uname -a`
hn=`hostname -f`
ip=`hostname -i`

debug=0
#debug=1

ALERT=95                        # Alarmgrenzwert in %

df -H | grep -vE '^Filesystem|Dateisystem|tmpfs|cdrom' | awk '{ print $5 
" " $6 }' | while read output;
do
     #echo $output

     useprozent=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
     partition=$(echo $output  | awk '{ print $2 }' )

     message="Hallo Admin, es gibt Arbeit.

Speicherplatz zu gering auf
$hn
$un
$ip

---------------------------------------------------
Partition $partition zu $useprozent % voll!
---------------------------------------------------

Liebe Gruesse vom cron-job!
"

     if [ $debug = 1 ]; then
         ALERT=7
         echo $useprozent
         echo $partition
         echo
         echo $message
         echo
     fi

     if [ $useprozent -ge $ALERT ]; then

         echo "$message" | mail -s "[Alert]  Speicherplatz zu gering" root


     fi
done

exit 0;


läuft auf einem der 2 Server nicht mehr.

Beim Ausführen bekomme ich diese Rückmeldung

/usr/bin/test-plattenplatz: line 56: [: -ge: unary operator expected
/usr/bin/test-plattenplatz: line 56: [: /backup: integer expression expected

Geändert wurde nur ein Mountpoint (von /mnt nach /mountpoint1). Auf dem 
Server, auf dem das Script noch läuft, sieht es so aus:

eis2 # mount
/dev/md3 on / type ext3 (rw,errors=remount-ro,acl,user_xattr)
/dev/md1 on /boot type ext3 (rw,errors=remount-ro)
/dev/md4 on /data type ext3 (rw,acl,user_xattr)
devpts on /dev/pts type devpts (rw)
usbfs on /proc/bus/usb type usbfs (rw)
/sys on /sys type sysfs (rw)
/dev/sdc4 on /mnt type ext3 (ro)
localhost:/mnt/data on /backup type nfs 
(ro,user=root,noexec,nosuid,nodev,addr=127.0.0.1)


Dort, wo es nicht mehr läuft, so:

server # mount
/dev/md3 on / type ext3 (rw,errors=remount-ro,acl,user_xattr)
/dev/md1 on /boot type ext3 (rw,errors=remount-ro)
/dev/md4 on /data type ext3 (rw,acl,user_xattr)
devpts on /dev/pts type devpts (rw)
usbfs on /proc/bus/usb type usbfs (rw)
/sys on /sys type sysfs (rw)
/dev/sdc4 on /mountpoint1 type ext3 (ro)
capifs on /dev/capi type capifs (rw,mode=0666)
localhost:/mountpoint1/data on /backup type nfs 
(ro,user=root,noexec,nosuid,nodev,addr=127.0.0.1)

Auf beiden Server ist base 2.0.0 und kernel 2.0.28 installiert.

Auf meinem Testsystem mit gleicher Konstellation (base 2.0.0, kernel 
2.0.28, Mountpoint von /mnt auf /mountpoint1 geändert) bekomme ich auch 
die gleicher Fehlermeldung.

Hat jemand einen Tipp, woran das liegt? Braucht Ihr weitere Info?

Gruß
Jürgen



Mehr Informationen über die Mailingliste Eisfair