Index: trunk/jobmond/examples/lisa_production.conf
===================================================================
--- trunk/jobmond/examples/lisa_production.conf	(revision 255)
+++ trunk/jobmond/examples/lisa_production.conf	(revision 256)
@@ -2,6 +2,7 @@
 DEBUG_LEVEL		: 0
 DAEMONIZE		: 1
-TORQUE_SERVER		: batch-ng.irc.sara.nl
-TORQUE_POLL_INTERVAL	: 10
+BATCH_API		: pbs
+BATCH_SERVER		: batch-ng.irc.sara.nl
+BATCH_POLL_INTERVAL	: 30
 GMOND_CONF		: /etc/gmond/lisa_production.conf
 DETECT_TIME_DIFFS	: 1
Index: trunk/jobmond/examples/lisa_test.conf
===================================================================
--- trunk/jobmond/examples/lisa_test.conf	(revision 255)
+++ trunk/jobmond/examples/lisa_test.conf	(revision 256)
@@ -2,6 +2,7 @@
 DEBUG_LEVEL		: 0
 DAEMONIZE		: 1
-TORQUE_SERVER		: gb-r7n15.irc.sara.nl
-TORQUE_POLL_INTERVAL	: 10
+BATCH_API		: pbs
+BATCH_SERVER		: gb-r7n15.irc.sara.nl
+BATCH_POLL_INTERVAL	: 10
 GMOND_CONF		: /etc/gmond/lisa_test.conf
 DETECT_TIME_DIFFS	: 1
Index: trunk/jobmond/jobmond.conf
===================================================================
--- trunk/jobmond/jobmond.conf	(revision 255)
+++ trunk/jobmond/jobmond.conf	(revision 256)
@@ -10,7 +10,13 @@
 DAEMONIZE		: 1
 
-# Which Torque server to monitor
+# What Batch type is the system
+# 
+# Currently supported: pbs, sge
 #
-TORQUE_SERVER		: localhost
+BATCH_API		: pbs
+
+# Which Batch server to monitor
+#
+BATCH_SERVER		: localhost
 
 # How many seconds interval for polling of jobs
@@ -19,5 +25,5 @@
 # end time of a job can be determined
 #
-TORQUE_POLL_INTERVAL	: 10
+BATCH_POLL_INTERVAL	: 10
 
 # Location of gmond.conf
@@ -37,5 +43,5 @@
 # Regexp style hostname translation
 #
-# Usefull if your Torque hostnames are not the same as your
+# Usefull if your Batch hostnames are not the same as your
 # Ganglia hostnames (different network interfaces)
 #
Index: trunk/jobmond/jobmond.py
===================================================================
--- trunk/jobmond/jobmond.py	(revision 255)
+++ trunk/jobmond/jobmond.py	(revision 256)
@@ -90,5 +90,5 @@
 	cfg.read( filename )
 
-	global DEBUG_LEVEL, DAEMONIZE, TORQUE_SERVER, TORQUE_POLL_INTERVAL, GMOND_CONF, DETECT_TIME_DIFFS, BATCH_HOST_TRANSLATE
+	global DEBUG_LEVEL, DAEMONIZE, BATCH_SERVER, BATCH_POLL_INTERVAL, GMOND_CONF, DETECT_TIME_DIFFS, BATCH_HOST_TRANSLATE, BATCH_API
 
 	DEBUG_LEVEL = cfg.getint( 'DEFAULT', 'DEBUG_LEVEL' )
@@ -96,7 +96,7 @@
 	DAEMONIZE = cfg.getboolean( 'DEFAULT', 'DAEMONIZE' )
 
-	TORQUE_SERVER = cfg.get( 'DEFAULT', 'TORQUE_SERVER' )
-
-	TORQUE_POLL_INTERVAL = cfg.getint( 'DEFAULT', 'TORQUE_POLL_INTERVAL' )
+	BATCH_SERVER = cfg.get( 'DEFAULT', 'BATCH_SERVER' )
+
+	BATCH_POLL_INTERVAL = cfg.getint( 'DEFAULT', 'BATCH_POLL_INTERVAL' )
 
 	GMOND_CONF = cfg.get( 'DEFAULT', 'GMOND_CONF' )
@@ -106,7 +106,8 @@
 	BATCH_HOST_TRANSLATE = getlist( cfg.get( 'DEFAULT', 'BATCH_HOST_TRANSLATE' ) )
 
+	BATCH_API = cfg.get( 'DEFAULT', 'BATCH_API' )
+
 	return True
 
-from PBSQuery import PBSQuery
 
 import time, os, socket, string, re
@@ -132,5 +133,5 @@
 	        # DMAX=0 means eternal life.'
 
-		self.dmax = str( int( int( TORQUE_POLL_INTERVAL ) * 2 ) )
+		self.dmax = str( int( int( BATCH_POLL_INTERVAL ) * 2 ) )
 
 		try:
@@ -209,7 +210,23 @@
 		os.system( cmd )
 
-class DataGatherer:
+class SgeDataGatherer:
+
+	"""Placeholder for Babu Sundaram's SGE implementation"""
+
+        def daemon( self ):
+
+		pass
+
+        def run( self ):
+
+		pass
+
+class PbsDataGatherer:
+
+	"""This is the DataGatherer for PBS and Torque"""
 
 	jobs = { }
+
+	global PBSQuery
 
 	def __init__( self ):
@@ -224,6 +241,6 @@
 
 		self.pq = None
-		if( TORQUE_SERVER ):
-			self.pq = PBSQuery( TORQUE_SERVER )
+		if( BATCH_SERVER ):
+			self.pq = PBSQuery( BATCH_SERVER )
 		else:
 			self.pq = PBSQuery()
@@ -373,5 +390,5 @@
 			myAttrs['nodes'] = nodeslist
 			myAttrs['domain'] = string.join( socket.getfqdn().split( '.' )[1:], '.' )
-			myAttrs['poll_interval'] = str( TORQUE_POLL_INTERVAL )
+			myAttrs['poll_interval'] = str( BATCH_POLL_INTERVAL )
 
 			if self.jobDataChanged( jobs, job_id, myAttrs ) and myAttrs['status'] in [ 'R', 'Q' ]:
@@ -534,5 +551,5 @@
 			self.jobs = self.getJobData( self.jobs )
 			self.submitJobData( self.jobs )
-			time.sleep( TORQUE_POLL_INTERVAL )	
+			time.sleep( BATCH_POLL_INTERVAL )	
 
 def printTime( ):
@@ -550,8 +567,40 @@
 	"""Application start"""
 
+	global PBSQuery
+
 	if not processArgs( sys.argv[1:] ):
 		sys.exit( 1 )
 
-	gather = DataGatherer()
+	if BATCH_API == 'pbs':
+
+		try:
+			from PBSQuery import PBSQuery
+
+		except ImportError:
+
+			debug_msg( 0, "fatal error: BATCH_API set to 'pbs' but python module 'pbs_python' is not installed" )
+			sys.exit( 1 )
+
+		gather = PbsDataGatherer()
+
+	elif BATCH_API == 'sge':
+
+		pass
+		# import Babu's code here
+		#
+		#try:
+		#	import sge_drmaa
+		#
+		#except ImportError:
+		#
+		#	debug_msg( 0, "fatal error: BATCH_API set to 'pbs' but python module 'pbs_python' is not installed' )
+		#	sys.exit( 1 )
+		#
+		#gather = SgeDataGatherer()
+
+	else:
+		debug_msg( 0, "fatal error: unknown BATCH_API '" + BATCH_API + "' is not supported" )
+		sys.exit( 1 )
+
 	if DAEMONIZE:
 		gather.daemon()
@@ -559,5 +608,5 @@
 		gather.run()
 
-# w00t someone started me
+# wh00t? someone started me! :)
 #
 if __name__ == '__main__':
