Ignore:
Timestamp:
Jan 13, 2017, 1:30:29 PM (7 years ago)
Author:
gegorbet
Message:

merge us3iab/airavata gridctl code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cluster_status.php

    r23 r25  
    44include "$us3bin/listen-config.php";
    55
    6 $xml  = get_data();
    7 
    8 if ( $xml != "" )
    9    parse( $xml );
     6if ( ! preg_match( "/localhost/", $dbhost ) )
     7{
     8   $xml  = get_data();
     9
     10   if ( $xml != "" )
     11      parse( $xml );
     12}
    1013
    1114$data = array();
     
    165168   global $self;
    166169   global $data;
    167 
    168    $clusters = array( "alamo", "lonestar5", "stampede",
    169                       "comet", "gordon", "jureca", "jacinto" );
    170 //   $clusters = array( "alamo", "lonestar5", "stampede",
    171 //                      "comet", "gordon", "jureca"            );
     170   global $dbhost;
     171   global $org_domain;
     172
     173   if ( preg_match( "/localhost/", $dbhost ) )
     174   {
     175      if ( preg_match( "/attlocal/", $org_domain ) )
     176         $clusters = array( "us3iab-devel" );
     177      else
     178         $clusters = array( "us3iab-node0" );
     179   }
     180   else
     181   {
     182      $clusters = array( "alamo", "lonestar5", "stampede", "comet",
     183                         "gordon", "jureca", "jacinto" );
     184   }
     185
    172186   foreach ( $clusters as $clname )
    173187   {
    174188      $a      = Array();
     189//echo "$self:   clname=$clname\n";
     190
    175191      switch( $clname )
    176192      {
    177          case 'alamo':
    178          {
    179             $host   = "us3@alamo.uthscsa.edu";
    180             $qstat  = `ssh $host '/usr/bin/qstat -B 2>&1|tail -1'`;
     193         case 'us3iab-node0':
     194         case 'us3iab-node1':
     195         case 'us3iab-devel':
     196         {
     197            $qstat  = `/usr/bin/qstat -B 2>&1|tail -1`;
     198
    181199            $sparts = preg_split( '/\s+/', $qstat );
    182200            $que    = $sparts[ 3 ];
     
    189207            break;
    190208         }
     209         case 'alamo':
     210         {
     211            $host   = "us3@alamo.uthscsa.edu";
     212            $qstat  = `ssh $host '/usr/bin/qstat -B 2>&1|tail -1'`;
     213            $sparts = preg_split( '/\s+/', $qstat );
     214            $que    = $sparts[ 3 ];
     215            $run    = $sparts[ 4 ];
     216            $sta    = $sparts[ 10 ];
     217            if ( $sta == "Active" )
     218               $sta    = "up";
     219            else
     220               $sta    = "down";
     221            break;
     222         }
    191223         case 'jacinto':
    192224         {
     
    289321      $a[ 'running' ] = $run;
    290322      $a[ 'status'  ] = $sta;
     323//echo "$self:  $clname  $que $run $sta\n";
    291324
    292325      $data[] = $a;
Note: See TracChangeset for help on using the changeset viewer.