cancel
Showing results for 
Search instead for 
Did you mean: 

How to know mandatory VCS resource attributes from CLI

shiv124
Level 4

Thanks for the reply mike.That cleared things abt hagrp -flush.

when we are setting attributes to resource  there would be few madatory attributes to be set  to bring the resource online.

In GUI this can been known easily as we see the mandatory attributes would be BOLD.Accordingly we would be give values .if somebody  body  is configuring through CLI  how he knows abt  the mandatry attributes for any resource ?

Thanks and regards,

Siva

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Gaurav_S
Moderator
Moderator
   VIP    Certified

Siva,

You can not find the mandatory attributes via a CLI ...

however I believe it should be easy enough to look at resource type & think on what could be mandatory attributes. To ease of you can refer to  /etc/VRTSvcs/conf/config/types.cf to refer the attributes a resource has.

 

For e.g , If I refer a types.cf for diskgroup resource:

 

type DiskGroup (
static int NumThreads = 1
static int OnlineRetryLimit = 1
static str ArgList[] = { DiskGroup, StartVolumes,
StopVolumes, MonitorOnly }

str DiskGroup
str StartVolumes = 1
str StopVolumes = 1
)

 

I can look at above & understand only Diskgroup name is the important attribute for resource to work ...

Take another example of commonly used IP resource...

type IP (
static str ArgList[] = { Device, Address, NetMask, Options,
ArpDelay, IfconfigTwice }

str Device
str Address
str NetMask
str Options
int ArpDelay = 1
int IfconfigTwice
)

Here I can clearly imagine that I would need a device name, IP address & netmask mandatorily ...

 

So in short, refer types.cf & you should be able to pickup from command line ...

G

 

View solution in original post

3 REPLIES 3

mikebounds
Level 6
Partner Accredited

I don't know any easy way from CLI.  The only way I know how is to look at the XML that the GUI uses which you can find in agent bin directory - for bundled agents this is /opt/VRTSvcs/bin/Agent-name, but for other agents (like Oracle) the XML files are in /opt/VRTSagents/ha/bin/Agent-name.

Mike

 

Gaurav_S
Moderator
Moderator
   VIP    Certified

Siva,

You can not find the mandatory attributes via a CLI ...

however I believe it should be easy enough to look at resource type & think on what could be mandatory attributes. To ease of you can refer to  /etc/VRTSvcs/conf/config/types.cf to refer the attributes a resource has.

 

For e.g , If I refer a types.cf for diskgroup resource:

 

type DiskGroup (
static int NumThreads = 1
static int OnlineRetryLimit = 1
static str ArgList[] = { DiskGroup, StartVolumes,
StopVolumes, MonitorOnly }

str DiskGroup
str StartVolumes = 1
str StopVolumes = 1
)

 

I can look at above & understand only Diskgroup name is the important attribute for resource to work ...

Take another example of commonly used IP resource...

type IP (
static str ArgList[] = { Device, Address, NetMask, Options,
ArpDelay, IfconfigTwice }

str Device
str Address
str NetMask
str Options
int ArpDelay = 1
int IfconfigTwice
)

Here I can clearly imagine that I would need a device name, IP address & netmask mandatorily ...

 

So in short, refer types.cf & you should be able to pickup from command line ...

G

 

mikebounds
Level 6
Partner Accredited

If you just want to list attributes, you can also use hatype command - example:

# hatype -value Application ArgList
User StartProgram StopProgram CleanProgram MonitorProgram PidFiles MonitorProcesses
 
For mandatory attributes, I wrote a quick script:
 
if [ $# -eq 0 ]
then
  agent=*
else
  agent=$1
fi

awk '
 /mustconfigure=/ {
 n=split(FILENAME,slash,"/")
 if ($0 ~ /mustconfigure="True"/)
   print slash[n-1], " - Mandatory", $1 
 else
   print slash[n-1], " - Optional", $1
} ' `ls /opt/VRTSvcs/bin/*/${agent}.xml /opt/VRTSagents/ha/bin/*/${agent}.xml 2>/dev/null` | sort
 
So if you copy this into a file, like "ls_mand.sh", then example output gives:
 
# ./ls_mand.sh Application
Application  - Mandatory <StartProgram
Application  - Mandatory <StopProgram
Application  - Optional <CleanProgram
Application  - Optional <MonitorProcesses
Application  - Optional <MonitorProgram
Application  - Optional <PidFiles
Application  - Optional <User
 
If you run this script without any args then it lists all agents and their attributes.
 
Mike