Changeset 562
- Timestamp:
- 01/22/09 10:54:22 (15 years ago)
- Location:
- trunk/web2/addons/job_monarch
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web2/addons/job_monarch/jobstore.php
r553 r562 251 251 foreach( $jobattrs[nodes] as $mynode ) 252 252 { 253 if( $use_fqdn == 1)254 {255 $mynode = $mynode.".".$jobattrs[domain];256 }253 //if( $use_fqdn == 1) 254 //{ 255 // $mynode = $mynode.".".$jobattrs[domain]; 256 //} 257 257 $mynodehosts[] = $mynode; 258 258 } -
trunk/web2/addons/job_monarch/js/jobgrid.js
r561 r562 507 507 } 508 508 win.show( this ); 509 alert( CheckJobs.getSelections() ); 509 510 } 510 511 } -
trunk/web2/addons/job_monarch/libtoga.php
r549 r562 591 591 $offline_nodes = array(); 592 592 $this->clustername = $clustername; 593 $this->fqdn = 1; 593 $this->fqdn = 0; 594 $this->fqdnFound = 0; 594 595 } 595 596 … … 634 635 $nodes = &$this->nodes; 635 636 636 $fqdn = 1; 637 638 //$tdomain = explode( '.', $thostname ); 639 // 640 // TODO?: extract domain from hostname or something? 641 642 if( $tdomain ) 643 { 644 $domain_len = 0 - strlen( $tdomain ); 645 646 // Let's see if Ganglia use's FQDN or short hostnames 647 // 648 foreach( $nodes as $hostname => $nimage ) 649 { 650 if( substr( $hostname, $domain_len ) != $tdomain ) 651 { 652 $fqdn = 0; 653 } 654 } 655 } 656 else 657 { 658 $fqdn = 0; 659 } 637 $domain_len = 0 - strlen( $tdomain ); 660 638 661 if( $tdomain && $ fqdn )639 if( $tdomain && $this->fqdn ) 662 640 { 663 641 if( substr( $thostname, $domain_len ) != $tdomain ) … … 665 643 $thostname = $thostname . '.'.$tdomain; 666 644 } 667 else668 {669 $thostname = $thostname;670 }671 645 } 672 646 … … 697 671 { 698 672 $hostname = $attrs[NAME]; 673 674 // Assume to use FQDN if we find a '.' in the hostname 675 // 676 if( strpos( $hostname, '.' ) !== false ) 677 { 678 if( !$this->fqdnFound ) 679 { 680 $this->fqdn = 1; 681 $this->fqdnFound = 1; 682 } 683 } 684 else 685 { 686 if( !$this->fqdnFound ) 687 { 688 $this->fqdn = 0; 689 $this->fqdnFound = 1; 690 } 691 } 699 692 700 693 $location = $attrs[LOCATION]; … … 746 739 } 747 740 } 741 $down_nodes = $nodes_down; 742 743 foreach( $down_nodes as $node ) 744 { 745 $nodes_down[] = $this->makeHostname( $node, $down_domain ); 746 } 748 747 } 749 748 else if( strstr( $attrs[NAME], 'MONARCH-OFFLINE' ) ) … … 782 781 } 783 782 } 783 $offline_nodes = $nodes_offline; 784 785 foreach( $offline_nodes as $node ) 786 { 787 $nodes_offline[] = $this->makeHostname( $node, $offline_domain ); 788 } 784 789 } 785 790 else if( strstr( $attrs[NAME], 'MONARCH-JOB' ) ) … … 838 843 if( $jobs[$jobid][status] == 'R' ) 839 844 { 840 841 845 if( isset( $jobs[$jobid][domain] ) ) 842 846 { 843 847 $domain = $jobs[$jobid][domain]; 844 $domain_len = 0 - strlen( $domain );845 846 // Let's see if Ganglia use's FQDN or short hostnames847 //848 foreach( $nodes as $hostname => $nimage )849 {850 851 if( substr( $hostname, $domain_len ) != $domain )852 {853 $this->fqdn = 0;854 }855 }856 848 } 857 else 858 { 859 $this->fqdn = 0; 860 } 849 $job_nodes = array(); 861 850 862 851 foreach( $jobs[$jobid][nodes] as $node ) 863 852 { 864 865 853 // Only add domain name to the hostname if Ganglia is doing that too 866 854 // 867 if( $this->fqdn && isset( $jobs[$jobid][domain] ) ) 868 { 869 if( substr( $node, $domain_len ) != $domain ) 870 { 871 $host = $node. '.'.$domain; 872 } else 873 { 874 $host = $node; 875 } 876 } 877 else 878 { 879 $host = $node; 880 } 855 $host = $this->makeHostname( $node, $domain ); 881 856 882 857 if( !isset( $nodes[$host] ) ) … … 901 876 } 902 877 903 $nodes[$host] = $my_node; 878 $nodes[$host] = $my_node; 879 $job_nodes[] = $host; 904 880 } 881 $jobs[$jobid][nodes] = $job_nodes; 905 882 } 906 883 } … … 1371 1348 if( $filtername != 'jobid' && $filtername != 'host' ) 1372 1349 { 1373 if( $jobs[$myjob][$filtername] != $filtervalue ) 1350 //if( $filtername == 'owner' ) 1351 //{ 1352 // printf( "%s ?= %s\n", $jobs[$myjob][$filtername], $filtervalue ); 1353 //} 1354 if( $jobs[$myjob][$filtername] == $filtervalue ) 1355 { 1356 $addhost = 1; 1357 continue; 1358 } 1359 else if( $jobs[$myjob][$filtername] != $filtervalue ) 1374 1360 { 1375 1361 $addhost = 0; 1362 // printf( "vergeet host\n" ); 1376 1363 } 1377 1364 }
Note: See TracChangeset
for help on using the changeset viewer.