Index: /trunk/web/addons/job_monarch/libtoga.php
===================================================================
--- /trunk/web/addons/job_monarch/libtoga.php	(revision 462)
+++ /trunk/web/addons/job_monarch/libtoga.php	(revision 463)
@@ -564,4 +564,9 @@
 	}
 
+	function getUsingFQDN() {
+		$handler = $this->xmlhandler;
+		return $handler->getUsingFQDN();
+	}
+
 	function getNodes() {
 		$handler = $this->xmlhandler;
@@ -611,4 +616,9 @@
 		$this->clustername	= $clustername;
 		$this->fqdn		= 1;
+	}
+
+	function getUsingFQDN() {
+
+		return $this->fqdn;
 	}
 
@@ -1263,5 +1273,4 @@
 				$skan_str	= str_replace( "{x}", "%d", $skan_str );
 				$skan_str	= str_replace( "{y}", "%d", $skan_str );
-				//printf("ppoep = %s\n", $skan_str);
 			} 
 			else if( $x_present)
@@ -1286,5 +1295,4 @@
 				if( $x_present && $y_present )
 				{
-					//$n	= sscanf( $hostname, $skan_str, $i, $j );
 					if( $x_first )
 					{
@@ -1295,9 +1303,11 @@
 						$n = sscanf( $hostname, $skan_str, $y, $x );
 					}
+
 					// Remove nodes that don't match
 					//
 					if( $n < 2 )
 					{
-						//printf( "removing node %s - x present & y present + <2 x,y matches\n", $hostname );
+						// This node hostname has no match for: {x} and {y}
+						//
 						unset( $nodes[$hostname] );
 					}
@@ -1306,9 +1316,11 @@
 				{
 					$n = sscanf( $hostname, $skan_str, $x );
+
 					// Remove nodes that don't match
 					//
 					if( $n < 1 )
 					{
-						//printf( "removing node %s - x present & !y present + <1 x match\n", $hostname );
+						// This node hostname has no match for: {x}
+						//
 						unset( $nodes[$hostname] );
 					}
@@ -1318,20 +1330,18 @@
 				{
 					$n = sscanf( $hostname, $skan_str, $y );
+
 					// Remove nodes that don't match
 					//
 					if( $n < 1 )
 					{
-						//printf( "removing node %s - y present & !x present + <1 y match\n", $hostname );
+						// This node hostname has no match for: {y}
+						//
 						unset( $nodes[$hostname] );
 					}
 					$x	= 1;
 				}
-				//printf( "xfirst %s yfirst %s\n", $x_first, $y_first );
-
-				//printf( "n %s\n", $n );
-
-
-				//printf( "node %s x_min %s x %s\n", $hostname, $x_min, $x );
-
+
+				// Determine the lowest value of {x} that exists in all node hostnames
+				//
 				if( !$x_min && $x != null )
 				{
@@ -1342,4 +1352,7 @@
 					$x_min	= $x;
 				}
+
+				// Determine the highest value of {x} that exists in all node hostnames
+				//
 				if( !$x_max && $x != null )
 				{
@@ -1350,4 +1363,7 @@
 					$x_max	= $x;
 				}
+
+				// Determine the lowest value of {y} that exists in all node hostnames
+				//
 				if( !$y_min && $y != null )
 				{
@@ -1358,4 +1374,7 @@
 					$y_min	= $y;
 				}
+
+				// Determine the highest value of {y} that exists in all node hostnames
+				//
 				if( !$y_max && $y != null )
 				{
@@ -1368,8 +1387,8 @@
 			}
 
-			//printf( "ss %s\n", $skan_str);
+			// Sort all the nodes (alpha and numerically)
+			// 1: gb-r1n1, 2: gb-r1n2, 3: gb-r2n1, etc
+			//
 			$sorted_nodes	= usort( $nodes, "cmp" );
-
-			//print_r( $nodes );
 
 			$cur_node	= 0;
@@ -1427,4 +1446,6 @@
 			if( $this->isSmall() ) {
 
+				// Draw a fancy little header text to explain what it is
+				//
 				$colorblue	= imageColorAllocate( $image, 0, 0, 255 );
 
@@ -1438,4 +1459,6 @@
 				if( isset( $SORT_XLABEL ) )
 				{
+					// Print the {x} label: rack
+					//
 					imageString( $image, $font, $x_offset, $fontspaceing, $SORT_XLABEL, $colorblue );
 				}
@@ -1443,10 +1466,12 @@
 				if( isset( $SORT_YLABEL ) )
 				{
-					// Stupid php without imageStringDown function
+					// Stupid php without imageStringDown function... we'll make one ourself
+					//
+
+					// Print the {y} label: node
 					//
 					imageStringDown( $image, $font, $fontspaceing, $y_offset, $SORT_YLABEL, $colorblue );
 				}
 			}
-			//print_r( $nodes );
 
 			for( $n = $x_min; $n <= $x_max; $n++ )
@@ -1454,4 +1479,5 @@
 				for( $m = $y_min; $m <= $y_max; $m++ )
 				{
+
 					if( $x_min > 0 )
 					{
@@ -1461,4 +1487,32 @@
 					{
 						$y	= $y_offset + ( ($m-$y_min) * $node_width );
+					}
+
+					if( $this->isBig() ) 
+					{
+						// Draw y(node) column number header
+						//
+						if(( $n == $x_min ) && ( isset($SORT_YLABEL) ) )
+						{
+							$mfontspacing	= 1;
+
+							$ylabel_x	= $x - ( $fontwidth * strlen( $y_max ) ) - $mfontspacing;
+							$ylabel_y	= $y;
+
+							imageString( $image, $font, $ylabel_x, $ylabel_y, strval( $m ), $colorblue );
+
+							$xmin_hit[$n]	= true;
+						}
+
+						// Draw x(rack) column number header
+						//
+						if(( $m == $y_min ) && ( isset($SORT_XLABEL) ) )
+						{
+							$mfontspacing	= 2;
+							$xlabel_y	= $y - ( $fontheight * strlen( $x_max ) );
+							$xlabel_x	= $x + $mfontspacing; 
+
+							imageStringDown( $image, $font, $xlabel_x, $xlabel_y, strval( $n ), $colorblue );
+						}
 					}
 
@@ -1484,11 +1538,14 @@
 							if( intval( $rx ) > $n )
 							{
-								$m	= $y_max + 1;
-								//printf( "skipping node %s - y present & x present + rx %s > n %s\n", $rx, $n);
+								// If x(rack) is higher than current x, skip to next x(rack)
+								//
+								$m		= $y_max + 1;
+
 								continue;
 							}
 							if( intval( $ry ) > $m )
 							{
-								//printf( "skipping node %s - y present & x present + ry %s > m %s\n", $ry, $m);
+								// If y(node) is higher than current y, skip to next y(node)
+								//
 								continue;
 							}
@@ -1505,5 +1562,6 @@
 						if( !in_array( $host, $filtered_nodes ) )
 						{
-							//printf( "setting node %s showinfo to 0 - not found in filtered_nodes", $host);
+							// This node has been filtered out: we only want to see certain nodes
+							//
 							$nodes[$cur_node]->setShowinfo( 0 );
 						}
@@ -1521,24 +1579,4 @@
 						$cur_node++;
 					}
-					if( $this->isBig() ) 
-					{
-						if(( $n == $x_min ) && ( isset($SORT_YLABEL) ) )
-						{
-							$mfontspacing	= 1;
-							$ylabel_x	= $x - ( $fontwidth * strlen( $y_max ) ) - $mfontspacing;
-							$ylabel_y	= $y;
-
-							imageString( $image, $font, $ylabel_x, $ylabel_y, strval( $m ), $colorblue );
-						}
-						if(( $m == $y_min ) && ( isset($SORT_XLABEL) ) )
-						{
-							$mfontspacing	= 2;
-							$xlabel_y	= $y - ( $fontheight * strlen( $x_max ) );
-							$xlabel_x	= $x + $mfontspacing; 
-
-							imageStringDown( $image, $font, $xlabel_x, $xlabel_y, strval( $n ), $colorblue );
-						}
-					}
-
 				}
 			}
Index: /trunk/web/addons/job_monarch/overview.php
===================================================================
--- /trunk/web/addons/job_monarch/overview.php	(revision 462)
+++ /trunk/web/addons/job_monarch/overview.php	(revision 463)
@@ -44,4 +44,5 @@
 $gnodes		= $data_gatherer->getNodes();
 $cpus		= $data_gatherer->getCpus();
+$use_fqdn	= $data_gatherer->getUsingFQDN();
 
 function setupFilterSettings() 
@@ -507,5 +508,5 @@
 	global $start, $end, $reports, $gnodes, $default_showhosts;
 	global $COLUMN_QUEUED, $COLUMN_REQUESTED_MEMORY, $COLUMN_NODES, $hostname;
-	global $cluster;
+	global $cluster, $use_fqdn;
 
 	$metricname		= $m;
@@ -552,4 +553,6 @@
 	$view_name_nodes 	= array();
 
+	// Is the "requested memory" column enabled in the config
+	//
 	if( $COLUMN_REQUESTED_MEMORY ) 
 	{
@@ -557,4 +560,6 @@
 	}
 
+	// Is the "nodes hostnames" column enabled in the config
+	//
 	if( $COLUMN_NODES ) 
 	{
@@ -562,4 +567,6 @@
 	}
 
+	// Is the "queued time" column enabled in the config
+	//
 	if( $COLUMN_QUEUED ) 
 	{
@@ -582,4 +589,6 @@
 	}
 
+	// Running / queued amount jobs graph
+	//
 	if( $rjqj_host != null )
 	{
@@ -641,8 +650,11 @@
 						$hostnode 	= $tempnode;
 
-						//if( substr( $hostnode, $domain_len ) != $jobs[$jobid][domain] ) 
-						//{
-						//	$hostnode = $hostnode. '.'. $jobs[$jobid][domain];
-						//}
+						if( $use_fqdn == 1)
+						{
+							if( substr( $hostnode, $domain_len ) != $jobs[$jobid][domain] ) 
+							{
+								$hostnode = $hostnode. '.'. $jobs[$jobid][domain];
+							}
+						}
 
 						if( $hostname == $hostnode ) 
@@ -804,5 +816,8 @@
 						foreach( $jobs[$jobid][nodes] as $mynode ) 
 						{
-							//$myhost_href 	= "./?c=".$clustername."&h=".$mynode.".".$jobs[$jobid][domain];
+							if( $use_fqdn == 1)
+							{
+								$mynode	= $mynode.".".$jobs[$jobid][domain];
+							}
 							$myhost_href 	= "./?c=".$clustername."&h=".$mynode;
 							$mynodehosts[] 	= "<A HREF=\"".$myhost_href."\">".$mynode."</A>";
@@ -978,10 +993,13 @@
 			foreach ( $hosts_up as $host ) 
 			{
-				//$domain_len 		= 0 - strlen( $domain );
-
-				//if( substr( $host, $domain_len ) != $domain ) 
-				//{
-				//	$host 		= $host . '.' . $domain;
-				//}
+				$domain_len 		= 0 - strlen( $domain );
+
+				if( $use_fqdn )
+				{
+					if( substr( $host, $domain_len ) != $domain ) 
+					{
+						$host 		= $host . '.' . $domain;
+					}
+				}
 
 				$cpus 			= $metrics[$host]["cpu_num"]["VAL"];
@@ -1007,4 +1025,5 @@
 				}
 			}
+
 			switch ( $sort ) 
 			{
Index: /trunk/web/addons/job_monarch/version.php
===================================================================
--- /trunk/web/addons/job_monarch/version.php	(revision 462)
+++ /trunk/web/addons/job_monarch/version.php	(revision 463)
@@ -22,4 +22,4 @@
  */
 
-$monarchversion = "0.2.1";
+$monarchversion = "0.3SVN";
 ?>
