Languages and Scripting
Showing results for 
Search instead for 
Did you mean: 

FREE PERL SCRIPT: Audit of PVs on HP-UX 11.31

Honored Contributor

FREE PERL SCRIPT: Audit of PVs on HP-UX 11.31



History of the Perl script. Several weeks ago, one of the colleagues was looking for a way to document

PV/LUNs on HP-UX 11iv3 that would contain information about their serial numbers, WWNs, and even location

of the storage (for example, is the PV/LUN coming from a remote site)...


I wrote a simple script and I think it can do the job :) Quite on purpose, I decided not to use any special Perl

modules (because most of HP-UX servers would not have them by default), or additional tools like "xpinfo",

"evainfo" (because lot of sites Would not have them installed too). I used native HP-UX 11iv3 commands like

vginfo, lvlist, ioscan, pvdisplay, and scsimgr.


Here is how you to use it:


    USAGE HP-UX-11iv3-list-disks [-h] -f conffile [-l "location"] [> myserv.csv]


      -h                       Print this help message

      -f conffile          Lookup disk parameters from a config file

      -l "location"      Site location of the local server

                                (use double quotes if location name contains whitespaces)


Typical process to set everything up:


a) Create configuration file "myconf.txt" with the contents like this:


ZU3VLF29SZM5C8 = "DS Site1"

7VB36XM = "DS Site2"

RKMU4A29SZM4T0AFV77648CZ = "SWC Site2"

9AN52C1 = "XP Site3"

pp796a29Szm4t0afvkb72dan0021zk = "EVA Site4"

46F73DS = "XP Disaster Recovery Site5"


Put PVs' serial numbers that you want to audit their locations. Not necessary to list serial numbers for all

PVs - entirely personal choice...


The hex numbers on the left-hand side of the equal sign are PV/LUN serial numbers, obtained via

"scsimgr get_info -D <disk>" command.


DS, SWC, XP, EVA... define the storage type, and the rest of the string on the right-hand side define the PVs'

physical site location (for example, "Site2", "Disaster Recovery Site5", and so on).


In this specific case, "DS" storage type contains LUN numbers in the last four characters of the PVs' serial

number and all other storage types have LUNs defined as last four characters of their WWNs.

Change it if the rule in your environment is different.


The names of storage types (DS, XP, EVA,...) are entirely personal choice and each customer can choose their

own ones!


b) Run script (assuming your HP-UX server is located at site "Site1"):


# -f /somedir/myconf.txt –l Site1 > myserv.csv


c) Go to your PC and import data from text file "myserv.csv" file into Excel spreadsheet (ensure that you use

semicolon as separator!). Save the file under name, say, "myserv.xlsx".


As always, blame me for any errors.


VK2COT - Dusan Baljevic
Regular Advisor

Re: FREE PERL SCRIPT: Audit of PVs on HP-UX 11.31


I'm not sure if I miss an attachment due to the new forum's or a link to your site but where is actually the script? 


Wild guess from your older posts:


Thanks a lot for the contribution and even without testing it will work great and will be useful.




How to assign points on this new forums --> Kudos - what, where, how, and why!
How to find the right forum --> New forum location by ITRC tree

"we wouldn't call it code, if we could read it ..."