- Timestamp:
- Jun 8, 2015, 3:03:58 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cluster_status.php
r6 r11 165 165 global $data; 166 166 167 // $clusters = array( "alamo", "jacinto", "bcf" ); 168 $clusters = array( "alamo", "jacinto" ); 167 // $clusters = array( "alamo", "jacinto" ); 168 $clusters = array( "alamo", "lonestar", "stampede", "comet", "gordon", "juropa" ); 169 //$clusters = array( "alamo", "lonestar", "stampede", "comet", "gordon", "jureca" ); 169 170 // $clusters = array( "alamo" ); 170 171 foreach ( $clusters as $clname ) 171 172 { 172 173 $a = Array(); 174 /** 173 175 if ( $clname == "alamo" ) 174 176 { … … 202 204 $run = "0"; 203 205 } 206 *a*/ 207 switch( $clname ) 208 { 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 } 223 case 'stampede': 224 { 225 $host = "us3@stampede.tacc.utexas.edu"; 226 $qstat = `ssh $host '/usr/local/bin/showq 2>&1|tail -1'`; 227 $sparts = preg_split( '/\s+/', $qstat ); 228 $tot = $sparts[ 2 ]; 229 $run = $sparts[ 5 ]; 230 $que = $sparts[ 8 ]; 231 $sta = "up"; 232 if ( $tot == '' || $tot == '0' ) 233 $sta = "down"; 234 break; 235 } 236 case 'lonestar': 237 { 238 $host = "us3@lonestar.tacc.utexas.edu"; 239 $qstat = `ssh $host 'showq 2>&1|tail -1'`; 240 $sparts = preg_split( '/\s+/', $qstat ); 241 $tot = $sparts[ 2 ]; 242 $run = '0'; 243 $que = '0'; 244 $sta = "up"; 245 if ( $tot == '' || $tot == '0' ) 246 { 247 $sta = "down"; 248 } 249 else 250 { 251 $run = $sparts[ 5 ]; 252 $que = $sparts[ 8 ]; 253 } 254 break; 255 } 256 case 'comet': 257 { 258 $host = "us3@comet.sdsc.edu"; 259 $qstat = `ssh $host '/usr/bin/sinfo -s -p compute -o "%a %F" 2>&1|tail -1'`; 260 $sparts = preg_split( '/\s+/', $qstat ); 261 $sta = $sparts[ 0 ]; 262 $knts = $sparts[ 1 ]; 263 $sparts = preg_split( '/\//', $knts ); 264 $run = $sparts[ 0 ]; 265 $que = $sparts[ 1 ]; 266 break; 267 } 268 case 'gordon': 269 { 270 $host = "us3@gordon.sdsc.edu"; 271 $qstat = `ssh $host '/opt/torque/bin/qstat -B 2>&1|tail -1'`; 272 $sparts = preg_split( '/\s+/', $qstat ); 273 $que = $sparts[ 3 ]; 274 $run = $sparts[ 4 ]; 275 $sta = $sparts[ 10 ]; 276 if ( $sta == "Active" ) 277 $sta = "up"; 278 else 279 $sta = "down"; 280 break; 281 } 282 case 'juropa': 283 { 284 $host = "zdv575@juropa.fz-juelich.de"; 285 $qstat = `ssh $host '/usr/bin/qstat -B 2>&1|tail -1'`; 286 $sparts = preg_split( '/\s+/', $qstat ); 287 $que = $sparts[ 3 ]; 288 $run = $sparts[ 4 ]; 289 $sta = $sparts[ 9 ]; 290 if ( $sta == "Scheduling" ) 291 $sta = "up"; 292 else 293 $sta = "down"; 294 break; 295 } 296 case 'jureca': 297 { 298 $host = "swus1@jureca.fz-juelich.de"; 299 $qstat = `ssh $host '/usr/bin/sinfo -s -p batch -o "%a %F" 2>&1|tail -1'`; 300 $sparts = preg_split( '/\s+/', $qstat ); 301 $sta = $sparts[ 0 ]; 302 $knts = $sparts[ 1 ]; 303 $sparts = preg_split( '/\//', $knts ); 304 $run = $sparts[ 0 ]; 305 $que = $sparts[ 1 ]; 306 break; 307 } 308 } 309 310 if ( $sta == "down" ) 311 { 312 $que = "0"; 313 $run = "0"; 314 } 204 315 205 316 $a[ 'cluster' ] = $clname; … … 209 320 210 321 $data[] = $a; 211 $a[ 'cluster' ] = $clname . "-local"; 212 $data[] = $a; 322 323 if ( $clname == 'alamo' ) 324 { 325 $a[ 'cluster' ] = $clname . "-local"; 326 $data[] = $a; 327 } 213 328 } 214 329 }
Note:
See TracChangeset
for help on using the changeset viewer.