bluethundr has asked for the wisdom of the Perl Monks concerning the following question:
But it keeps throwing this error:#!/usr/bin/perl use strict; use warnings; #`/bin/echo "SNMP 3PAR DISK STATS start executed on: `date +%D' at '%l +:%M:%S`" >> /var/log/snmp-3par-disk-stats.log` push my @vluns,`ssh -l gmon 3par-S400 statvv -ni | awk '{print $1 }'`; foreach my $vlun (@vluns) { if ($vlun ne "Press") { print "$vlun \n"; } else { last; } } push my @vluns2,`ssh -l gmon 3par-E200 statvv -ni | awk '{print $1 }'` +; foreach my $vlun2 (@vluns2) { if ($vlun2 ne "Press") { print "$vlun2 \n"; } else { last; } }
It seems that it is choking on the $1 that I am passing to awk. I could use some help passing the right variable. Also this is a sample of the text I am trying to parse:[gmon@cc126-200 ~]$ ./3par-disk-stats.pl Use of uninitialized value in concatenation (.) or string at ./3par-di +sk-stats.pl line 7.
And this is the output I would like to omit at the end:Press 16:34:19 VVname mgmain_data mgnote01_redo1 mgnote01_redo2 mgtool02_data_110G mgtool02_redo1_3G mgtool02_redo2_3G mgnote01_data_85G rcat11_data racprod_redo1a_tpvv racprod_redo1b_tpvv
But most importantly I am looking for a way to exit when it hits the output "press the enter key to stop..." I'd certainly appreciate any guidance the wise monks may have, here. Thanks!---------------------------------------------------------------------- +--------------------- total t 5766 5777 601349 585394 8.4 + 8.6 104.3 101.3 67 Press the enter key to stop...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 3par data acquistion
by Fletch (Bishop) on Aug 16, 2010 at 21:22 UTC | |
|
Re: 3par data acquistion
by BrowserUk (Patriarch) on Aug 16, 2010 at 22:14 UTC | |
|
Re: 3par data acquistion
by callmeavis (Novice) on Aug 16, 2010 at 21:42 UTC | |
by bluethundr (Pilgrim) on Aug 17, 2010 at 16:03 UTC | |
by callmeavis (Novice) on Aug 17, 2010 at 16:39 UTC | |
by bluethundr (Pilgrim) on Aug 23, 2010 at 17:18 UTC | |
by callmeavis (Novice) on Aug 27, 2010 at 18:26 UTC | |
|
Re: 3par data acquistion
by Monkeh (Initiate) on Aug 18, 2010 at 05:18 UTC |