#!/usr/bin/perl -w $ENV{'PATH'} = '/bin:/usr/bin:/usr/local/sbin:/usr/openv/netbackup/bin +:/usr/openv/netbackup/bin/admincmd'; $ENV{'SHELL'} = '/bin/sh' if $ENV{'SHELL'} ne ''; $ENV{'IFS'} = '' if $ENV{'IFS'} ne ''; use Getopt::Std; use POSIX 'uname'; (undef, $Hostname, undef, undef, undef) = uname; ($::opt_t) = (); #avoid warning message getopts('t:'); $::SAFile = $::opt_t; if (! "$SAFile" ) { $FF = "24"; } else { $FF = "$SAFile"; } print "\nINFO: Processing NetBackup logs for last $FF hours...\n\n"; # List Netbackup Master and Media servers: # open(XYZ,"bpgetconfig |") || die "Cannot run bpgetconfig report\n"; print "NetBackup Master/Media server:\n"; while (<XYZ>) { print " $_" if grep(/^SERVER |^SERVER=/, $_); } # List Netbackup Master and Media servers: # open(VVV,"< /usr/openv/netbackup/version") || die "Cannot list NetBack +up version report\n"; print "NetBackup Version:\n"; while (<VVV>) { print " $_"; } close XYZ; close VVV; print "\n ImageID MediaID Fragment DriveIdx + Written Speed_Written\n"; print "--------------------------------------------------------------- +-------------------------------------\n\n"; open(FROM,"bperror -hoursago $FF | awk '/begin|wrote/ && ! /awk/ {prin +t}'|") || die "Cannot open bperror data"; while (<FROM>) { chomp; if (grep(/begin/, $_)) { undef $Line; undef $ImageID; undef @Image; undef @Frag; undef $DriveIndex; undef $Fragment; undef $MediaID; @Keyspaces = split(/,/, $_); @Image = split(/\s+/, $Keyspaces[0]); $ImageID = $Image[$NF - 1]; @Drive = split(/\s+/, $Keyspaces[$NF - 1]); $DriveIndex = $Drive[$NF - 1]; @Media = split(/\s+/, $Keyspaces[3]); $MediaID = $Media[4]; @Frag = split(/\s+/, $Keyspaces[2]); $Fragment = $Frag[$NF - 1]; $Line = sprintf ("%25s %8s %5s %5s", $ImageID, $M +ediaID, $Fragment, $DriveIndex); } if (grep(/wrote/, $_)) { undef $ImageID2; undef $KB_Written; undef $Speed_Written; @Kspaces = split(/,/, $_); @Image2 = split(/\s+/, $Kspaces[0]); $ImageID2 = $Image2[$NF - 1]; @Frag = split(/\s+/, $Kspaces[2]); $Fragment2 = $Frag[$NF - 1]; if ("$ImageID2" == "$ImageID") { if ("$Fragment2" == "$Fragment") { @Written = split(/\s+/, $Kspaces[3]); $KB_Written = "$Written[1] $Written[2] +"; $Speed_Written = "$Written[$NF -2] $Wr +itten[$NF - 1]"; $Line2 = sprintf("%-20s %15s", $KB_Wr +itten, $Speed_Written); print "$Line $Line2\n"; } } else { # print "\n ERROR: Missing \"begin writing +\" line for $ImageID2\n"; ; } } } close(FROM); exit(0);

In reply to Tapespeed.pl by JSchmitz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.