File: dead-nodes

package info (click to toggle)
gridengine 8.1.9%2Bdfsg-13.2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 57,848 kB
  • sloc: ansic: 432,690; java: 87,068; cpp: 31,958; sh: 29,445; jsp: 7,757; perl: 6,336; xml: 5,828; makefile: 4,705; csh: 3,934; ruby: 2,221; tcl: 1,676; lisp: 669; yacc: 519; python: 503; lex: 361; javascript: 200
file content (32 lines) | stat: -rwxr-xr-x 723 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh

# List dead nodes (sgeexecd not responding).

# Dave Love <fx@gnu.org>, 2008-09
# Copyright (C) 2008 The University of Liverpool
# Licence: FreeBSD <http://www.gnu.org/licenses/license-list.html#FreeBSD>

usage () {
    echo "Usage: $(basename $0) [-w]
List dead nodes (where the SGE exec daemon isn't responding).
-w means separate node names with commas, to produce a list suitable
for the -w arg of pdsh."
}

case $1 in
    --help) usage; exit;;
    -w) comma=1;;
    '') : ;;
    *) usage 1>&2; exit 1;;
esac

out=$(qhost |
      grep ' - ' |		# dead
      grep -v global |		# ignore global
      cut -d ' ' -f 1)
if [ -z "$comma" ]; then
    echo "$out"
else
  echo "$out" | tr "\n" , | sed -e 's/,$//'
fi