1. Diese Seite verwendet Cookies. Wenn du dich weiterhin auf dieser Seite aufhältst, akzeptierst du unseren Einsatz von Cookies. Weitere Informationen

Talk Oscam Watchdog läuft nicht

Dieses Thema im Forum "Fritzbox Talk" wurde erstellt von itzibitzi, 2. Januar 2013.

  1. itzibitzi
    Offline

    itzibitzi Ist gelegentlich hier

    Registriert:
    7. Juni 2009
    Beiträge:
    38
    Zustimmungen:
    7
    Punkte für Erfolge:
    0
    Morgen zusammen,

    Auf meiner Fritzbox 7170 habe ich zur Zeit das folgende Image laufen 7170_04.87-freetz-devel-8879 und Oscam 1.10rc-svn-SB-Trunk-by-Giftstaub Rev. 5983

    Da mein Oscam ab und zu schonmal aussteigt, möchte ich dieses mit watchdog überwachen, jedoch funktioniert dieser nicht.
    Ich nehme an das ein (oder mehrere) Fehler in dem script steckt.

    watchdog_cam_init-error
    #!/bin/sh
    # ZebraDem.com Watchdog
    # Developed by DaMulda

    . /mod/etc/conf/watchdog.cfg


    USTOR_PATH=''
    USTOR_PATHS=`mount | grep 'uStor' | cut -d ' ' -f3 | cut -d ' ' -f1`

    for i in 1 2; do
    for USTOR in $USTOR_PATHS; do
    if [ -n "$(ls "$USTOR")" ]; then
    USTOR_PATH=$USTOR
    break
    fi
    done

    if [ $i -eq 1 ]; then
    if [ -z $USTOR_PATH ]; then sleep 20; else break; fi
    else
    if [ -z $USTOR_PATH ]; then USTOR_PATH="/var/media/ftp/uStor01"; fi
    break
    fi
    done

    WORKING_DIR=${WATCHDOG_FILES_PATH/%uStor%/$USTOR_PATH}


    for i in $*; do
    if [ -e /etc/init.d/rc.$i ]; then
    case $i in


    oscam)
    OSCAM_LOG_FILE=${WATCHDOG_CAM_OSCAM_LOG_FILE/%uStor%/$USTOR_PATH}

    if [ -n "$(grep "card initializing error" $OSCAM_LOG_FILE)" ]; then
    ERROR_CAM=$i
    LOG_FILE=$OSCAM_LOG_FILE
    break
    fi
    if [ -n "$(grep "ERROR" $OSCAM_LOG_FILE)" ]; then
    ERROR_CAM=$i
    LOG_FILE=$OSCAM_LOG_FILE
    break
    fi
    if [ -n "$(grep "ejected" $OSCAM_LOG_FILE)" ]; then
    ERROR_CAM=$i
    LOG_FILE=$OSCAM_LOG_FILE
    break
    fi
    fi
    ;;


    esac
    fi
    done

    if [ -n $ERROR_CAM -a $ERROR_CAM != "" ]; then
    /etc/init.d/rc.$ERROR_CAM stop

    echo "$(date) => $ERROR_CAM - card initializing error" >> $WORKING_DIR/watchdog.log

    rm -rf $LOG_FILE

    if [ "$WATCHDOG_SEND_CARDINIT" = "yes" ]; then
    if [ "$WATCHDOG_DO_CARDINIT" = "r" ]; then RESTART_OF="router"; else RESTART_OF="$ERROR_CAM"; fi

    mailer \
    -s "Watchdog - $RESTART_OF restart - $ERROR_CAM card initializing error" \
    -f $WATCHDOG_MAIL_FROM \
    -t $WATCHDOG_MAIL_TO \
    -m $WATCHDOG_MAIL_SERVER \
    -a $WATCHDOG_MAIL_USER \
    -w $WATCHDOG_MAIL_PASSWORD

    echo "$(date) => transmitted mail to $WATCHDOG_MAIL_TO" >> $WORKING_DIR/watchdog.log
    fi

    if [ "$WATCHDOG_DO_CARDINIT" = "r" ]; then /sbin/reboot; else /etc/init.d/rc.$ERROR_CAM start; fi
    fi

    exit 0


    watchdog_cam_init-error
    #!/bin/sh
    # ZebraDem.com Watchdog
    # Developed by DaMulda

    . /mod/etc/conf/watchdog.cfg


    USTOR_PATH=''
    USTOR_PATHS=`mount | grep 'uStor' | cut -d ' ' -f3 | cut -d ' ' -f1`

    for i in 1 2; do
    for USTOR in $USTOR_PATHS; do
    if [ -n "$(ls "$USTOR")" ]; then
    USTOR_PATH=$USTOR
    break
    fi
    done

    if [ $i -eq 1 ]; then
    if [ -z $USTOR_PATH ]; then sleep 20; else break; fi
    else
    if [ -z $USTOR_PATH ]; then USTOR_PATH="/var/media/ftp/uStor01"; fi
    break
    fi
    done

    WORKING_DIR=${WATCHDOG_FILES_PATH/%uStor%/$USTOR_PATH}


    for i in $*; do
    if [ -e /etc/init.d/rc.$i ]; then
    if [ "$(/etc/init.d/rc.$i status)" = 'stopped' ]; then
    ERROR_CAM=$i
    break
    fi
    fi
    done

    if [ -n $ERROR_CAM -a $ERROR_CAM != "" ]; then
    if [ "$WATCHDOG_DO_CAMRUN" != "r" ]; then /etc/init.d/rc.$ERROR_CAM restart; fi

    echo "$(date) => $ERROR_CAM was down" >> $WORKING_DIR/watchdog.log

    if [ "$WATCHDOG_SEND_CAMRUN" = "yes" ]; then
    if [ "$WATCHDOG_DO_CAMRUN" = "r" ]; then RESTART_OF="$ERROR_CAM"; else RESTART_OF="router"; fi

    mailer \
    -s "Watchdog - $RESTART_OF restart - $ERROR_CAM was down" \
    -f $WATCHDOG_MAIL_FROM \
    -t $WATCHDOG_MAIL_TO \
    -m $WATCHDOG_MAIL_SERVER \
    -a $WATCHDOG_MAIL_USER \
    -w $WATCHDOG_MAIL_PASSWORD

    echo "$(date) => transmitted mail to $WATCHDOG_MAIL_TO" >> $WORKING_DIR/watchdog.log
    fi

    if [ "$WATCHDOG_DO_CAMRUN" = "r" ]; then /sbin/reboot; fi
    fi

    exit 0


    watchdog_sys-dsld
    #!/bin/sh
    # ZebraDem.com Watchdog
    # Developed by DaMulda

    . /mod/etc/conf/watchdog.cfg


    USTOR_PATH=''
    USTOR_PATHS=`mount | grep 'uStor' | cut -d ' ' -f3 | cut -d ' ' -f1`

    for i in 1 2; do
    for USTOR in $USTOR_PATHS; do
    if [ -n "$(ls "$USTOR")" ]; then
    USTOR_PATH=$USTOR
    break
    fi
    done

    if [ $i -eq 1 ]; then
    if [ -z $USTOR_PATH ]; then sleep 20; else break; fi
    else
    if [ -z $USTOR_PATH ]; then USTOR_PATH="/var/media/ftp/uStor01"; fi
    break
    fi
    done

    WORKING_DIR=${WATCHDOG_FILES_PATH/%uStor%/$USTOR_PATH}


    if [ "$(ping -c4 "google.de" | grep -c "seq")" -eq 4 ]; then
    if [ "$WATCHDOG_DYNDNS_INTERNAL" = "yes" ]; then
    CURRENT_INTERNAL_DYNDNS="$(sed 's/.*[ \t]//g' /var/tmp/ddnsstat.txt 2>/dev/null)"
    if [ "$(ping -c4 $CURRENT_INTERNAL_DYNDNS | grep -c "seq")" -ne 4 ]; then RESTART_DSLD='y'; fi
    else
    if [ "$(ping -c4 $WATCHDOG_DYNDNS | grep -c "seq")" -ne 4 ]; then RESTART_DSLD='y'; fi
    fi

    if [ -n $RESTART_DSLD -a $RESTART_DSLD != "" ]; then
    echo "$(date) => $ERROR_CAM dsld restart" >> $WORKING_DIR/watchdog.log

    if [ "$WATCHDOG_SEND_DYNDNS" = "yes" ]; then
    mailer \
    -s "Watchdog - DSL restart - dynamic DNS problems" \
    -f $WATCHDOG_MAIL_FROM \
    -t $WATCHDOG_MAIL_TO \
    -m $WATCHDOG_MAIL_SERVER \
    -a $WATCHDOG_MAIL_USER \
    -w $WATCHDOG_MAIL_PASSWORD

    echo "$(date) => transmitted mail to $WATCHDOG_MAIL_TO" >> $WORKING_DIR/watchdog.log
    fi

    killall dsld
    dsld -i -n
    fi
    fi

    exit 0


    watchdog_sys_reboot
    #!/bin/sh
    # ZebraDem.com Watchdog
    # Developed by DaMulda

    . /mod/etc/conf/watchdog.cfg


    USTOR_PATH=''
    USTOR_PATHS=`mount | grep 'uStor' | cut -d ' ' -f3 | cut -d ' ' -f1`

    for i in 1 2; do
    for USTOR in $USTOR_PATHS; do
    if [ -n "$(ls "$USTOR")" ]; then
    USTOR_PATH=$USTOR
    break
    fi
    done

    if [ $i -eq 1 ]; then
    if [ -z $USTOR_PATH ]; then sleep 20; else break; fi
    else
    if [ -z $USTOR_PATH ]; then USTOR_PATH="/var/media/ftp/uStor01"; fi
    break
    fi
    done

    WORKING_DIR=${WATCHDOG_FILES_PATH/%uStor%/$USTOR_PATH}


    echo "$(date) => router reboot" >> $WORKING_DIR/watchdog.log

    if [ "$WATCHDOG_SEND_REBOOT" = "yes" ]; then
    mailer \
    -s "Watchdog - router restart" \
    -f $WATCHDOG_MAIL_FROM \
    -t $WATCHDOG_MAIL_TO \
    -m $WATCHDOG_MAIL_SERVER \
    -a $WATCHDOG_MAIL_USER \
    -w $WATCHDOG_MAIL_PASSWORD

    echo "$(date) => transmitted mail to $WATCHDOG_MAIL_TO" >> $WORKING_DIR/watchdog.log
    fi

    exit 0



    In meinem Freetz ist der watchdog folgendermaßen konfiguriert.

    Den Anhang 67182 betrachten



    Kann mir von Euch jemand weiterhelfen, oder mir ein laufendes watchdogscript zur verfügung stellen?
     
    #1

Diese Seite empfehlen