The article describes the necessary steps to run Inventory Scout automatically on a number of systems. Then a script is shown (download available) that conveniently implements these steps. Finally, the collection of microcode levels on any number of systems is possible with a single call of the script.
With Inventory Scout, in conjunction with MDS (Microcode Discovery Service), firmware and microcode levels can be monitored excellently. However, monitoring the levels for a complete environment is somewhat tedious, especially since it is generally not possible to connect directly to the Internet from the individual systems. In a larger environment, it makes sense to monitor the microcode levels centrally from a NIM server. The NIM server requires either a direct connection to the Internet or a connection using a proxy server. LPARs to which physical hardware is assigned are usually only the virtual I/O servers.
To run Inventory Scout automatically, the following steps must be performed on the NIM server:
Step 1: Download the current catalog.mic file from IBM to the NIM server
IBM regularly updates the catalog.mic file. When running Inventory Scout, you should make sure to use the latest version of the catalog.mic file. The file can can be downloaded by FTP using the URL ftp://ftp.software.ibm.com/software/server/firmware/catalog.mic. An easy way to download the file is using curl:
# curl ftp://ftp.software.ibm.com/software/server/firmware/catalog.mic -o catalog.mic % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 307k 100 307k 0 0 90060 0 0:00:03 0:00:03 --:--:-- 90060 #
If a proxy must be used, the call looks like this:
# curl –proxy http://10.2.1.187 ftp://ftp.software.ibm.com/software/server/firmware/catalog.mic -o catalog.mic % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 307k 100 307k 0 0 83764 0 0:00:03 0:00:03 --:--:-- 83764 #
The downloaded file is saved in the current directory under the name catalog.mic.
The file should be downloaded to the NIM server, from where it can be copied to any NIM client (e.g. the virtual I/O server) using NIM operations.
Step 2: Copy (push) the current catalog.mic to the target system
Next, the current catalog.mic file must be copied to the target system, usually a virtual I/O server. If the target is a NIM client, copying can be done using NIM means. The easiest way to do this is by using the NIM method /usr/lpp/bos.sysmgt/nim/methods/c_rcp. We assume that the catalog.mic file is on the NIM server in the directory /var/adm/invscout/microcode and should also be copied to this directory on the target. The command for the NIM client ms01-vio1 would be:
# /usr/lpp/bos.sysmgt/nim/methods/c_rcp /var/adm/invscout/microcode/catalog.mic ms01-vio1:/var/adm/invscout/microcode/catalog.mic #
The command must be executed as root.
Now the updated catalog.mic file is already on the virtual I/O server.
Step 3: Run Inventory Scout (invscout) on the target system
Now Inventory Scout can be started on the target system. The NIM command /usr/lpp/bos.sysmgt/nim/methods/c_rsh helps here. The command to be started is /usr/sbin/invscout. Here again the command line for the NIM client ms01-vio1:
# /usr/lpp/bos.sysmgt/nim/methods/c_rsh ms01-vio1 /usr/sbin/invscout ****** Command ---- V126.96.36.199 ****** Logic Database V188.8.131.52 Initializing ... Identifying the system ... Working ... Getting system microcode level(s) ... Scanning for device microcode level(s) ... 150 devices detected; each dot (.) represents 10 devices processed: .............. Writing Microcode Survey upload file ... Microcode Survey complete The output files can be found at: Upload file: /var/adm/invscout/ms01-vio1.mup Report file: /var/adm/invscout/invs.mrp Report file: /var/adm/invscout/invs.mrrup To transfer the invscout 'Upload file' for microcode comparison, see your service provider's web page. #
The microcode survey upload file required for analysis on the IBM MDS website is /var/adm/invscout/ms01-vio1.
Step 4: Collect the generated microcode survey upload file from the target system
In this step, the generated microcode survey upload file of the NIM client is collected by the NIM server and stored in a directory on the NIM server. A file can be downloaded by the NIM command /usr/lpp/bos.sysmgt/nim/methods/c_rsh by executing a cat on the file to be copied and redirecting the output to a file. This is shown here for the NIM client ms01-vio1:
# /usr/lpp/bos.sysmgt/nim/methods/c_rsh ms01-vio1 "/usr/bin/cat /var/adm/invscout/ms01-vio1.mup" > ms01-vio1.mup #
Step 5: Upload the microcode upload file to IBM MDS
Finally, the collected microcode survey upload file of the NIM client must be uploaded to IBM for analysis by IBM MDS. The URL for the upload is http://www14.software.ibm.com/support/customercare/mds/mds. The easiest way to upload the file is with the curl command. An HTML file containing the analysis is then returned by default from the IBM web server. The upload for the microcode survey upload file ms01-vio1.mup collected in step 4 using curl is:
# curl -F "mdsDatafirstname.lastname@example.org;type=multipart/form" -H "Expect:" http://www14.software.ibm.com/support/customercare/mds/mds -o ms01-vio1.html % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 20894 100 10399 100 10495 12409 12523 --:--:-- --:--:-- --:--:-- 24903 #
Using a proxy, it looks like this:
# curl --proxy http://172.26.129.46:3128 -F "mdsDataemail@example.com;type=multipart/form" -H "Expect:" http://www14.software.ibm.com/support/customercare/mds/mds -o ms01-vio1.html % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 20894 100 10399 100 10495 13213 13335 --:--:-- --:--:-- --:--:-- 26515 #
The file ms01-vio1.html contains an overview of the microcode levels and information about which versions have to be updated.
A good description of Inventory Scout and MDS can be found here: http://gibsonnet.net/blog/cgaix/html/MDS%20reports.html (Chris Gibson)
Putting the steps in a script
If Inventory Scout is to be run on several systems, then step 1 only has to be carried out once. Steps 2 through 5 can then be looped through a list of systems.
We wrote the shell script run_invscout for the automated execution of Inventory Scout on several systems. The script can be found in our download area (https://powercampus.de). As an illustration, the output of a run for 2 NIM clients is shown briefly:
# run_invscout ms01-vio1 ms02-vio2 create backup of catalog.mic file ... done - /var/adm/invscout/microcode/catalog.mic.202006100958 downloading catalog.mic from IBM ... ok - version 202006100958 ms01-vio1 update catalog file ... updated ms01-vio1 execute invscout ... executed ms01-vio1 collect microcode upload file ... downloaded ms01-vio1 upload microcode upload file to IBM ... uploaded ms02-vio2 update catalog file ... updated ms02-vio2 execute invscout ... executed ms02-vio2 collect microcode upload file ... downloaded ms02-vio2 upload microcode upload file to IBM ... uploaded #
The script supports a number of options:
# run_invscout -h ERROR: unknown option '-h' Usage: run_invscout [-c|-C] [-d|-D] [-p|-P] [-u|-U] [-x http://<proxy>:<port>] [<nim_client>|<mac_group> ...] -c : collect microcode survey upload file from targets (default) -C : do not collect microcode survey upload file -d : download catalog.mic file from IBM (default) -D : do not download catalog.mic file from IBM -p : push catalog.mic file to targets (default) -P : do not push catalog.mic file to targets -u : upload microcode surevey upload files to IBM (default) -U : do not upload microcode surevey upload files to IBM -x : proxy-server and port to use for downloads and uploads #
By default, all 5 steps are carried out. Individual steps can be omitted by specifying options. E.g., if the catalog.mic file on the NIM server is already up-to-date, you can skip the download with the option “-D” (do not download catalog.mic). The reports, generated in the form of HTML files during the analysis, are stored in the directory /export/mup by default. This can be changed in the script by modifying the value of the variable MICROCODE_UPLOAD_DIR.
If the NIM server does not have a direct internet connection, the “-x” option can be used to specify a proxy to be used. If the Electronic Service Agent is configured on the NIM server, the proxy configuration is automatically taken over by ESA and you do not need to enter a proxy on the command line.
The script uses curl for downloads and uploads, so a working curl version must be installed, e.g. from the AIX Toolbox (https://www.ibm.com/support/pages/aix-toolbox-linux-applications-downloads-alpha).
The usage message shows that NIM mac_groups can also be specified. In particular, by default, if no argument is given, the NIM mac_group with the name all_vioserver is used. The default target for run_invscout can be changed in the script by modifying the value of the variable DEFAULT_TARGET.
The NIM mac_group all_vioserver can be created very easily, at least one member must be specified:
# nim -o define -t mac_group -a add_member=ms01-vio1 all_vioserver #
Other members can be added by:
# nim -o change -a add_member=ms01-vio2 all_vioserver #
If the standard input of the script is not connected to a TTY, because the script is started using a crontab entry for example, an additional start and end mark with a time stamp is shown, as well as a status line with the number of NIM clients for which at least one of the steps failed. This is useful if the script is started automatically and the output is redirected to a log file. This is demonstrated here by closing the standard input channel and running the script using the default target all_vioserver:
# run_invscout </dev/null BEGIN: Mon Jun 22 16:03:45 CEST 2020 create backup of catalog.mic file ... done - /var/adm/invscout/microcode/catalog.mic.202006100958 downloading catalog.mic from IBM ... ok - version 202006100958 mac_group all_vioserver ... expanding ms01-vio1 update catalog file ... updated ms01-vio1 execute invscout ... executed ms01-vio1 collect microcode upload file ... downloaded ms01-vio1 upload microcode upload file to IBM ... uploaded ms01-vio2 update catalog file ... updated ms01-vio2 execute invscout ... executed ms01-vio2 collect microcode upload file ... downloaded ms01-vio2 upload microcode upload file to IBM ... uploaded mac_group all_vioserver ... done FAILED: 0 target(s) END: Mon Jun 22 16:04:28 CEST 2020 #
Using the script run_invscout, automated runs of Inventory Scout can be started extremely easily for any number of systems.