#!/usr/bin/perl -w # # Author: David Morris # Purpose: print metadevice information where status of metadevice is not "Okay" # Version: # OS: Solaris Only # $Id: metamon,v 1.2 2004/07/20 20:51:54 davey Exp $ use strict; #use Data::Dumper; my $PATH = "/usr/sbin"; #my $METASTAT = "$PATH/metastat"; my $METASTAT = "cat /tmp/metastat.out"; # Use this for testing my @metastat; open (MS, "$METASTAT |"); { local $/ = ""; @metastat = ; } close MS; foreach (@metastat) { local $/ = "\n"; my @metadevice = split /\n/, $_; if ( ! /State: Okay/ and ! /Device Relocation/ ) { #print "($_)\n"; print "$metadevice[0] $metadevice[1]\n"; } }