Veritas-bu

[Veritas-bu] Script to list servers

2006-04-11 10:28:49
Subject: [Veritas-bu] Script to list servers
From: ssesar AT mitre DOT org (Steven L. Sesar)
Date: Tue, 11 Apr 2006 10:28:49 -0400
This is a multi-part message in MIME format.
--------------020404000902010406020604
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Try this:

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

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

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

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

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

exit 0;


Hindle, Greg wrote:

> 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!
>
>
> Greg
>
>>>> 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
>  
>


-- 
===================================

   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

=================================== 


--------------020404000902010406020604
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Try this:<br>
<br>
#!/opt/openv/perl/bin/perl<br>
<br>
my $COMMAND = "/opt/openv/netbackup/bin/admincmd/bpclclients -allunique
-l";<br>
my @data;<br>
my %OS;<br>
my $TOTAL = 0;<br>
<br>
open CMD, "$COMMAND|" or die "Can't run $COMMAND: $?\n";<br>
<br>
while (&lt;CMD&gt;){<br>
&nbsp;&nbsp;&nbsp; chomp;<br>
&nbsp;&nbsp;&nbsp; @data = split " ";<br>
&nbsp;&nbsp;&nbsp; if ( $OS{$data[3]} ){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $OS{$data[3]}++;<br>
&nbsp;&nbsp;&nbsp; } else {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $OS{$data[3]} = 1;<br>
&nbsp;&nbsp;&nbsp; }<br>
}<br>
<br>
foreach my $client ( keys %OS ){<br>
&nbsp;&nbsp;&nbsp; printf "%15s%6d\n", $client, $OS{$client};<br>
&nbsp;&nbsp;&nbsp; $TOTAL += $OS{$client};<br>
}<br>
printf "\n%15s%6d\n", "Total", $TOTAL;<br>
<br>
exit 0;<br>
<br>
<br>
Hindle, Greg wrote:
<blockquote
 cite="mid4F0F4E3DDFE260468CAED8AD76361B3B4BC7FB AT EXM-MSW-11.Ceg.Corp DOT Net"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="MS Exchange Server version 6.5.7638.1">
  <title>Script to list servers</title>
<!-- Converted from text/rtf format -->
  <p><font face="Arial" size="2">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.</font></p>
  <p><font face="Arial" size="2">Thanks!</font>
  </p>
  <br>
  <p><font face="Times New Roman" size="2">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="moz-signature" cols="72">-- 
===================================

   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="moz-txt-link-abbreviated" href="mailto:ssesar AT mitre DOT 
org">ssesar AT mitre DOT org</a>

=================================== 
</pre>
</body>
</html>

--------------020404000902010406020604--

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