Fixing NetWorker client id corruption using nsrclientfix?
With the introduction of NetWorker 8 comes a new command
nsrclientfix command is used for the analysis of the media database to look for client id corruption. It can also merge clients together in both the resource database and the media database.
|Solaris, UNIX, Linux||Should be already included on any of the NetWorker versions (8.0.3, 8.1.1 and 8.2)|
|Windows||To get the
Backup the resource and media database.
nsrclientfix command will make changes to both the media and configuration databases. In case there are any problems or mistakes, having a backup of both databases is strongly recommended.
- Shutdown the NetWorker daemons on the NetWorker server
- Make sure all daemons are down
ps -ef | grep nsr
tasklist | findstr nsr
- Start the NetWorker daemons
Identify which clients have clientid problems
To report clients with clientid problems on a NetWorker server (this command will only report findings, no action will be taken):
nsrclientfix -a - -p
root@nwsvr# nsrclientfix -a - -p smurf, smurf.lab <-- One or more clients schlumpf <-- One client localhost <-- One client
The file read in and output are of the same format. The file consists of a comma separated list of clients separated by newlines. The number of clients on the line represents the actions taken.
Create a text file with the list of clients to be corrected by
nsrclientfix -a <file> -p
This command won't take any corrective action. It will just create the text file used by
nsrclientfix to correct the problems.
root@nwsvr# nsrclientfix -a text1 -p smurf, smurf.lab schlumpf localhost
Review the list of clients to be merged
Open the text file created in the previous step and review each line:
When there is only one client on the line it means it is marked to be purged. This will not show up during the analysis step unless the —p flag is used. Clients are usually reported for purging (when requested) when an old client exists with no resource or media database entries. This is caused by either really old decommissioned clients or from merging one client into another.
More than one client
More than one client means that the clients listed are to be merged together. The first name in the list is the primary name who's name and client id will be preserved (if it already exists). The following names (secondary names) will all be merged in to the primary name. Any client resources of the secondary names will be renamed to the primary name and the alias lists of all of the clients will be combined. The media database entries will also have their client IDs and names merged into the primary name.
NOTE: If the aliases you want to merge, for example, "old name" and "new name" do not appear on the same line, you need to add the "old name" as a NetWorker alias of the "new name".
Add nwclientold or nwclientdummy as an alias for nwclient.
Warning: It is very important to make sure that all the aliases listed on the same line belong to the same host. If there is an alias that belong to a different host, nsrclientfix will merge its save sets to the first alias in the list. If the save sets need to be split at a later time, this will require a complicated and time consuming workaround (basically, remove the save sets from the media database and scan them again.).
Use nsrclientfix with the text file to correct clientid problems on the clients listed.
nsrclientfix -u <file>
root@nwsvr# nsrclientfix -u text1 Merging the following clients into 'smurf': smurf.lab Merging the resource database for client 'smurf'. Merging the media database for client 'smurf'. The merging is complete for client 'smurf'. Purging the client 'schlumpf'. Purging the resource database of client 'schlumpf'. Purging the media database of client 'schlumpf'. Removing any index backups related to client 'schlumpf' in the media database. Successfully purged client 'schlumpf'. Purging the client 'localhost'. Purging the resource database of client 'localhost'. Purging the media database of client 'localhost'. Removing any index backups related to client 'localhost' in the media database. Successfully purged client 'localhost'.
NOTE: The merged clients won't be removed. The
nsrclientfix command must run again to remove the aliases that were merged and not removed.
Purge clients that were previously merged and now have no save sets attached
The merged clients were not removed. To remove them,
nsrclientfix needs to be run again:
root@nwsvr# nsrclientfix -a text2 -p schlumpf.lab root@nwsvr# nsrclientfix -u text2 Purging the client 'schlumpf.lab'. Purging the resource database of client 'schlumpf.lab'. Purging the media database of client 'schlumpf.lab'. Removing any index backups related to client 'schlumpf.lab' in the media database. Successfully purged client 'schlumpf.lab'.