Veritas-bu

[Veritas-bu] drive script, help please

2005-01-06 11:38:49
Subject: [Veritas-bu] drive script, help please
From: Mark.Donaldson AT cexp DOT com (Mark.Donaldson AT cexp DOT com)
Date: Thu, 6 Jan 2005 09:38:49 -0700
I think you're overthinking this one:

vmoprcmd -d ds | awk '$1~/^[0-9]/ {if($3=="TL8"){print "Drive "$1" has an
exit of 0"}
                                   else{print "Drive "$1" has an exit of
1"}}'

Instead of exiting arbitrary "0" and "1", you could include the actual
status by change print "$3".

-M


-----Original Message-----
From: veritas-bu-admin AT mailman.eng.auburn DOT edu
[mailto:veritas-bu-admin AT mailman.eng.auburn DOT edu]On Behalf Of
ida3248b AT post.cybercity DOT dk
Sent: Wednesday, January 05, 2005 12:11 PM
To: Jason Helfman; Veritas-bu AT mailman.eng.auburn DOT edu
Cc: veritas-bu-admin AT mailman.eng.auburn DOT edu
Subject: Re: [Veritas-bu] drive script, help please


Hello Jason

You could use grep -v TL8 to get anything but TL8

Regards
Michael
On Wed, 05 Jan 2005 10:54:43 -0800, Jason Helfman wrote
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi.
> 
> I am trying to write a script that will give an exit of 1 for 
> anything other then TL8, and am having some issues. The problem is 
> that if one of our drives were to show up as AVR, it wouldn't be 
> assigned a numerical value. For the output, all of the drives are 
> TL8, execpt for drive 6, which is TL8-DOWN.
> 
> Thanks,
> Jason
> 
> Right now I have this.
> 
> #!/bin/bash
> for i in `seq 0 7`
> ~        do
> echo  "drive $i has and exit of:"      `vmoprcmd -d ds |tail +5 |awk
> '{print $1, $3}' |grep -i $i |awk '{print $2}' |sed
> 's/DOWN-TL8/1/;s/TL8/0/;'`
> done
> 
> It will output this:
> 
> drive 0 has and exit of: 0
> drive 1 has and exit of: 0
> drive 2 has and exit of: 0
> drive 3 has and exit of: 0
> drive 4 has and exit of: 0
> drive 5 has and exit of: 0
> drive 6 has and exit of: 1
> drive 7 has and exit of: 0
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
> 
> iD8DBQFB3DfzE8NXcvhlySYRAhPnAJ9//YJgX4yANtLqOL6BZuiHXVXtIgCfcn1G
> 2+vpS3I8oHaC2o+X2Vl1jXE=
> =gOK5
> -----END PGP SIGNATURE-----
> _______________________________________________
> Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
> http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu


--
Cybercity Webhosting (http://www.cybercity.dk)

_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu

<Prev in Thread] Current Thread [Next in Thread>