Networker

Re: [Networker] mminfo not equal query

2004-04-07 07:29:10
Subject: Re: [Networker] mminfo not equal query
From: "Faidherbe, Thierry" <thierry.faidherbe AT HP DOT COM>
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Date: Wed, 7 Apr 2004 13:28:55 +0200
Davina,

I have already bypassed that ****** space issue in my reporter by
inserting 
a newline between each reported fields like :

mminfo .... -r "pool,newline,volume,newline,barcode,newline" 

reported ourput will be :

C:\>mminfo -s server -r "pool,newline,volume,newline,barcode,newline"
 pool
 volume
 barcode

TRU64 UNIX
UNX050


(for pool=TRU64 UNIX, Volume=UNX050, Barcode="")

just skip the amount of line  corresponding to field headers 
then start storing data :


    my $cmd = "mminfo -s ${BACKUP_SERVER} -av -q \"savetime\>=-1 day \" 
       -r \"pool,newline,volume,newline,barcode,newline\"";

    open(REPORT,"$cmd |" ) ;
    $daily_count=0;
    $skip_header = 1;
    while (<REPORT>) {
        chop;
        print $_ if $debug ;
        if( $skip_header ) {
            if( $_ eq "" ) {
                $skip_header = 0;
            }
            next;
        }

        #remove all spaces before and after the field from $_
        s/^\s+//;
        s/\s+$//;
        $daily_count++;
        print $count if $debug ;
        if ($daily_count == 1) {$h_pool = $_}
        if ($daily_count == 2) {$h_volume = $_}
        if ($daily_count == 3) {$h_barcode = $_}
        if ($daily_count == 4) {
              $daily_count=0;
              #start processing here ....
        }
   }
   close REPORT;

Doing so, you will always get 1 field a line and no problem for spaces.

Hope this helps,

Thierry


Kind regards - Bien cordialement - Vriendelijke groeten,

Thierry FAIDHERBE

HP Services - Storage Division
Tru64 Unix and Legato EBS Consultant
                                   
 *********       *********   HEWLETT - PACKARD
 *******    h      *******   1 Rue de l'aeronef/Luchtschipstraat
 ******    h        ******   1140 Bruxelles/Brussel/Brussels
 *****    hhhh  pppp *****   
 *****   h  h  p  p  *****   100/102 Blv de la Woluwe/Woluwedal
 *****  h  h  pppp   *****   1200 Bruxelles/Brussel/Brussels
 ******      p      ******   BELGIUM
 *******    p      *******                              
 *********       *********   Phone :    +32 (0)2  / 729.85.42   
                             Mobile :   +32 (0)498/  94.60.85 
                             Fax :      +32 (0)2  / 729.88.30   
     I  N  V  E  N  T        Email :    thierry.faidherbe AT hp DOT com
                             Internet : http://www.hp.com/ 
________________________________________________________________________

MOBISTAR SA/NV 

SYSTEM Team Charleroi, Mermoz 2 Phone : +32 (0)2  / 745.75.81  
Avenue Jean Mermoz, 32          Fax :   +32 (0)2  / 745.89.56  
6041 GOSSELIES                  Email : tfhaidhe AT mail.mobistar DOT be
BELGIUM                         Web :   http://www.mobistar.be/
________________________________________________________________________

 

-----Original Message-----
From: Legato NetWorker discussion [mailto:NETWORKER AT LISTMAIL.TEMPLE DOT EDU]
On Behalf Of Davina Treiber
Sent: Tuesday, April 06, 2004 8:32 PM
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Subject: Re: [Networker] mminfo not equal query

Faidherbe, Thierry wrote:
> Without any reporting param, mminfo provides lastest 24 hours
> backups, including volume, client, date, size, level and name.
>
> So why not just reformulate mminfo query like :
>
> mminfo -r pool,volume,client,sscreate,totalsize,level,name
> and then grep-exclude pool you do not need ?
>
>
> mminfo -r pool,volume,client,sscreate,totalsize,\
>    level,name |grep -v "^<past poolname here>"

Well I could do it that way but there are complications. It's in a perl
script for a start. Piping the command into a grep is a bit messy,
although I could let perl do the filtering ( next if /Offsite/; ). Also,
some of my pool names have spaces in them. Yes I know that's poor style
but the spaces were there before I arrived. On top of that the query
will contain another field with spaces in - the save set name. So my
current code that does something like:

($nsavetime,$level,$totalsize,@name) = split;

will have to become a bit more complicated if the pool is in there too.

--
Note: To sign off this list, send a "signoff networker" command via
email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

--
Note: To sign off this list, send a "signoff networker" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

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