Networker

[Networker] Deleting "Ghost" Clients

2003-01-13 20:03:36
Subject: [Networker] Deleting "Ghost" Clients
From: "Simon Ward(iD)" <CIOSA1 AT BRISBANE.QLD.GOV DOT AU>
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Date: Tue, 14 Jan 2003 11:03:12 +1000
Hi,
    I have been working on a dual network server/client setup and have created 
a number of virtual clients based on the actual host name and on aliases. Had 
some interesting results. Backups working, but index cycles going in a variety 
of places based on whether I use the production network or private backup 
network, but that is a side issue that I would like cleared up at some time, 
but for now I just want to remove all the client entries, including the aliases 
from the index. I found another posting that refers to this issue and used the 
functional perl script to remove all the ssid's associated with the client and 
it's aliases. This ran with no errors and I deleted the index directories after 
the script ran.

The script is at the end of this posting for anyone who is interested.

    What I am left with is an index that when viewed using nwadmin from a Win2k 
system shows no trace of the client or it's aliases and looks as I would have 
expected after the cleanup, but when viewed with the X based i/face they still 
show up as entries, but have no cycles in them - they are null entries and are 
names only.

What else must I do to get rid of them or is it OK the to continue? I am 
running 6.1.2 on a unix server with 6.1.2 nwadmin on Win2K.

Thanks,
Simon

Here are the directions I followed and the script that was with it from Tim 
Mooney

* Make sure the client's name still resolves to an IP address.  Put something
in a hosts file, or a CNAME in DNS.  It doesn't matter.  NetWorker will
complain otherwise.
* Remove all savesets belonging to the client.  I look for both short names
and FQDN's.
* Remove SSID's for the client indexes from the NetWorker server (again, I
look for both short and long names).
* Delete the client from NetWorker.
* Physically remove the client's index from the server.
* Remove the client from DNS, WINS, whatever, if necessary.
* An nsrim -X probably won't hurt at this point. :-)

 
#!/bin/perl
#This script gets rid of old backups for a client that is to be removed.
#This script must be run before the client resource is deleted.

$| = 1;   # Don't do any internal buffering

$PATH = '/nsr'; #This is where NetWorker lives
$INDEX = "$PATH/index"; #Index directory
$BIN  = "/usr/opt/networker/bin";  #Executables
$DOMAIN = "bcc.qld.gov.au"; #Our domain

#Get the client name from the command line.

$client = shift;  #Assume that the short name for the client was given.

#Define an array of possible saveset sources.

@savesets = ("$client -r ssid",  #Short name
     "$client.$DOMAIN -r ssid", #Long name
     "$client-feac -r ssid", #Long name
     "$client-corc -r ssid", #Long name
     "$client-gb -r ssid", #Long name
     "nsrhost -N $INDEX/$client -r ssid",  #Backup of indexes
     "nsrhost -N $INDEX/$client.$DOMAIN -r ssid"); #Savesets of indexes

#Get a list of all possible backed up savesets, and save them for later 
deletion.

$total = 0;
foreach $saveset(@savesets) {
    $count=0;
    print "Getting ssid's using $saveset ... ";

    open INDEX, "$BIN/mminfo -avc $saveset |";

    while(<INDEX>) {
        next if /^\s*$/;  #Skip blank lines
        s/\s+//;   #Remove blanks.
        chomp;
        unless(defined $ssids{$_}) {
            $ssids{$_} = $saveset; #Save the ssid.
            $count++;
            $total++;
            next;
        }
        print "SSID $_ was previously found in $ssids{$_}.\n";
    }

    close INDEX;
    print "Found $count\n";
}

print "\nTotal SSID's found=$total\n\n";

#Get rid of all the ssid's.  There's no reason to check for errors.  None are
#returned.

print "\nGetting rid of the $count ssid's.\n";

$left = $total;
foreach $ssid(sort {$b <=> $a} keys %ssids) {
    print "Removing $ssid ... ";
    print qx($BIN/nsrmm -dyS $ssid);
#    print "$BIN/nsrmm -dyS $ssid";
    $left--;
    print "Done.  $left to go.\n";
}

print "\nThat's all, folks!\n";
exit;


Simon Ward
System Administrator
Unix Support
iDivision
Brisbane City Council

Phone: 07 3403 5587
Fax:      07 3403 6875
ciosa1 AT brisbane.qld.gov DOT au


This mail has passed through an insecure network.  
All enquires should be directed to the message author.

--
Note: To sign off this list, send a "signoff networker" 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>