Ignore:
Timestamp:
Aug 7, 2014 10:08:56 AM (10 years ago)
Author:
maronga
Message:

removed blanks from <> strings in .mrun.config files / adapted hlrn_watchdog for HLRN-III

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/hlrn_watchdog

    r1310 r1446  
    11#!/bin/ksh
    2 
    32#--------------------------------------------------------------------------------#
    43# This file is part of PALM.
     
    2019# Current revisions:
    2120# -----------------
    22 #
     21# Adapted for HLRN III. Added windows if no runs are queued.
     22#
    2323# Former revisions:
    2424# -----------------
     
    4141#------------------------------------------------------------------------------!
    4242
     43    check_hannover=false
     44    check_berlin=true
     45    debug=true
     46    PALM_BIN="/home/maronga/palm/tmp_version/trunk/SCRIPTS"
     47
    4348    cd $PALM_BIN
    4449
    45     gate_h="hicegate.hlrn.de"
    46     gate_b="bicegate.hlrn.de"
     50    gate_h="hlogin.hlrn.de"
     51    gate_b="blogin.hlrn.de"
    4752    update_frequency=600
    4853
    4954#   trap strg+c
    50     trap 'killall kdialog; exit' 2
     55    trap 'kill -9 $infoPID > /dev/null; kill -9 $dialogPID > /dev/null; exit' 2
    5156
    5257
     
    6166          kill -9 $killid > /dev/null
    6267          killall kdialog
     68
     69          if [[ -f .watchdog_report.x ]] then
     70             rm .watchdog_report.x
     71          fi
     72          if [[ -f .watchdog_status.x ]] then
     73             rm .watchdog_status.x
     74          fi
    6375          echo "*** hlrn_watchdog stopped."
    6476       else
     
    7385           echo "+++ hlrn_watchdog is already running."
    7486        else
    75            nohup ./hlrn_watchdog $2 1> /dev/null 2> /dev/null &
     87           if [[ $debug = true ]] then
     88              ./hlrn_watchdog $2 &
     89           else
     90              nohup ./hlrn_watchdog $2 1> /dev/null 2> /dev/null &
     91           fi
    7692           echo "\n*** hlrn_watchdog starting..."
    7793        fi
    7894        exit
    7995    else
    80 
    8196#      login via ssh and collect information in .watchdog_report.x
    8297       while true
    8398       do
    84           ssh  $gate_h -l $1 "showq | egrep \"($1)\"" > .watchdog_report.x
     99          touch .watchdog_report.x
     100          if [[ $check_hannover == true ]] then
     101             ssh  $gate_h -l $1 "showq | egrep \"($1)\"" > .watchdog_report.x
     102          fi
     103          if [[ $check_berlin == true ]] then
    85104          ssh  $gate_b -l $1 "showq | egrep \"($1)\"" >> .watchdog_report.x
     105          fi
    86106
    87107          i=0
     
    104124          done
    105125          rm .watchdog_report.x
     126          touch .watchdog_status.x
    106127
    107128#         check for terminated jobs and status changes
     
    138159          done
    139160
     161#         check whether any jobs are queued
     162          touch .watchdog_report.x
     163          file_size=`ls -l .watchdog_report.x | tr -s " " | cut -d " " -f 5`
     164          if [[ $file_size == 0 ]] then
     165            printf "No jobs queued.\n" >> .watchdog_report.x
     166          fi
     167
    140168#         get estimated starting time for all idle jobs and write watchdog output in .watchdog_report.x
    141169          while (( $j < $i ))
     
    162190
    163191#         kill all windows
    164           killall kdialog
     192          if  [[ "$infoPID" -ne "" ]] then
     193             kill -9 $infoPID > /dev/null
     194             unset $infoPID
     195          fi
     196          if  [[ "$dialogPID" -ne "" ]] then
     197             kill -9 $dialogPID > /dev/null
     198             unset $dialogPID
     199          fi
    165200
    166201          timestamp=`date`
    167202
    168203#         create window and show information
    169           kdialog --textbox .watchdog_report.x 550 150 --title "HLRN watchdog  (last update: $timestamp)" &
     204          kdialog --textbox .watchdog_report.x 550 150 --title "HLRN watchdog  (last update: $timestamp)" & dialogPID=$!
    170205
    171206#         in case of status changes and terminated jobs, inform the user
    172207          if [[ $info != "" ]]
    173208          then
    174              kdialog --msgbox "$info" --title "HLRN Job Information" &
     209             kdialog --msgbox "$info" --title "HLRN Job Information" & infoPID=$!
    175210          fi
    176211
Note: See TracChangeset for help on using the changeset viewer.