I want to install single RPM from LPP on NIM system without doing it interactively (with single non-interactive command), so I 'got' that command from smitty this way:
# smitty nim > Install and Update Software > Install Software
Select the LPP_SOURCE containing the install images
> RPMS_AIX53 resources lpp_source
* LPP_SOURCE RPMS_AIX53
* Software to Install [@@R:sudo-1.6.9p23-2noldap 1.6.9p23-2noldap]
After pressing F6 now I get the command.
+--------------------------------------------------------------------------+
| SHOW COMMAND STRING |
| |
| Press Enter or Cancel to return to the |
| application. |
| |
| /usr/lpp/bos.sysmgt/nim/methods/c_sm_nim cust -l 'RPMS_AIX53' -o '@@R |
| :sudo-1.6.9p23-2noldap 1.6.9p23-2noldap' -f '' -f '' -f '' -f 'c' -f ' |
| N' -f 'g' -f 'X' -f '' -f '' |
| |
| F1=Help F2=Refresh F3=Cancel |
| F8=Image F10=Exit Enter=Do |
+--------------------------------------------------------------------------+
... but when I type this command in terminal, I get this error:
# /usr/lpp/bos.sysmgt/nim/methods/c_sm_nim cust -l 'RPMS_AIX53' -o '@@R:sudo-1.6.9p23-2noldap 1.6.9p23-2noldap' -f '' -f '' -f 'Y' -f 'c' -f 'N' -f 'g' -f 'X' -f '' -f ''
0042-001 nimclient: processing error encountered on "c003s1154":
0042-175 c_showres: An unexpected result was returned by the "/usr/lib/instl/sm_inst" command:
0042-231 c_sm_nim: Unable to generate the formatted list of software
to install.
This command is not supposed to be used outside SMIT. Use a simple "nim" command, which is done in two steps: first allocate the resource on the nim server, then use it on the client:
nim -o allocate -a lpp_source=<lpp_source> <client>
nim -o cust -a lpp_source=<lpp_source> -a filesets=<fileset> <client>
hmmm... isn't that already a good way to do it? After all, you could use a script like (just a barebone sketch - add error checking to your hearts content):
#! /bin/ksh
typeset chLppSrc="<lpp_source>"
typeset chFilSet="<fileset>"
typeset chHost=""
while read chHost ; do
nim -o allocate -a lpp_source="$chLppSrc" "$chHost"
nim -o cust -a lpp_source="$chLppSrc" -a filesets="$chFilSet" "$chHost"
done < /path/to/hosts.list
NIM # nim -F -o allocate -a lpp_source="RPMS_AIX53" "CLIENT"
NIM # nim -F -o deallocate -a lpp_source="nim_script" "CLIENT"
NIM # nim -o cust -a lpp_source="RPMS_AIX53" -a filesets="sudo-1.6.9p23-2noldap 1.6.9p23-2noldap" "CLIENT"
Validating RPM package selections ...
Please wait...
sudo ##################################################
+-----------------------------------------------------------------------------+
RPM Error Summary:
+-----------------------------------------------------------------------------+
The following packages were requested for installation
but were not found on the media:
1.6.9p23-2noldap
0042-001 nim: processing error encountered on "master":
0042-001 m_cust: processing error encountered on "CLIENT":
0042-175 c_script: An unexpected result was returned by the "NIM:/export/nim/scripts/CLIENT.script" command:
0042-175 c_installp: An unexpected result was returned by the "/usr/sbin/installp" command:
See the log file:
/var/adm/ras/nim.installp
for details or use the "showlog" operation.
NIM # cat /export/nim/scripts/CLIENT.script
#!/bin/ksh
CLIENT.script: END
# nim_script for CLIENT
result=success
export NIM_NON_41_MASTER=yes
export NIM_SHOW_PROGRESS=yes
export NIM_SCRIPT=yes
# lpp_source=RPMS_AIX53
/usr/lpp/bos.sysmgt/nim/methods/c_installp ${VERBOSE} \
-afilesets="sudo-1.6.9p23-2noldap 1.6.9p23-2noldap" \
-alpp_source=NIM:/export/PACKAGES/RPMS_AIX53
[[ $? != 0 ]] && result=failure
[[ ${result} = success ]] && exit 0 || exit 1
In other words, problem solved, thank You for help gentleman.