New Article: Tracing IBM AIX hdisks back to IBM System Storage SAN Volume Controller (SVC) volumes
I had a new article published today on IBM developerWorks: Tracing IBM AIX hdisks back to IBM System Storage SAN Volume Controller (SVC) volumes
|
Version 2 of script to show recent Error Report entries on AIX
This is an update to my previous post on a Script to show recent Error Report (errpt) entries on AIX Anthony and Dan had some good suggestions such as being able to specify the interval to go back in days instead of just minutes, and also having an option to just have the script show error report entries since the last time the script was run. So below is version two of this script. The changes are: You can specify the interval to show error report entries in by either specifying a number by... [More]
Tags:  perl errpt aix script |
Script to show recent Error Report (errpt) entries on AIX
Update 10/24/13: See also Version 2 of script to show recent Error Report entries on AIX Here is a script that will show you recent Error Report (errpt) entries on AIX. As an argument to the script you specify the number of minutes you want to go back, and the script will only show errpt entries that have occurred within that many minutes from now. This can be helpful as a standalone utility, or as part of a monitoring script that would automatically notify... [More]
Tags:  scripting script errpt aix perl |
Detecting and Fixing Underlying Mount Point Permission Errors on AIX
Every Filesystem in AIX has two sets of permissions: The permissions on the mount point directory, and the permissions on the mounted filesystem. Here is an example: # ls -ald /app5 drwxr-xr-x 2 bin bin 256 Sep 23 2012 /app5 #Mount Point Permissions # # mount /app5 # # ls -ald /app5 drwxrwxrwx 3 user ... [More]
Tags:  filesystem aix ksh script lvm |
How to Show Most Recently Installed/Updated Filesets on AIX
One of the fundamental principles of troubleshooting any issue is to look for what has changed between the time things went from working to not working. One thing that could be relevant to any issue is if any software has been recently updated or installed. AIX provides the "lslpp -h" command which will show fileset installation and update dates for each fileset. Unfortunately it doesn't sort the output of this, so it can be very difficult to look through the output to find filesets that have... [More]
Tags:  oneliner lslpp aix |
Script to show if your AIX HBA / hdisk settings are actually in effect
There are several storage related settings in AIX that cannot be changed if the device is active. These include "fast_fail" , Dynamic tracking (dyntrk), and the "num_cmd_elems" for HBA's and the Queue Depth for hdisks. Your options to set these are either make the device inactive (usually by taking redundant paths offline) and then make the change, or to use the "-P" flag on chdev and then reboot the server to make the change effective at the next boot. The "-P" option on chdev has... [More]
|
Update: Visualize the Physical Layout of an AIX Volume Group
This is an update to my previous post on Visualizing the Physical Layout of an AIX Volume Group (see the previous post for full details). Sebastian posted a comment suggesting an option to consolidate/merge PP's that are sequentially numbered to make the script usable on hdisks that might have over 50,000 PP's. This is a great idea, and I was able to update the script to add this. The options for the script have changed: -v <vgname> ... [More]
Tags:  korn aix lvm shell ksh |
Visualize the Physical Layout of an AIX Volume Group
9/23/13 Update - See this updated verison of the script as well. Here is a script I've written to visualize the physical layout of an AIX volume group. The script visually shows the location of every Physical Partition (PP) on each hdisk (AKA Physical Volume). The output shows which Logical Volume (LV) is on each of the PP's (or if it is free space). The output is color coded so each LV has its own color so that it is very easy to see where each LV physically... [More]
Tags:  korn aix ksh lvm shell |
How to run EZH HMC commands remotely over SSH (Easy HMC Command Line Interface)
If you aren't familiar with EZH (the Easy HMC Command Line Interface), check out the EZH project website on sourceforge It is a free, easy to install script for your HMC that provides a much better command line interface to your HMC and will make you much more efficient when working with your HMC. Not only does it provide shortcuts for all common HMC commands, it also adds additional functionality not available natively and even includes an interactive menu. I was recently asked if... [More]
Tags:  ezh hmc aix ssh |
How to determine why your AIX oslevel is downlevel (and a script to help!)
To 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... [More]
Tags:  aix oslevel ksh script |
Using savevg on AIX to save time creating filesystems, LV's and volume groups
If you ever need to build multiple servers that will all have the same volume groups, logical volumes, and filesystems you can use "savevg" and "restvg" to save yourself a bunch of time and duplicated work. This also works if you are ever asked to build a new server that should be setup with the same VG/LV/FS's as an older server. You start by setting up one of the servers with the volume groups, logical volumes, and filesystems that you will need. Next you can use the "savevg -r" command to... [More]
Tags:  lvm aix |
Linux/UNIX Shell Scripting: Why does "echo" remove spaces and newlines sometimes?
One common problem I have personally made and seen others make while shell scripting is trying to set a variable to be the contents of a file or the output of a multiline command, and then trying to echo the variable to process it further with grep, awk, a while loop, etc. Depending on how you do this you might get some unexpected results because you might have missing newlines and spaces from your output. In this example, we have a file named "testfile" that contains 5 lines. I then set the testvar... [More]
Tags:  korn bash shell unix linux scripting aix ksh |
New Article: Understanding SSH Authentication Key Basics |
How to filter the output of pcmpath query device to only show hdisk and serial number
I have always really liked the AIX sddpcm mulitpathing software. It is easy to use, and easy to gather information from. However, one thing I have wanted to do in the past is run a command that just shows the hdisk device and the corresponding SAN serial number. The closest thing SDDPCM has to this is the "pcmpath query device" command which shows a bunch of information for each SAN LUN: DEV#: 0 DEVICE NAME: hdisk1 TYPE: 2145 ALGORITHM: Load Balance... [More]
Tags:  aix sddpcm script scripting |
How to verify you have a recent Mksysb Backup for every NIM client
The last thing you want to happen is to realize you don't have a mksysb backup of a server when you really need it, or realize the only mksysb backup you have is very out of date. This post will show you one method to verify you have recent mksysb's for all your NIM clients. The process to check this basically works like this: First we want to get a list of all NIM client machines. Then for each NIM client machine we look through all the mksysb resources and see if there is a mksysb with the servers name on... [More]
Tags:  nim aix ksh |
Prevent and Detect Orphaned Mksysb NIM resources
In order to have a working mksysb resource in a NIM environment you need to have 2 items: a NIM mksysb resource which points to a mksysb file in the filesystem. A good NIM mksysb resource looks like the image below. The NIM mksysb resource is stored in the ODM and has a "location" attribute that points to a file in the filesystem. However, if something (or someone) deletes the mksysb file from the filesystem, but doesn't... [More]
Tags:  aix nim mksysb |
Gracefully disabling paths for a Virtual SCSI adapter before VIO Server maintenance
I recently got a question about how to script disabling paths for a Virtual SCSI adapter so you can prepare to take a VIO server down for maintenance. Of course you can just take down the VIO server and the Virtual SCSI will failover to the other path, however it is generally more graceful and less impactful to use the chpath command to disable the path by lowering it's priority. Lets suppose we want to take down the "VIO2" server which on the AIX client maps back to vscsi1. If you are not sure which... [More]
Tags:  vscsi aix vio |
Check NIM connectivity to all your NIM clients
Here is a little one line script to check the status of all the NIM clients attached to a NIM server. It gets a list of the NIM clients, and for each one attempts to do a "lslpp" NIM operation which if successful verifies that the NIM server can connect and authenticate with the NIM client. If the lslpp operation is successful (return code 0), it shows "OK" next to the client, and if the operation fails it lists "Problem" next to the client. for srv in `lsnim -t standalone | awk... [More]
|
Updated Linux script to standardize UID and GID numbers
I've previously written some articles and scripts related to standardizing UID and GID numbers on AIX and Linux: Standardizing users UID and GID numbers on AIX (IBM developerWorks article) Standardizing users UID and GID numbers on Linux UNIX/Linux: Analyzing user/group UID/GID conflicts. Recently on Twitter, David Coronel pointed out that the script for Linux didn't work properly on older versions of Red Hat Enterprise Linux (RHEL)... [More]
|
Script to free up PP's across all hdisks in an AIX volume group
I'm a big fan of using AIX Scalable volume groups due to the fact that they are easy to use and have very few limitations. In my opinion, every volume group you create should be Scalable unless you have some kind of requirement to import the volume group in to a super old version of AIX. Unfortunately there are a lot of "Original" and "Big" volume groups out there. For more information about limitations of Original and Big volume groups, and a script to show you a report on your systems... [More]
Tags:  perl aix lvm |