1829905 Members
1502 Online
109993 Solutions
New Discussion

Saving Sam's list

 
SOLVED
Go to solution
MSwift
Regular Advisor

Saving Sam's list

Anyone know how to save the contents of SAM into a file? For ex. when you go into disks and filesystems> logical volumes (there are say 50 of them , you wont be able to see them all in a single screen. how do i get all this list into a file or a single snaphot in the format that is shown in SAM?

Thanks

Mike
4 REPLIES 4
Gokul Chandola
Trusted Contributor
Solution

Re: Saving Sam's list

Hi,
Run the following command.
#script /tmp/temp2.txt

then you run command, you will get all in this file when you will ..

#exit

Check file /tmp/temp2.txt, everything you will find in this file.

Try this may be you will get solution.

Regards,
Gokul Chandola
There is always some scope for improvment.
Mel Burslan
Honored Contributor

Re: Saving Sam's list

script is a solution all right but with formatted outputs like that of SAM, it is a bit of a hassle to get *usable* text out of it.

better way to do this is:

after you list the contents of your disks and what not, go to options menu and select View SAM Log. In this list, the lines starting with * or ---- are informational lines. Commands start with / followed by a path to the command running. Look at the last few commands and figure out which one is giving you the output you are looking at. As a root user, execute this command and redirect the output to a file. Now you have a clean (formatting free) version of the SAM output in the file you redirected the output to.

Hope this helps
________________________________
UNIX because I majored in cryptology...
Alzhy
Honored Contributor

Re: Saving Sam's list

If you're only after a listing of PVs or Disks in SAM, then you don't even need SAM for that. The following will list all disks seen:

---cut here---
#/bin/ksh
cat <
Disk Summary for `hostname`
version 1.0


HP-UX Disk Device Vendor Type Size(Kb)
--------------------------------------------------------------------
HEAD
ioscan -kfnC disk|awk 'NR>2 {print $NF}'|grep -iv SUBSYSTEM|grep rdsk|while read
disk;do
diskinfo $disk>/tmp/diskinfo.$$ 2>/dev/null
[ $? -eq 1 ] && continue
vendor=`cat /tmp/diskinfo.$$|grep vendor:|awk -F: '{print $NF}'`
type=`cat /tmp/diskinfo.$$|grep id:|awk -F: '{print $NF}'`
size=`cat /tmp/diskinfo.$$|grep size:|awk '{print $2}'`
[ $size -eq 0 ] && continue
printf "%-22s %-12s %-20s %9d\n" $disk "$vendor" "$type" $size
done
[ -f /tmp/diskinfo.$$ ] && rm /tmp/diskinfo.$$

--end cut--

Hakuna Matata.
Ganesan R
Honored Contributor

Re: Saving Sam's list

Hi MSwift,

Yes. There is a option. Once you get into the desired section of SAM goto File -> Print -> selcet as File ->give the filename to save(Ex:/tmp/lvnames.txt

Content will be saved in the above file. You can view all the lvnames
Best wishes,

Ganesh.