How to determine why your AIX oslevel is downlevel (and a script to help!)

How to determine why your AIX oslevel is downlevel (and a script to help!)

o determine the oslevel on AIX, you can run the "oslevel -s" command.   However, what "oslevel -s" reports doesn't always show the entire picture.   The OS level reported will be the lowest level of any installed AIX fileset on your server. 

For example, if all the filesets on your AIX server are upgraded to AIX TL8 SP3 except for one fileset which is at a lower level, then the oslevel reported will reflect the lower level of that single fileset, which might be something like TL4 SP2.   So even though your server is 99.9% AIX TL8 SP3 oslevel would report the lowest level of any installed fileset. 

The "oslevel -sq" command will show all of service packs that your AIX server is aware of.  If you compare the top line in "oslevel -sq" versus "oslevel -s" they should normally match.   If they don't, then you probably have an issue.

 

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If you have a downlevel OS you can figure out which filesets are causing the issue and then fix them.  

The first step to figuring out what filesets are causing the problem is to determine if your TL (Technology level) level is incorrect or just your SP (Service Pack) level is incorrect.  To do this, compare the highest "oslevel -sq" line with your current "oslevel -s".  

If the first 7 characters (####-##) match, but the rest are different, then your TL level is correct, but your SP level is not.   For example, if your top line in your "oslevel -sq" output was 6100-07-02-1150, and your "oslevel -s" output was "6100-07-01-1141" then you would know your TL level was correct at TL7, but your SP level was not (oslevel -sq reported SP2, oslevel -s reported SP1).   To determine which filesets are the problem if the TL level is correct, but the SP level is wrong, run: 

 

oslevel -s -l `oslevel -sq 2>/dev/null | sed -n '1p'`

 

This command will show you all the filesets that are below the SP level of the highest known SP level on the system. 

 

If the TL level doesn''t match, for example if your top line in your "oslevel -sq" output was 6100-07-02-1150, and your "oslevel -s" output was "6100-04-11-1140" then you would know your TL level is incorrect (oslevel -sq reported TL7, oslevel -s reported TL4).  To determine which filesets are the problem if the TL level is not correct, run:

 

oslevel -r -l `oslevel -rq 2>/dev/null | sed -n '1p'`

 

This command will show you all the filesets that are below the TL level of the highest know TL level on the system. 

 

Here is a script that will automates this process (note that this script doesn't work with AIX 5.2 or older).  It will check out the state of your system and let you know if you have downlevel filesets:

 

#!/usr/bin/ksh

echo "Checking oslevel..."
curr_oslevel=`oslevel -s`

if [ "`oslevel -sq 2>/dev/null | sed -n '1p'`" = "$curr_oslevel" ]; then
        echo "oslevel appears to be correct:  $curr_oslevel"
        exit 0
fi

if [ "`oslevel -rq 2>/dev/null | sed -n '1p'`" = "`oslevel -r`" ]; then
        echo "Current SP level appears to be downlevel"
        echo "oslevel -s:     $curr_oslevel"
        echo "oslevel -s -q:  `oslevel -sq 2>/dev/null | sed -n '1p'`"
        echo; echo "Check the following filesets:"
        oslevel -s -l `oslevel -sq 2>/dev/null | sed -n '1p'`
else
        echo "Current TL level appears to be downlevel"
        echo "oslevel -r:     `oslevel -r`"
        echo "oslevel -r -q:  `oslevel -rq 2>/dev/null | sed -n '1p'`"
        echo; echo "Check the following filesets:"
        oslevel -r -l `oslevel -rq 2>/dev/null | sed -n '1p'`
fi
 

 

Here is a screenshot of the output:

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

You might be wondering how you can avoid getting in a downlevel OS situation in the first place...  Well usually this issue happens if you use the base media from an older level to install a fileset.   For example, if you are at 6.1 TL8 SP3 and a user requests you install a new fileset.   You only have the 6.1 TL7 SP2 base media, so you use it to install the requested fileset.   If you just do this, your OS level will more than likely be downlevel now and report an incorrect version.   What you need to do after installing a fileset from older media is to reinstall the TL8 SP3 update filesets to bring what you just installed up to the correct level.   Remember - ALWAYS check the oslevel before and after you do any work related to filesets to make sure what you just did didn't downlevel the OS. 

 

The best way to look which packages are need to fix is this.
instfix -i | egrep "ML|SP"| grep "Not all filesets for" | awk '{system ("instfix -ciqk "$5)}'
This will tell you exactly which fileset is missing for the SP also.

 

 

0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
Using AIX VG mirroring in combination with hardware snapshots
Viewed 4308 times since Sat, May 25, 2019
Check connection (rsh or nimsh) between NIM server and LPAR
Viewed 8724 times since Thu, Feb 21, 2019
AIX- Procedure to replace rootvg harddisk
Viewed 3857 times since Tue, Apr 16, 2019
AIX: Error code 0516-1339, 0516-1397 0516-792: cannot extendvg with a previous Oracle ASM disk
Viewed 3196 times since Wed, Feb 6, 2019
Useful AIX commands
Viewed 8819 times since Sun, Jun 17, 2018
https://www.ibm.com/developerworks/learn/aix/index.html
Viewed 10769 times since Wed, May 30, 2018
How to clear/clean/erase/delete/reset network adapter configuration on AIX?
Viewed 11887 times since Thu, Nov 29, 2018
A Change to the SMT Mode Default in POWER9
Viewed 4507 times since Fri, Jan 18, 2019
Script to reset NIM state and deallocate resources
Viewed 1969 times since Thu, Feb 21, 2019
IVM and VLAN Tagging
Viewed 9964 times since Mon, May 28, 2018