- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: I need a simple shell program!
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
Forums
Discussions
Discussions
Discussions
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
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
08-16-2004 07:18 PM
08-16-2004 07:18 PM
I need a simple shell program!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2004 07:58 PM
08-16-2004 07:58 PM
Re: I need a simple shell program!
See if this works for you:
#!/usr/bin/ksh
var1=`lvdisplay /dev/vg00/lvol4 | grep Status | awk '{ print $3 }'`
if [ $var1 -ne "stale" ]
then
echo " LV is fine "
else
echo " LV in Error "
fi
Modify it as per your requiremnt.
Regards,
ps.Remember in var1 assignment i have used back quotes at the begining and end.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2004 08:04 PM
08-16-2004 08:04 PM
Re: I need a simple shell program!
you can try
lvdisplay /dev/vgxx/lvolx | egrep "(LV Status|IO Timeout)"
(where x should be replaced by the number)
Regards
Franky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2004 08:10 PM
08-16-2004 08:10 PM
Re: I need a simple shell program!
vgdisplay | grep -E 'Name |Status'
VG Name /dev/vg00
VG Status available
VG Name /dev/vgscu
VG Status available
It will give you the full status of all volume groups to keep track
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2004 12:00 AM
08-17-2004 12:00 AM
Re: I need a simple shell program!
try the attached script; you might need to adapt it.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2004 12:34 AM
08-17-2004 12:34 AM
Re: I need a simple shell program!
#!/bin/sh
# Identifies and displays stale extends on all system volume groups.
# Useful to determine defect harddisks in mirrored enviroments
vgdisplay -v | awk '/LV Name/ { print $3 }' | xargs lvdisplay -v | grep -i -e "lv name" -e "lv status" -e stale -e '?'
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2004 01:55 AM
08-17-2004 01:55 AM
Re: I need a simple shell program!
# more volbuild
echo 'This script will build and create database space,
Please not you should know about how much disk space is required
and available.. Below is a listing of free space in existing
Volume Groups'
echo "Enter Enter District ID:"
read district
for vg in `grep "LV Name" vg.txt |awk '{print $3}' |grep dbs |grep -v vg00 |grep -v log |grep -v root |grep -v tmp |grep
$district`
do
vgrp=`lvdisplay $vg |grep "VG Name"|awk '{print $3}'`
echo -------- Logical Volume `lvdisplay $vg |grep "LV Name"` --------
lvdisplay $vg |grep "LV Name"
echo $vgrp
lvdisplay $vg |grep "LV Size"
vgdisplay $vgrp |grep Free
export dbspace=`lvdisplay $vg |grep "LV Name" |awk '{print substr($3, 11, 6)}'`
export vgrp=`lvdisplay $vg |grep "VG Name"|awk '{print $3}'`
export nvol=`lvdisplay $vg |grep "LV Name" |awk '{print substr($3, 17, 1)}'`
if [ -z "$nvol" ]
then export nvol=0
fi
export i=`expr $nvol + 1`
done
echo "Enter Size of Volume"
read size
export size
echo lvcreate -L $size -n $dbspace$i $vgrp
cd $vgrp
echo chown informix:informix r$dbspace$i
echo chmod 660 r$dbspace$i
export fname=r$dbspace$i
cd /dev/online
#
ls $fname
echo ln -s $vgrp/$fname $dbspace$i
echo onspaces -a $dbspace$i -p /dev/online/$fname -o 0 -s "$size"000