- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script help
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2004 05:29 PM
тАО05-05-2004 05:29 PM
I am writing a script to check the quality of the media in my omniback.
POOL=$(omnimm -media_info $RESULT | awk 'NR > 3 {print $3}')
QUALITY=$(omnimm -list_pool $POOL | grep -i $RESULT | awk '{print $1}')
However due to the length of my media pool, I won't be able to get the correct output.
For example, same media due to the column width problem _DDS was cut off. If I use "-detail" option I find it difficult to grep out the media pool name.
omnimm -media_info ESC_PBP_ARC_THU -detail
MediumID : ac1e1e1c:3d0d5c27:6672:0001
Pool name : PBP_SAP_Archive_DDS
Library :
Medium Label : ESC_PBP_ARC_THU
Location :
Used blocks : 309824
Total blocks : 40960000
Number of writes : 2
Number of overwrites : 85
Number of errors : 0
Creation time : Mon Jun 17 11:48:55 2002
Time of last write : Thu May 6 11:31:20 2004
Time of last overwrite : Thu May 6 11:30:19 2004
Time of last access : Thu May 6 12:47:20 2004
Medium type : HASNOCOPY
omnimm -media_info ESC_PBP_ARC_THU
Medium Label Medium ID Pool Library
===============================================================================
ESC_PBP_ARC_THU ac1e1e1c:3d0d5c27:6672:0001 PBP_SAP_Archive
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2004 06:03 PM
тАО05-05-2004 06:03 PM
Re: script help
using perl this would look something like:
(untested!)
perl media-check.pl $RESULT
where media-check.pl would be
-----
$result = shift or die "please specify result";
foreach $_ (`omnimm -media_info $result -detail`) {
if (/^Poolname:(\w+)/) {
$pool = $1;
last;
}
}
foreach $_ (`omnimm -list_pool $pool`){
if (/$result/i) {
@words=split;
print "$words[0]\n";
last;
}
}
-----
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2004 06:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2004 07:05 PM
тАО05-05-2004 07:05 PM
Re: script help
It work but it put one more space character in the front
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2004 10:09 PM
тАО05-05-2004 10:09 PM
Re: script help
omnirpt -tab -ascii -report media_list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2004 02:03 AM
тАО05-06-2004 02:03 AM
Re: script help
> It work but it put one more space character in the front
That's proably because it is hard to judge in the forum listing whether there are supposed to be spaces around the ":" on the -detail report lines or not. If there are spaces, then you do not need ":" as seperator and the example from Tamil becomes:
POOL=$(omnimm -media_info $RESULT | awk '/^Pool/{print $4}')
THis looks for a line beginning with (^) "Pool" and prints the 4th field. The first field would be "pool", the second "name", the 3th ":" and the name itself #4
Because the name is the last field you can also not worry about coutnign fields yoursef and use:
POOL=$(omnimm -media_info $RESULT | awk '/^Pool/{print $NF}')
NF = number of fields