Index: palm/trunk/SCRIPTS/palm_wd
===================================================================
--- palm/trunk/SCRIPTS/palm_wd	(revision 1614)
+++ palm/trunk/SCRIPTS/palm_wd	(revision 1618)
@@ -20,5 +20,6 @@
 # Current revisions:
 # -----------------
-# 
+# Added steering via configuration file .wd.config, to be place in the local
+# palm directory. Watchdog save files are automatically created upon first start.
 # 
 # Former revisions:
@@ -55,22 +56,13 @@
 #------------------------------------------------------------------------------!
 
-import sys
-import subprocess as sub
+import ConfigParser
+import datetime
+import os
 from PyQt4 import QtGui, QtCore, uic
 from PyQt4.QtCore import pyqtSlot,SIGNAL,SLOT
+import shutil
+import subprocess as sub
+import sys
 import time
-import datetime
-import shutil
-import os
-
-# START OF HEADER
-# Each list must contain the login host, the username and a description
-hostname     = ["hlogin.hlrn.de", "blogin.hlrn.de"]
-username     = ["nikmaron"      , "nikmaron"      ]
-description  = ["Hannover"      , "Berlin"        ]
-
-update_frequency = 600*1000
-
-# END OF HEADER
 
 # Determine PALM directories
@@ -85,4 +77,40 @@
    raise SystemExit
 
+
+# Read configuration file
+# First check if the configuration file exists
+if ( os.path.exists(palm_dir + '/.wd.config') == False ):
+    print "Error. No configuration file .wd.config found in " + palm_dir
+    raise SystemExit     
+
+config = ConfigParser.RawConfigParser()
+config.read(palm_dir + '/.wd.config')
+
+description = []
+hostname = []
+username = []
+
+for i in range(0,len(config.sections())):
+
+    description_tmp = config.sections()[i]
+ 
+    if ( description_tmp != 'Settings' ):
+       description.append(description_tmp)
+       hostname.append(config.get(description_tmp, 'hostname'))
+       username.append(config.get(description_tmp, 'username')) 
+    else:
+       update_frequency = int(config.get(description_tmp, 'update_frequency'))*60000
+
+# Check if .wd.olddata and .wd.newdata exist. Otherwise create the files
+if ( os.path.exists(palm_dir + '/.wd.olddata') == False ):
+   print "No .wd.olddata found. Creating..."
+   file1 = open(palm_dir + '/.wd.olddata', 'a')
+   file1.close()
+   
+
+if ( os.path.exists(palm_dir + '/.wd.newdata') == False ):
+   print "No .wd.newdata found. Creating..."  
+   file1 = open(palm_dir + '/.wd.newdata', 'a')
+   file1.close()
 
 # Dummy variables for the jobname and the progressbars
Index: palm/trunk/SCRIPTS/palm_wd_files/.wd.config.default
===================================================================
--- palm/trunk/SCRIPTS/palm_wd_files/.wd.config.default	(revision 1618)
+++ palm/trunk/SCRIPTS/palm_wd_files/.wd.config.default	(revision 1618)
@@ -0,0 +1,13 @@
+#$Id$
+# Configuration file for palm_wd
+
+[<Replace_by_your_description_of_hostname_1>]
+hostname=<replace_by_the_remote_hostname>
+username=<replace_by_your_remote_username>
+
+[<Replace_by_your_description_of_hostname_1>]
+hostname=<replace_by_the_remote_hostname>
+username=<replace_by_your_remote_username>
+
+[Settings]
+update_frequency=10
Index: palm/trunk/SCRIPTS/palm_wd_files/.wd.config.hlrnIII
===================================================================
--- palm/trunk/SCRIPTS/palm_wd_files/.wd.config.hlrnIII	(revision 1618)
+++ palm/trunk/SCRIPTS/palm_wd_files/.wd.config.hlrnIII	(revision 1618)
@@ -0,0 +1,14 @@
+# $Id$
+# Configuration file for palm_wd
+# Preconfigured for HLRN-III
+
+[Hannover]
+hostname=hlogin.hlrn.de
+username=<replace_by_your_remote_username>
+
+[Berlin]
+hostname=blogin.hlrn.de
+username=<replace_by_your_remote_username>
+
+[Settings]
+update_frequency=10
Index: palm/trunk/SCRIPTS/palm_wd_files/.wdd.config.default
===================================================================
--- palm/trunk/SCRIPTS/palm_wd_files/.wdd.config.default	(revision 1618)
+++ palm/trunk/SCRIPTS/palm_wd_files/.wdd.config.default	(revision 1618)
@@ -0,0 +1,11 @@
+# $Id$
+# Configuration file for palm_wdd
+
+[Settings]
+readqueue=<replace_by_queuing_system_command>
+tmpdir=<replace_by_%tmp_user_catalog>
+canceljob=<replace_by_command_for_canceling_jobs>
+checkjob=<replace_by_command_for_showing_job_information>
+realname_grep=<replace_by_string_identifier_to_get_job_name>
+starttime=<replace_by_command_for_showing_estimated_start_time>
+starttime_grep=<replace_by_string_identifier_to_get_start_time>
Index: palm/trunk/SCRIPTS/palm_wd_files/.wdd.config.hlrnIII
===================================================================
--- palm/trunk/SCRIPTS/palm_wd_files/.wdd.config.hlrnIII	(revision 1618)
+++ palm/trunk/SCRIPTS/palm_wd_files/.wdd.config.hlrnIII	(revision 1618)
@@ -0,0 +1,12 @@
+# $Id$
+# Configuration file for palm_wdd
+# Preconfigured for HLRN-III
+
+[Settings]
+readqueue="showq | egrep"
+tmpdir="/gfs1/tmp/"
+canceljob="canceljob"
+checkjob="checkjob"
+realname_grep="AName"
+starttime="showstart"
+starttime_grep="start in"
Index: palm/trunk/SCRIPTS/palm_wdd
===================================================================
--- palm/trunk/SCRIPTS/palm_wdd	(revision 1614)
+++ palm/trunk/SCRIPTS/palm_wdd	(revision 1618)
@@ -20,5 +20,6 @@
 # Current revisions:
 # -----------------
-# 
+# Added steering via configuration file, to be placed in the home directory of the
+# remote host to be monitored.
 # 
 # Former revisions:
@@ -56,20 +57,26 @@
 #------------------------------------------------------------------------------!
 
+import ConfigParser
 import os
+from subprocess import check_output
 import sys
-from subprocess import check_output
-
-# START OF HEADER
-
-# configuration for host
-cmd_readqueue      = "showq | egrep "
-cmd_tmpdir         = "/gfs1/tmp/"
-cmd_canceljob      = "canceljob"
-cmd_checkjob       = "checkjob"
-cmd_realname_grep  = "AName"
-cmd_starttime      = "showstart"
-cmd_starttime_grep = "start in"
-
-# END OF HEADER
+
+
+# Read configuration file
+# First check if the configuration file exists
+if ( os.path.exists('.wdd.config') == False ):
+    print "Error. No configuration file .wdd.config found."
+    raise SystemExit     
+
+config = ConfigParser.RawConfigParser()
+config.read('.wdd.config')
+
+cmd_readqueue      = config.get('Settings', 'readqueue').strip('"')
+cmd_tmpdir         = config.get('Settings', 'tmpdir').strip('"')
+cmd_canceljob      = config.get('Settings', 'canceljob').strip('"')
+cmd_checkjob       = config.get('Settings', 'checkjob').strip('"')
+cmd_realname_grep  = config.get('Settings', 'realname_grep').strip('"')
+cmd_starttime      = config.get('Settings', 'starttime').strip('"')
+cmd_starttime_grep = config.get('Settings', 'starttime_grep').strip('"')
 
 
@@ -80,8 +87,6 @@
 
 
-cmd_readqueue = cmd_readqueue + data
+cmd_readqueue = cmd_readqueue + " " + data
 cmd_tmpdir    = cmd_tmpdir + data
-
-
 
 # reading queuing system
