- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script to display unavailable/stale lv's in vg...
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
10-11-2002 08:13 AM
10-11-2002 08:13 AM
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 08:17 AM
10-11-2002 08:17 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
vgdisplay -v | grep -i stale
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 08:18 AM
10-11-2002 08:18 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
vgdisplay -v /dev/vg0x | grep -i stale
HTH
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 08:19 AM
10-11-2002 08:19 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
vgdisplay -v |awk '$0 ~ /LV Name/ {lv=$3} $0 ~ /LV Status/ {print lv" "$4}' >/tmp/file1
while read lv status
do
COUNT=`lvdisplay -v /dev/vgNAME/$lv |grep stale |wc -l`
print $lv" "$COUNT" "$status
done
The read statement may need tuning or correcting.
Share and Enjoy! Ian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 08:24 AM
10-11-2002 08:24 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 08:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 08:44 AM
10-11-2002 08:44 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
Being that you haven't really explained why the answers provided aren't what you expected, then how about something like this:
vgdisplay -v | grep -i -e stale -e "LV NAME"
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 08:56 AM
10-11-2002 08:56 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 09:00 AM
10-11-2002 09:00 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 09:07 AM
10-11-2002 09:07 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
Being non-fluent (is that affluent?) in scripting myself, I'll just throw in a suggestion. How about a script that greps the vgdisplay output for stale (or any other "bad" state) and, if found, emails whomever a brief message to check machine fubar's lvol status because something's amiss?
Is that more what you had in mind?
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 09:08 AM
10-11-2002 09:08 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
Mike Kapsak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 09:15 AM
10-11-2002 09:15 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
Crude and quick:
#!/usr/bin/sh
vgdisplay -v| awk -v HOST=$(hostname) '/VG Name/ {VG=$3}
/VG Status/ {VSTA=$3}
/LV Name/ {LV=$3}
/LV Status/ {LSTA=$3;print HOST,VG,VSTA,LV,LSTA}
'
exit 0
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 09:23 AM
10-11-2002 09:23 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
#! /usr/bin/ksh
#
HOST=$(hostname)
print "$HOST\n"
for vg in $(vgdisplay|grep -E 'VG Name'|awk '{print $3}')
do
print "$vg\n"
VGSTAT=$(vgdisplay $vg|grep -E 'VG Status')
print "$VGSTAT\n"
LVSTAT=$(vgdisplay -v $vg|sed 's/^[ \t]*//'|grep -E 'LV Name|LV Status')
print "$LVSTAT\n"
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 09:27 AM
10-11-2002 09:27 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
here is one script which will help you .
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 09:28 AM
10-11-2002 09:28 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
You're summation is correct, but i don't know how to script it. The report would look like this and only report unavailable or stale, put it into cron at a given time, and mail anyone who wants it.
"System Name"
VGName VGStatus LVName LVStatus
Mike Kapsak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 10:10 AM
10-11-2002 10:10 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
if [ `vgdisplay -v |grep -i stale | wc -l` -gt 0 ]
then
echo "Server $hostname has an LVM issue" > file.oops
elm -s "Oops" joeblow@wherever.com < file.oops
fi
Good Luck,
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 11:22 AM
10-11-2002 11:22 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
The script looks simple enough. Now I need to work on making a volume stale in order to test.
Thank you,
Mike Kapsak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 11:37 AM
10-11-2002 11:37 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
There is a script available called lvmcollect that gives you a full overview of your lvm system
You can get a copy on the last reply from Patrick in this thread
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xf33fec08252fd611abd50090277a778c,00.html
HTH
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2002 04:08 AM
10-13-2002 04:08 AM
Re: script to display unavailable/stale lv's in vgdisplay -v output
For my own testing purposes, I grepped for "syncd" rather than stale. There's a lot of "syncd" lvols out there.
Pete
Pete