Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NIM command online nim /o to create a new machine nim client ?

Status
Not open for further replies.

oliverbeat

Technical User
Sep 3, 2004
86
NZ
Hello,
I would like to know what is the command with all the option to create a new machine client nim on the nim master.
I am writing a script and I would like to have the command nim -o define -t machines -a ?????

I have did a man and test but I failed and I don-t know what I have to put about the option so if someone can give the good syntaxe whith all the options needed through an example.

Through smitty nim F6 didn-t give the commande but a lot of thing !!!


So thanks in advance for your help as I would like to automotate the client nim creation and for the rest it is ok to allocate the resource ....


Thanks

 
Take a look at smit.script and it might be clearer. I had to set up a large NIM server and it has a lot of client systems. Here is what I did:

1. First set up your network resources, especially if your clients are on different subnets. A sample of the script I used is below.

2. Then set up your machine resources. A sample of that script is after the network resources script.

network resource scripts:

add_network()
{
IEEE_ENT=
while getopts n:t:a:s:c:eek::i:g: option
do
case $option in
n) NAME=$OPTARG;;
t) TYPE=$OPTARG;;
a) NETADDR=$OPTARG;;
s) SNM=$OPTARG;;
g) GATEWAY=$OPTARG;;
o) OTHER_NET=$OPTARG;;
i) IEEE_ENT=$OPTARG;;
c) COMMENTS="$OPTARG";;
esac
done

nim -o define -t ${TYPE} -a net_addr=${NETADDR} -a snm=${SNM}
${OTHER_NET:+-a other_net_type1=$OTHER_NET} ${GATEWAY:+-a routing1=
"default ${GATEWAY}"} ${IEEE_ENT:+ -a ieee_ent=yes} ${COMME
NTS:+-a comments="${COMMENTS}"} ${NAME}
rc=$?
return $rc
}
[NOTE: this sets up the function you are going to use.]

add_network -n '10_2_4_subnet' -t 'ent' -a '10.2.4.0' -s '255.255.255.0' -g '10.2.4.1' -c '10.2.4 subnet'

NOTE: -n is the name of the resource. -t is the type of resource. I can't remember what -a is for, but it is always the .0 address of the subnet. -s is the netmask. -g is the gateway. -c is the comments field.

For each network, add an "add_network" line to the script.


machine setup secript:

add_machine()
{
HADDR=0
while getopts N:t:p:T:n:h:a:l:C:c:E:U:k:S:d:K: FLAG
do
case $FLAG in
N) NAME=$OPTARG;;
t) TYPE=$OPTARG;;
P) PLATFORM=$OPTARG;;
T) CABLE=$OPTARG;;
n) NETNAME=$OPTARG;;
h) HOSTNAME=$OPTARG;;
a) HADDR=$OPTARG;;
l) ADAPTER=$OPTARG;;
C) CPUID=$OPTARG;;
c) COMMENTS=$OPTARG;;
E) IPLROM_EMU=$OPTARG;;
U) GROUP=$OPTARG;;
k) NETBOOT_KERNEL=$OPTARG;;
S) SPEED=$OPTARG;;
d) DUPLEX=$OPTARG;;
K) NIMSERVICE=$OPTARG;;
esac
done
[ -n "$ADAPTER" ] && PIF="$NETNAME $HOSTNAME $HADDR $ADAPTER"
|| PIF="$NETNAME $HOSTNAME $HADDR"
if [[ -n "$SPEED" || -n "$DUPLEX" ]]
then
NET_SETTINGS="$SPEED $DUPLEX"
fi
nim -o define -t $TYPE -a platform=$PLATFORM -a if1="$PIF"
${CABLE:+-a cable_type1=$CABLE} ${NET_SETTINGS:+-a net_settings1="$NET_SETTINGS
"} ${IPLROM_EMU:+-a iplrom_emu=$IPLROM_EMU} ${GROUP:+-a group=$GRO
UP} ${NETBOOT_KERNEL:+-a netboot_kernel=$NETBOOT_KERNEL}
${NIMSERVICE:+-a connect=$NIMSERVICE} ${CPUID:+-a cpuid=$CPUID}
${COMMENTS:+-a comments="$COMMENTS"} $NAME

rc=$?
return $rc
}
add_machine -N 'systemhostname'-t'standalone' -P 'chrp' -k 'mp' -K 'shell' -T'N/A' -S
'100' -d 'full' -n'10_3_4_subnet' -h'systemhostname' -a'0' -c'commentsline'

{NOTE: this sets up the function you will use in your script]

-N is the name of the resource, I believe. -t says what kind of NIM machine it is. Can also be diskless or dataless. -P is the platform. -k says whether is it multiprocessor or uniprocesser (up). -T I'm not sure. -S is the speed of the network card. Make sure this matches what is on the system. -d says whether it is full duplex, half duplex or autonegotiate. -n is the network resource you set before. -h I'm not sure. -a I'm not sure. -c is the comments line.

Sorry about the "not sures." I developed the script quickly because someone had totally trashed our old NIM server and I had to quickly rebuild a new one. I did it by taking the lines from smit.script after I defined one network and one machine and adding at the botton all the add_machine or add_network lines I needed. One thing if you model your script from smit.script: One of the scripts in smit.script didn't have the
rc=$?
return $rc
lines, so the script would just stop after the first system or network was defined.

Hope this helps.

 
Hello,

I have found the command
/usr/sbin/nimdef -p -f client.defs
You have to create a file config first "client.defs" and use it to create the client nim
refer to man nimdef

Thanks for your answer.
I have wrote my script and usng the nimdef command.

Cheers.
Al
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top