Networker

[Networker] Shellscript showing the pools of Networker clients - AW: [Networker] nsradmin query for empty strings

2005-10-20 10:45:27
Subject: [Networker] Shellscript showing the pools of Networker clients - AW: [Networker] nsradmin query for empty strings
From: IT-Administration ST <admin.st AT KVBAWUE DOT DE>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Thu, 20 Oct 2005 16:31:41 +0200
Hello dear fellow-networkers,

I want to thank Conrad Macina for his vote.  My intention was not only be 
someone asking for help but also be someone whos shares resp. offers well 
working solutions. Due to this intention I'm adding a solaris shellscript which 
at least on our system shows the pools of Networker clients as AFAIK Networker 
itself doesn't provide any tool which would do this. 

#-------------------------------------------------------------
   file_out=/tmp/networker-cp.txt                             
#-------------------------------------------------------------
   cg=`echo " . type:nsr client                               
              show name;group                                 
              print"          |                               
   nsradmin -i -  |                                           
   nawk ' { if ( $0 ~ "name:" )                               
             printf ("\n%30-s", substr($2,1,length($2)-1 ))   
            else                                              
             printf (" %30-s", substr($2,1,length($2)-1 ))    
          } ' |                                               
   grep "[A-Z,a-z]" |                                         
   sed 1d`                                                    
#-------------------------------------------------------------
   echo "$cg" |                                               
   while read line                                            
   do                                                         
       client=`echo $line | nawk ' { printf ("%s",$1 ) } '`   
       group=`echo $line | nawk ' { printf ("%s",$2 ) } '`    
       pool=` echo " . groups: $group                         
              show name                                       
              print" |                                        
              nsradmin -i - |                                        
              sed 1d`                                                
       echo "$client $pool"                                   
   done |                                                     
   grep -v "No resources found for query" |                   
   grep -v "groups:"                      |                   
   grep -v "type:"                        |                   
   sort -u > $file_out                                        
#-------------------------------------------------------------
   cat $file_out |                                            
   nawk ' BEGIN { nextclient = "hello" }                      
                {                                             
                  thisclient = $1                             
                  if  ( thisclient !~ nextclient )            
                   {                                          
                      printf ("\n%20-s : ", $1)               
                   }                                          
                  printf ("%s ",$3 )                          
                  nextclient=thisclient                       
                } ' |                                         
   pg                                                         
#-------------------------------------------------------------

The output could be something like this:

client1              : pool1; pool2_for_databases; pool3_for_logfiles
client2              : pool3_for_logfiles; pool4; pool5
client3              : pool1; pool6; pool7



     Freundliche Grüße / Kind regards

   Roman Böhm



 

 >-----Ursprüngliche Nachricht-----
 >Von: Legato NetWorker discussion 
 >[mailto:NETWORKER AT LISTSERV.TEMPLE DOT EDU] Im Auftrag von Conrad Macina
 >Gesendet: Donnerstag, 20. Oktober 2005 12:28
 >An: NETWORKER AT LISTSERV.TEMPLE DOT EDU
 >Betreff: Re: [Networker] nsradmin query for empty strings
 >
 >With all due respect, I must disagree. I think this list is 
 >an appropriate place to post hints/tips/reminders. Those who 
 >already know the topic can just hit NEXT or DELETE as they do 
 >with the occasional out-of-office message. I personally find 
 >it refreshing to read the occasional post that isn't asking 
 >for help with a problem.
 >
 >Conrad Macina
 >Pfizer, Inc.
 >
 >
 >On Wed, 19 Oct 2005 14:10:53 +0100, Davina Treiber 
 ><DavinaTreiber AT PEEVRO.CO DOT UK> wrote:
 >
 >>IT-Administration ST wrote:
 >>> Hello dear fellow-networkers,
 >>>
 >>> getting more and more familiar with nsradmin I discovered 
 >a way how 
 >>> to do
 >a nsradmin query for empty strings. This I would like to 
 >share with you.
 >>>
 >>> Example for Solaris:
 >>>
 >>>    echo " . type: nsr client; remote access:\nshow name\nprint" |
 >nsradmin -i - | pg
 >>>
 >>> This query will show the names of every nsr client where nothing is
 >assigned  to "remote access".
 >>
 >>It's good to see that you are learning so much about nsradmin, but a 
 >>lot of people on this list already know nsradmin very well. 
 >It might be 
 >>more appropriate to add your handy tips to the NetWorker FAQ rather 
 >>than posting them to the list. The address is in the footers 
 >of every posting.
 >>
 >>To sign off this list, send email to 
 >listserv AT listserv.temple DOT edu and 
 >>type
 >"signoff networker" in the
 >>body of the email. Please write to 
 >>networker-request AT listserv.temple DOT edu if
 >you have any problems
 >>wit this list. You can access the archives at
 >http://listserv.temple.edu/archives/networker.html or
 >>via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER
 >>=============================================================
 >==========
 >>==
 >
 >To sign off this list, send email to 
 >listserv AT listserv.temple DOT edu and type "signoff networker" in 
 >the body of the email. Please write to 
 >networker-request AT listserv.temple DOT edu if you have any 
 >problems wit this list. You can access the archives at 
 >http://listserv.temple.edu/archives/networker.html or via RSS 
 >at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER
 >

To sign off this list, send email to listserv AT listserv.temple DOT edu and 
type "signoff networker" in the
body of the email. Please write to networker-request AT listserv.temple DOT edu 
if you have any problems
wit this list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

<Prev in Thread] Current Thread [Next in Thread>
  • [Networker] Shellscript showing the pools of Networker clients - AW: [Networker] nsradmin query for empty strings, IT-Administration ST <=