Veritas-bu

[Veritas-bu] Script to list servers

2006-04-11 10:30:48
Subject: [Veritas-bu] Script to list servers
From: Greg.Hindle AT constellation DOT com (Hindle, Greg)
Date: Tue, 11 Apr 2006 10:30:48 -0400
This is a multi-part message in MIME format.

------_=_NextPart_001_01C65D74.867D7D52
Content-Type: text/plain;
        charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

ok thanks will give it a try...
=20


Greg=20


________________________________

From: Steven L. Sesar [mailto:ssesar AT mitre DOT org]=20
Sent: Tuesday, April 11, 2006 10:29 AM
To: Hindle, Greg
Cc: veritas-bu AT mailman.eng.auburn DOT edu
Subject: Re: [Veritas-bu] Script to list servers


Try this:

#!/opt/openv/perl/bin/perl

my $COMMAND =3D "/opt/openv/netbackup/bin/admincmd/bpclclients =
-allunique
-l";
my @data;
my %OS;
my $TOTAL =3D 0;

open CMD, "$COMMAND|" or die "Can't run $COMMAND: $?\n";

while (<CMD>){
    chomp;
    @data =3D split " ";
    if ( $OS{$data[3]} ){
        $OS{$data[3]}++;
    } else {
        $OS{$data[3]} =3D 1;
    }
}

foreach my $client ( keys %OS ){
    printf "%15s%6d\n", $client, $OS{$client};
    $TOTAL +=3D $OS{$client};
}
printf "\n%15s%6d\n", "Total", $TOTAL;

exit 0;


Hindle, Greg wrote:=20

        Does anyone have a script to list the servers you backup and if
there are windows or UNIX based? I need to make a list for management
and thought somebody had to have a simple script that collects this
info.

        Thanks!=20


        Greg=20

        >>> This e-mail and any attachments are confidential, may
contain legal,
        professional or other privileged information, and are intended
solely for the
        addressee.  If you are not the intended recipient, do not use
the information
        in this e-mail in any way, delete this e-mail and notify the
sender. CEG-IP2
         =20



--=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

   Steven L. Sesar
   Senior Operating Systems Programmer/Analyst
   UNIX Application Services R101
   The MITRE Corporation
   202 Burlington Road - KS101
   Bedford, MA 01730
   tel: (781) 271-7702
   fax: (781) 271-2600
   mobile: (617) 893-9635
   email: ssesar AT mitre DOT org

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20

------_=_NextPart_001_01C65D74.867D7D52
Content-Type: text/html;
        charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D964363014-11042006><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>ok thanks will give it a =
try...</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV><!-- Converted from text/rtf format --><BR>
<P><SPAN lang=3Den-us><FONT face=3D"Times New Roman" size=3D2>Greg=20
</FONT></SPAN></P><BR>
<DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
<HR tabIndex=3D-1>
<FONT face=3DTahoma size=3D2><B>From:</B> Steven L. Sesar =
[mailto:ssesar AT mitre DOT org]=20
<BR><B>Sent:</B> Tuesday, April 11, 2006 10:29 AM<BR><B>To:</B> Hindle,=20
Greg<BR><B>Cc:</B> veritas-bu AT mailman.eng.auburn DOT edu<BR><B>Subject:</B> =
Re:=20
[Veritas-bu] Script to list servers<BR></FONT><BR></DIV>
<DIV></DIV>Try this:<BR><BR>#!/opt/openv/perl/bin/perl<BR><BR>my =
$COMMAND =3D=20
"/opt/openv/netbackup/bin/admincmd/bpclclients -allunique -l";<BR>my=20
@data;<BR>my %OS;<BR>my $TOTAL =3D 0;<BR><BR>open CMD, "$COMMAND|" or =
die "Can't=20
run $COMMAND: $?\n";<BR><BR>while (&lt;CMD&gt;){<BR>&nbsp;&nbsp;&nbsp;=20
chomp;<BR>&nbsp;&nbsp;&nbsp; @data =3D split " ";<BR>&nbsp;&nbsp;&nbsp; =
if (=20
$OS{$data[3]} ){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
$OS{$data[3]}++;<BR>&nbsp;&nbsp;&nbsp; } else=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $OS{$data[3]} =3D=20
1;<BR>&nbsp;&nbsp;&nbsp; }<BR>}<BR><BR>foreach my $client ( keys %OS=20
){<BR>&nbsp;&nbsp;&nbsp; printf "%15s%6d\n", $client,=20
$OS{$client};<BR>&nbsp;&nbsp;&nbsp; $TOTAL +=3D =
$OS{$client};<BR>}<BR>printf=20
"\n%15s%6d\n", "Total", $TOTAL;<BR><BR>exit 0;<BR><BR><BR>Hindle, Greg =
wrote:=20
<BLOCKQUOTE=20
cite=3Dmid4F0F4E3DDFE260468CAED8AD76361B3B4BC7FB AT EXM-MSW-11.Ceg.Corp DOT Net 
=

type=3D"cite">
  <META content=3D"MS Exchange Server version 6.5.7638.1" =
name=3DGenerator><!-- Converted from text/rtf format -->
  <P><FONT face=3DArial size=3D2>Does anyone have a script to list the =
servers you=20
  backup and if there are windows or UNIX based? I need to make a list =
for=20
  management and thought somebody had to have a simple script that =
collects this=20
  info.</FONT></P>
  <P><FONT face=3DArial size=3D2>Thanks!</FONT> </P><BR>
  <P><FONT face=3D"Times New Roman" size=3D2>Greg</FONT> =
</P><PRE>&gt;&gt;&gt; This e-mail and any attachments are confidential, =
may contain legal,
professional or other privileged information, and are intended solely =
for the
addressee.  If you are not the intended recipient, do not use the =
information
in this e-mail in any way, delete this e-mail and notify the sender. =
CEG-IP2
  </PRE></BLOCKQUOTE><BR><BR><PRE class=3Dmoz-signature cols=3D"72">--=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

   Steven L. Sesar
   Senior Operating Systems Programmer/Analyst
   UNIX Application Services R101
   The MITRE Corporation
   202 Burlington Road - KS101
   Bedford, MA 01730
   tel: (781) 271-7702
   fax: (781) 271-2600
   mobile: (617) 893-9635
   email: <A class=3Dmoz-txt-link-abbreviated =
href=3D"mailto:ssesar AT mitre DOT org">ssesar AT mitre DOT org</A>

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20
</PRE></BODY></HTML>

------_=_NextPart_001_01C65D74.867D7D52--

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