Networker

Re: [Networker] getting a text list of clients out of Networker

2002-09-17 13:43:44
Subject: Re: [Networker] getting a text list of clients out of Networker
From: Joseph McDonald <joem AT UU DOT NET>
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Date: Tue, 17 Sep 2002 13:43:38 -0400
Nice one. Here it is in perl returning a uniq list of clients:

 #!/usr/local/bin/perl

 use strict;

 my (%seen, @uniq);
 my $com = "show name" . "\n" . "print type:NSR client";
 my @command = `echo \"$com\" | nsradmin -i -`;

 for my $item (@command) {
    push(@uniq, $item) unless $seen{$item}++;
 }

 for (@uniq) {
    chomp ;
    s/\s+name: //;
    s/\;/\n/;
    print;
 }

        --joey



Davina Treiber said:
>
> On Tue, 17 Sep 2002 10:20:58 -0400, Paul Crossman <pcrossma AT WILDFIRE DOT 
> COM>
> wrote:
>
> >Is there a way to get a list of clients out of networker?
>
> Sure. My script goes like this:
>
> #!/bin/ksh
> echo "show name
> print type:NSR client" | nsradmin -i - | sed 's/name: //
> s/ //g
> s/;//' | grep -v "^$"
>
> --
> Note: To sign off this list, send a "signoff" command via email
> to listserv AT listmail.temple DOT edu or visit the list's Web site at
> http://listmail.temple.edu/archives/networker.html where you can
> also view and post messages to the list.
> =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
>

--
Note: To sign off this list, send a "signoff" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

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