source: gpfs_3.1_ker2.6.20/lpp/mmfs/bin/mmlsconfig @ 152

Last change on this file since 152 was 16, checked in by rock, 17 years ago
  • Property svn:executable set to *
File size: 17.9 KB
Line 
1#!/bin/ksh
2# IBM_PROLOG_BEGIN_TAG
3# This is an automatically generated prolog.
4
5
6
7# Licensed Materials - Property of IBM
8
9# (C) COPYRIGHT International Business Machines Corp. 2000,2007
10# All Rights Reserved
11
12# US Government Users Restricted Rights - Use, duplication or
13# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
14
15# IBM_PROLOG_END_TAG
16# @(#)46 1.13.1.1 src/avs/fs/mmfs/ts/admin/mmlsconfig.sh, mmfs, avs_rgpfs24, rgpfs24s011a 3/28/07 19:15:23
17##########################################################################
18#
19#  List the GPFS configuration data for the cluster.
20#
21#  Usage:  mmlsconfig [Attribute[,Attribute...] [-Y]
22#
23##########################################################################
24
25# Include global declarations and service routines
26. /usr/lpp/mmfs/bin/mmglobfuncs
27. /usr/lpp/mmfs/bin/mmsdrfsdef
28
29sourceFile="mmlsconfig.sh"
30[[ -n $DEBUG || -n $DEBUGmmlsconfig ]] && set -x
31$mmTRACE_ENTER "$*"
32
33# Local work files.  Names should be of the form:
34#   fn=${tmpDir}fn.${mmcmd}.$$
35
36LOCAL_FILES=" "
37
38# Local variables
39usageMsg=370
40underline="----------------------------------------------------------"
41underline="${underline}----------------------------------------------"
42
43typeset -l cfgParm_lc
44
45# Local routines
46
47#############################################################################
48#
49# Function:  Determine the value of the specified mmfs.cfg parameter.
50#
51# Input:     $1 - mmfs.cfg parameter name.
52#            $2 - default value
53#            $3 - mmfs.cfg file to use.
54#            $4 - line prefix string (implies colon separated output)
55#
56# Output:    The value of the mmfs.cfg parameter.  Multiple lines are possible
57#            if there are node overrides.
58#
59# Returns:   0 - worked
60#            1 - unexpected error
61#
62#############################################################################
63function listCfgValue  # <parmName> <default> <cfgFile> [<prefix>]
64{
65  typeset sourceFile="mmlsconfig.sh"
66  [[ -n $DEBUG || -n $DEBUGlistCfgValue ]] && set -x
67  $mmTRACE_ENTER "$*"
68  typeset parm=$1
69  typeset defaultValue=$2
70  typeset cfgFile=$3
71  typeset linePrefix=$4
72
73  typeset separatorChar=" "
74
75  # Verify input parameters.
76  if [[ $# -lt 3 ]]
77  then
78    operands="<parmName> <default> <cfgFile> [<prefix>]"
79    printErrorMsg 260 listCfgValue "$operands"
80    cleanupAndExit
81  fi
82
83  [[ -n $linePrefix ]] && separatorChar=":"
84
85  # Find the setting of the parameter from the specified config file.
86  $awk -v parm="$parm" -v defaultValue="$defaultValue" \
87       -v sep="$separatorChar" -v prefix="$linePrefix" '
88    BEGIN {
89      { globalScope = 1 }
90      { nodeList = "" }
91      { n = 0 }
92      { value[0] = defaultValue }
93      { nodes[0] = "" }
94    }
95
96    # If this is the end of a node-override section,
97    # set the flag to accept parameter values.
98    $1 == "[common]" {
99      { globalScope = 1 }
100      { next }
101    }
102
103    # If this is the start of a node-override section,
104    # save the node list.
105    /^\[.*]/ || /^[     ]*\[.*]/ {
106      { globalScope = 0 }
107      nodeList = $1
108      if (prefix) {
109        # Remove the brackets.
110        sub("\\[","",nodeList)
111        sub("]","",nodeList)
112      }
113      { next }
114    }
115
116    # If this is a declaration for our parameter, save the value.
117    $1 == parm {
118      if (globalScope) {
119        { nodeList = "" }
120        { n = 0 }
121      }
122      else {
123        { n++ }
124      }
125      # Add code to save the entire line minus $1
126      { value[n] = $2 }
127      { nodes[n] = nodeList }
128    }
129
130    END {
131      # Print the result.
132      for (i=0; i<=n; i++) {
133        print prefix parm sep value[i] sep nodes[i] sep
134      }
135    }
136  ' $cfgFile
137  checkForErrors awk $?
138
139  return 0
140
141}  #----- end of function listCfgValue ---------------------------
142
143
144#############################
145# Check the input arguments.
146#############################
147[[ $arg1 = '-?' || $arg1 = '-h' || $arg1 = '--help' || $arg1 = '--' ]] &&  \
148  syntaxError "help" $usageMsg
149
150if [[ $arg1 = '-Y' ]]
151then
152  Yopt=true
153  parmList="$arg2"
154  [[ -n $arg3 ]] && syntaxError "extraArg"  $usageMsg "$arg3"
155else
156  parmList="$arg1"
157  [[ $arg2 = '-Y' ]] && Yopt=true
158  if [[ $arg2 = '-Y' ]]
159  then
160    Yopt=true
161    [[ -n $arg3 ]] && syntaxError "extraArg"  $usageMsg "$arg3"
162  else
163    [[ -n $arg2 ]] && syntaxError "extraArg"  $usageMsg "$arg2"
164  fi
165fi  # end of if [[ $arg1 = '-Y' ]]
166
167
168#######################################################################
169# Set up trap exception handling and call the gpfsInit function.
170# It will ensure that the local copy of the mmsdrfs and the rest
171# of the GPFS system files are up-to-date.  No need to lock the sdr.
172#######################################################################
173trap pretrap2 HUP INT QUIT KILL
174gpfsInitOutput=$(gpfsInit nolock)
175setGlobalVar $? $gpfsInitOutput
176
177
178#################################################################
179# Loop through the mmsdrfs file and collect needed information.
180#################################################################
181$rm -f $tmpfile
182IFS=":"         # Change the field separator to ':'
183exec 3<&-
184exec 3< $mmsdrfsFile
185while read -u3 sdrfsLine
186do
187  # Parse the line.
188  set -f ; set -A v -- - $sdrfsLine ; set +f
189
190  IFS="$IFS_sv"    # Restore the default IFS settings.
191
192  case ${v[$LINE_TYPE_Field]} in
193
194    $VERSION_LINE )
195       # Extract the cluster name.
196       clusterName=${v[$CLUSTER_NAME_Field]}
197       ;;
198
199    $SG_HEADR )
200       # Collect the names of all local file systems.
201       if [[ ${v[$NODESETID_Field]} = $HOME_CLUSTER ]]
202       then
203         print -- "/dev/${v[$DEV_NAME_Field]}" >> $tmpfile
204         checkForErrors "writing to file $tmpfile" $?
205       fi
206       ;;
207
208    * )  # No need to look at any of the other lines
209      ;;
210
211  esac  # end case ${v[$LINE_TYPE_Field]} in
212
213  IFS=":"  # Change the separator back to ":" for the next iteration
214
215done  # end while read -u3
216
217IFS="$IFS_sv"  # Restore the default IFS settings.
218
219
220# The config information is in the file mmfscfgFile.
221# If the traditional default output is desired, display
222# the content skipping comment and empty lines.
223if [[ -z $parmList && -z $Yopt ]]
224then
225  header=$(printInfoMsg 407 $clusterName)
226  printf "%s\n%.${#header}s\n" "$header" "$underline"
227
228  $egrep -v -e "^([$BLANKchar$TABchar])*#"  \
229            -e "^([$BLANKchar$TABchar])*$" $mmfscfgFile
230
231  # Display the names of the locally owned file systems.
232  header=$(printInfoMsg 408 $clusterName)
233  printf "\n%s\n%.${#header}s\n" "$header" "$underline"
234  if [[ -s $tmpfile ]]
235  then
236    $cat $tmpfile
237  else
238    # There are no file systems
239    printInfoMsg 409
240  fi
241
242  cleanupAndExit 0
243fi  # end of if [[ -z $parmList && -z $separatorChar ]]
244
245
246# If we are here, either specific paramters were requested
247# and/or colon separated output is desired.
248if [[ -n $Yopt ]]
249then
250  # Generate and print the header line.
251  hdrLine="mmlsconfig::HEADER:version:reserved:reserved"
252  hdrLine="${hdrLine}:configParameter:value:nodeList"
253  print -- "${hdrLine}:"
254
255  # Generate the prefix for the data lines.
256  linePrefix="mmlsconfig::0:1:::"
257fi  # end of if [[ -n $Yopt ]]
258
259# If no specific parameters were requested, show all
260# offciallly supported and documented paramters.
261if [[ -z $parmList || $parmList = all ]]
262then
263  parmList="autoload,automountDir,cipherList,clusterId,clusterName"
264  parmList="${parmList},dataStructureDump,distributedTokenServer"
265  parmList="${parmList},dmapiEventTimeout,dmapiMountTimeout,dmapiSessionFailureTimeout"
266  parmList="${parmList},maxblocksize,maxFilesToCache,maxMBpS,maxStatCache"
267  parmList="${parmList},nsdServerWaitTimeForMount,nsdServerWaitTimeWindowOnMount"
268  parmList="${parmList},pagepool,prefetchThreads,subnets,uidDomain"
269  parmList="${parmList},unmountOnDiskFail,worker1Threads"
270fi  # end of if [[ -z $parmList ]]
271
272
273IFS=","
274for cfgParm in $parmList
275do
276  IFS="$IFS_sv"
277  cfgParm_lc=$cfgParm
278
279  case $cfgParm_lc in
280    autoload )
281      defaultValue="no"; cfgParm=autoload ;;
282    allowdummyconnections )
283      defaultValue="no"; cfgParm=allowDummyConnections ;;
284    allowremoteconnections )
285      defaultValue="no"; cfgParm=allowRemoteConnections ;;
286    allowsynchronousfcntlretries )
287      defaultValue="yes"; cfgParm=allowSynchronousFcntlRetries ;;
288    assertonstructureerror )
289      defaultValue="no"; cfgParm=assertOnStructureError ;;
290    asyncsocketnotify )
291      defaultValue="no"; cfgParm=asyncSocketNotify ;;
292    automountdir )
293      defaultValue="/gpfs/automountdir"; cfgParm=automountDir ;;
294    autosgloadbalance )
295      defaultValue="no"; cfgParm=autoSgLoadBalance ;;
296    cipherlist )
297      defaultValue="(undefined)"; cfgParm=cipherList ;;
298    clusterid )
299      defaultValue="(undefined)"; cfgParm=clusterId ;;
300    clustername )
301      defaultValue="(undefined)"; cfgParm=clusterName ;;
302    crashdump )
303      defaultValue="0"; cfgParm=crashdump ;;
304    datastructuredump )
305      defaultValue="yes"; cfgParm=dataStructureDump ;;
306    datastructuredumponsgpanic )
307      defaultValue="no"; cfgParm=dataStructureDumpOnSGPanic ;;
308    distributedtokenserver )
309      defaultValue="yes"; cfgParm=distributedTokenServer ;;
310    dmapienable )
311      defaultValue="yes"; cfgParm=dmapiEnable ;;
312    dmapieventbuffers )
313      defaultValue="64"; cfgParm=dmapiEventBuffers ;;
314    dmapieventtimeout )
315      defaultValue="86400000"; cfgParm=dmapiEventTimeout ;;
316    dmapimounttimeout )
317      defaultValue="60"; cfgParm=dmapiMountTimeout ;;
318    dmapisessionfailuretimeout )
319      defaultValue="0"; cfgParm=dmapiSessionFailureTimeout ;;
320    dmapiworkerthreads )
321      defaultValue="12"; cfgParm=dmapiWorkerThreads ;;
322    eewatchdoghungthreadcutoff )
323      defaultValue="60"; cfgParm=eeWatchDogHungThreadCutoff ;;
324    eewatchdoginterval )
325      defaultValue="90"; cfgParm=eeWatchDogInterval ;;
326    enableuidremap )
327      defaultValue="no"; cfgParm=enableUIDremap ;;
328    enablestatuidremap )
329      defaultValue="no"; cfgParm=enableStatUIDremap ;;
330    enabletreebasedquotas )
331      defaultValue="no"; cfgParm=enableTreeBasedQuotas ;;
332    envvar )
333      defaultValue="(undefined)"; cfgParm=envVar ;;
334    flusheddatatarget )
335      defaultValue="32"; cfgParm=flushedDataTarget ;;
336    flushedinodetarget )
337      defaultValue="32"; cfgParm=flushedInodeTarget ;;
338    healthcheckinterval )
339      defaultValue="0"; cfgParm=healthCheckInterval ;;
340    hotlistpct )
341      defaultValue="10"; cfgParm=hotlistPct ;;
342    ignorereplicaspaceonstat )
343      defaultValue="no"; cfgParm=IgnoreReplicaSpaceOnStat ;;
344    iohistorysize )
345      defaultValue="512"; cfgParm=ioHistorySize ;;
346    leasedmstimeout )
347      defaultValue="2/3 leaseDuration"; cfgParm=leaseDMSTimeout ;;
348    leaseduration )
349      defaultValue="35"; cfgParm=leaseDuration ;;
350    leaserecoverywait )
351      defaultValue="35"; cfgParm=leaseRecoveryWait ;;
352    license )
353      defaultValue="(undefined)"; cfgParm=LICENSE ;;
354    listenonallinterfaces )
355      defaultValue="yes"; cfgParm=listenOnAllInterfaces ;;
356    maxallocpcttocache )
357      defaultValue="0"; cfgParm=maxAllocPctToCache ;;
358    maxbackgrounddeletionthreads )
359      defaultValue="4"; cfgParm=maxBackgroundDeletionThreads ;;
360    maxblocksize )
361      defaultValue="1M"; cfgParm=maxblocksize ;;
362    maxbufferdescs )
363      defaultValue="-1"; cfgParm=maxBufferDescs ;;
364    maxdatashippoolsize )
365      defaultValue="266240"; cfgParm=maxDataShipPoolSize ;;
366    maxdiskaddrbuffs )
367      defaultValue="-1"; cfgParm=maxDiskAddrBuffs ;;
368    maxfcntlrangesperfile )
369      defaultValue="200"; cfgParm=maxFcntlRangesPerFile ;;
370    maxfilecleaners )
371      defaultValue="8"; cfgParm=maxFileCleaners ;;
372    maxfilestocache )
373      defaultValue="1000"; cfgParm=maxFilesToCache ;;
374    maxinodedeallochistory )
375      defaultValue="50"; cfgParm=maxInodeDeallocHistory ;;
376    maxinodedeallocprefetch )
377      defaultValue="8"; cfgParm=maxInodeDeallocPrefetch ;;
378    maxmbps )
379      defaultValue="150"; cfgParm=maxMBpS ;;
380    maxmissedpingtimeout )
381      defaultValue="60"; cfgParm=maxMissedPingTimeout ;;
382    maxnfsdelegationtimeout )
383      defaultValue="60"; cfgParm=maxNFSDelegationTimeout ;;
384    maxreceiverthreads )
385      defaultValue="16"; cfgParm=maxReceiverThreads ;;
386    maxsgdesciobufsize )
387      defaultValue="262144"; cfgParm=maxSGDescIOBufSize ;;
388    maxstatcache )
389      defaultValue="4*maxFilesToCache"; cfgParm=maxStatCache ;;
390    maxtokenservers )
391      defaultValue="128"; cfgParm=maxTokenServers ;;
392    minmissedpingtimeout )
393      defaultValue="8"; cfgParm=minMissedPingTimeout ;;
394    minquorumnodes )
395      defaultValue="1"; cfgParm=minQuorumNodes ;;
396    mmapkprocs )
397      defaultValue="3"; cfgParm=mmapKprocs ;;
398    mmsdrservtimeout )
399      defaultValue="10"; cfgParm=mmsdrservTimeout ;;
400    mmsdrservworkerpool )
401      defaultValue="10"; cfgParm=mmsdrservWorkerPool ;;
402    multitmmountthreshold )
403      defaultValue="2"; cfgParm=multiTMMountThreshold ;;
404    nfsprefetchstrategy )
405      defaultValue="0"; cfgParm=nfsPrefetchStrategy ;;
406    nsdbufspace )
407      defaultValue="30"; cfgParm=nsdbufspace ;;
408    nsdinlinewritemax )
409      defaultValue="1024"; cfgParm=nsdInlineWriteMax ;;
410    nsdmaxworkerthreads )
411      defaultValue="32"; cfgParm=nsdMaxWorkerThreads ;;
412    nsdminworkerthreads )
413      defaultValue="8"; cfgParm=nsdMinWorkerThreads ;;
414    nsdservercheckingintervalformount )
415      defaultValue="10"; cfgParm=nsdServerCheckingIntervalForMount ;;
416    nsdserverwaitconfig )
417      defaultValue="2"; cfgParm=nsdServerWaitConfig ;;
418    nsdserverwaittimeformount )
419      defaultValue="300"; cfgParm=nsdServerWaitTimeForMount ;;
420    nsdserverwaittimewindowonmount )
421      defaultValue="600"; cfgParm=nsdServerWaitTimeWindowOnMount ;;
422    nsdthreadsperdisk )
423      defaultValue="3"; cfgParm=nsdThreadsPerDisk ;;
424    opensslenginename )
425      defaultValue="(undefined)"; cfgParm=opensslEngineName ;;
426    openssllibname )
427      defaultValue="(undefined)"; cfgParm=openssllibname ;;
428    pagepool )
429      defaultValue="64M"; cfgParm=pagepool ;;
430    panicondiskfail )
431      defaultValue="no"; cfgParm=unmountOnDiskFail ;;
432    pcttokenmgrstorageuse )
433      defaultValue="25"; cfgParm=pctTokenMgrStorageUse ;;
434    pindaemon )
435      defaultValue="no"; cfgParm=pindaemon ;;
436    pingperiod )
437      defaultValue="2"; cfgParm=pingPeriod ;;
438    pinmaster )
439      defaultValue="stack 256K data 4096K"; cfgParm=pinmaster ;;
440    prefetchpct )
441      defaultValue="20"; cfgParm=prefetchPct ;;
442    prefetchthreads )
443      defaultValue="72"; cfgParm=prefetchThreads ;;
444    prefetchtimeout )
445      defaultValue="5"; cfgParm=prefetchTimeout ;;
446    priority )
447      defaultValue="40"; cfgParm=priority ;;
448    readreplicapolicy )
449      defaultValue="default"; cfgParm=readReplicaPolicy ;;
450    res )
451      defaultValue="(undefined)"; cfgParm=res ;;
452    retryfcntltokenthreshold )
453      defaultValue="3"; cfgParm=retryFcntlTokenThreshold ;;
454    seqdiscardthreshhold )
455      defaultValue="1M"; cfgParm=seqDiscardThreshhold ;;
456    setctimeonattrchange )
457      defaultValue="yes"; cfgParm=setCtimeOnAttrChange ;;
458    sharedmemlimit )
459      defaultValue="0"; cfgParm=sharedMemLimit ;;
460    socketrcvbuffersize )
461      defaultValue="0"; cfgParm=socketRcvBufferSize ;;
462    socketsndbuffersize )
463      defaultValue="0"; cfgParm=socketSndBufferSize ;;
464    statcachedirpct )
465      defaultValue="10"; cfgParm=statCacheDirPct ;;
466    statmaxattrage )
467      defaultValue="0"; cfgParm=statMaxAttrAge ;;
468    subnets )
469      defaultValue="(undefined)"; cfgParm=subnets ;;
470    syncinterval )
471      defaultValue="70"; cfgParm=syncInterval ;;
472    takeovertimeout )
473      defaultValue="600"; cfgParm=takeovertimeout ;;
474    tokenmemlimit )
475      defaultValue="256M"; cfgParm=tokenMemLimit ;;
476    totalpingtimeout )
477      defaultValue="120"; cfgParm=totalPingTimeout ;;
478    trace )
479      defaultValue="all 0"; cfgParm=trace ;;
480    tracebuffersizeforaix )
481      defaultValue="(undefined)"; cfgParm=traceBufferSizeForAIX ;;
482    tracedevbuffersize )
483      defaultValue="(undefined)"; cfgParm=tracedevBufferSize ;;
484    tracegendump )
485      defaultValue="(undefined)"; cfgParm=traceGenDump ;;
486    tracegensubdir )
487      defaultValue="(undefined)"; cfgParm=traceGenSubDir ;;
488    tracefilesize )
489      defaultValue="(undefined)"; cfgParm=traceFileSize ;;
490    tracelogquiet )
491      defaultValue="(undefined)"; cfgParm=traceLogQuiet ;;
492    tracerecycle )
493      defaultValue="(undefined)"; cfgParm=traceRecycle ;;
494    tscprimary )
495      defaultValue="255.255.255.255"; cfgParm=tscPrimary ;;
496    tscworkerpool )
497      defaultValue="10"; cfgParm=tscWorkerPool ;;
498    udaplrdma )
499      defaultValue="disable"; cfgParm=udaplRdma ;;
500    udaplports )
501      defaultValue="(undefined)"; cfgParm=udaplPorts ;;
502    udaplrdmaspernode )
503      defaultValue="(undefined)"; cfgParm=udaplRdmasPerNode ;;
504    udaplrdmasperconnection )
505      defaultValue="(undefined)"; cfgParm=udaplRdmasPerConnection ;;
506    udaplrdmaminbytes )
507      defaultValue="16384"; cfgParm=udaplRdmasMinBytes ;;
508    verbsrdma )
509      defaultValue="disable"; cfgParm=verbsRdma ;;
510    verbsports )
511      defaultValue="(undefined)"; cfgParm=verbsPorts ;;
512    verbsrdmaspernode )
513      defaultValue="(undefined)"; cfgParm=verbsRdmasPerNode ;;
514    verbsrdmasperconnection )
515      defaultValue="(undefined)"; cfgParm=verbsRdmasPerConnection ;;
516    verbsrdmaminbytes )
517      defaultValue="16384"; cfgParm=verbsRdmasMinBytes ;;
518    uiddomain )
519      defaultValue="(undefined)"; cfgParm=uidDomain ;;
520    uidexpiration )
521      defaultValue="36000"; cfgParm=uidExpiration ;;
522    unmountondiskfail )
523      defaultValue="no"; cfgParm=unmountOnDiskFail ;;
524    wait4rvsd )
525      defaultValue="no"; cfgParm=wait4RVSD ;;
526    waitforvsd )
527      defaultValue="no"; cfgParm=wait4RVSD ;;
528    watchdogtimeout )
529      defaultValue="20"; cfgParm=watchdogtimeout ;;
530    worker1threads )
531      defaultValue="48"; cfgParm=worker1Threads ;;
532    worker3threads )
533      defaultValue="8"; cfgParm=worker3Threads ;;
534    writealldescreplicas )
535      defaultValue="no"; cfgParm=writeAllDescReplicas ;;
536    writebehindthreshhold )
537      defaultValue="512K"; cfgParm=writebehindThreshhold ;;
538    * )
539      defaultValue="(undefined)"; cfgParm="$cfgParm" ;;
540
541  esac  # end of case $cfgParm_lc in
542
543  # Invoke the function to retrieve and display the data.
544  listCfgValue "$cfgParm" "$defaultValue" $mmfscfgFile $linePrefix
545
546done  # end of for cfgParm in $parmList
547
548cleanupAndExit 0
549
Note: See TracBrowser for help on using the repository browser.