Changeset 459 for trunk/web/addons/job_monarch/libtoga.php
- Timestamp:
- 02/06/08 09:23:34 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/addons/job_monarch/libtoga.php
r454 r459 605 605 606 606 function TorqueXMLHandler( $clustername ) { 607 $jobs 608 $clusters = array();609 $this->nodes = array();610 $heartbeat = array();611 $this->clustername 612 //printf(" cluster set to %s \n", $this->clustername );607 $jobs = array(); 608 $clusters = array(); 609 $this->nodes = array(); 610 $heartbeat = array(); 611 $this->clustername = $clustername; 612 $this->fqdn = 1; 613 613 } 614 614 … … 668 668 669 669 $hostname = $attrs[NAME]; 670 671 670 672 $location = $attrs[LOCATION]; 671 673 //printf( "Found node %s\n", $hostname ); … … 685 687 sscanf( $attrs[NAME], 'MONARCH-JOB-%d-%d', $jobid, $monincr ); 686 688 687 //printf( "jobid %s\n", $jobid );688 689 689 if( !isset( $jobs[$jobid] ) ) 690 690 $jobs[$jobid] = array(); … … 697 697 $toganame = $togavalues[0]; 698 698 $togavalue = $togavalues[1]; 699 700 //printf( "\t%s\t= %s\n", $toganame, $togavalue );701 699 702 700 if( $toganame == 'nodes' ) { … … 735 733 if( $jobs[$jobid][status] == 'R' ) { 736 734 735 // Let's see if Ganglia use's FQDN or short hostnames 736 // 737 foreach( $nodes as $hostname => $nimage ) { 738 739 if( substr( $hostname, $domain_len ) != $domain ) 740 { 741 $this->fqdn = 0; 742 } 743 } 744 737 745 foreach( $jobs[$jobid][nodes] as $node ) { 738 746 … … 740 748 $domain_len = 0 - strlen( $domain ); 741 749 742 if( substr( $node, $domain_len ) != $domain ) { 743 $host = $node. '.'.$domain; 744 } else { 745 $host = $node; 750 if( $this->fqdn ) 751 { 752 if( substr( $node, $domain_len ) != $domain ) { 753 $host = $node. '.'.$domain; 754 } else { 755 $host = $node; 756 } 757 } 758 else 759 { 760 $host = $node; 746 761 } 747 762
Note: See TracChangeset
for help on using the changeset viewer.