Networker

Re: [Networker] List of clients

2010-05-21 10:52:47
Subject: Re: [Networker] List of clients
From: Tim Mooney <Tim.Mooney AT NDSU DOT EDU>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Fri, 21 May 2010 09:49:29 -0500
In regard to: [Networker] List of clients, *jess* said (at 4:54am on May...:

Hi all,

Tried to spool a list of clients from nsradmin.

nsradmin> print type: nsr client; storage nodes: klmsa054b

But this command gives me all the details for all clients. Not sure how
can I get only the client name.

$which nsr_clist
nsr_clist is a function
nsr_clist () {
    if test $# -ne 0; then
        echo "usage: nsr_clist";
        return 1;
    else
        temp=`mktemp /tmp/nsrpr.XXXXXX`;
        echo 'option Dynamic' > $temp;
        echo 'option Hidden' >> $temp;
        echo "print type: NSR Client;" >> $temp;
        nsradmin -i $temp | egrep 'name:' | egrep -v 'hostname:|NDMP array
name:' | awk '{ print $2 }' | sed -e 's/;//g' | sort -u;
        rm -f $temp;
    fi
}



Note that "option Dynamic" and "option Hidden" really aren't needed for
this operation, but it's boilerplate that I use for several of my shell
functions or scripts related to listing things within NetWorker.

Tim
--
Tim Mooney                                             Tim.Mooney AT ndsu DOT 
edu
Enterprise Computing & Infrastructure                  701-231-1076 (Voice)
Room 242-J6, IACC Building                             701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

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 with 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