Networker Tips

A Slice of Legato please 

Strange RPC errors with windows client or strange agent messages

 Stop the networker server and clear out the nsr/tmp directory then restart it.

this fix cures 99% of all networker maladies I have found thus far!


 mminfo

used to query networker database

 mminfo -av -q 'savetime>=last friday' -r volume,pool,%used,location

 mminfo -av -q 'savetime>=last friday' -q 'location=<library>-r volume,pool,%used,location


 mmlocate foo 

used to query tape location and to mark off line

Mark tapes offline   Offsite <bagnumber> <todays date> <initials>


for tape in `cat /home/greid/w21tapes`

        do

        echo $tape

         /usr/sbin/mmlocate -u -n $tape "Offsite 00011915 19/05/2006 GR - return"

        done

Find a tape

$ mmlocate -n 001129

Volume  Location

001129  Offsite 00011915 19/05/2006 GR - return


change tape status

nsrmm -o mode volnum

The mode can be one of the following:

[not]recyclable, [not]readonly, [not]full, [not]offsite, [not]manual or [not]suspect.

mminfo perl tool

#!/usr/bin/perl -w

#primary hash to store paths
my %paths;

while ( <> ) {
#mminfo spits out data like so
# name save set detail
# meydc01    SYSTEM DB:\
# split on space would not work , so use regex memory to yank out the fields we want

 m/^\s*([^\s]+)\s+([^\s]+.*$)/;
# now load hash of hashes with regex memory
# abuse the unique key property of hashes as a filter for both client and filesystem
$paths{$1} { $2} = 0

}

# now we have unique clients and filesystems spit them back out in csv format
foreach  my $system (sort keys %paths) {
       foreach my $volumes (keys % { $paths{$system} } ) {
               print "$system,$volumes\n";
       }
}
usage :   mminfo -av -q'savetime>=4/1/08' -r 'client,name'| perl split.pl > better.csv

rebuild media and Client File index

First check the ssids you want to recover

 mminfo -av  -q"savetime <= 4/20/2008" -c foofs1 -q'savetime > 4/19/2008' -r 'volume,client,savetime,ssid,state,name,nsavetime'

 volume        client       date   ssid       state  name                             save time
001049         foofs01     04/19/08 51014460         /                               1208642363
001049         foofs01     04/19/08 134898126        /data2                          1208639949
001049         foofs01     04/19/08 218783676        /data4                          1208639421


now set the /data2 and data4 savesets to not expire or networker may expire them before you get a chance to use them!!
(yes it's that dumb enough to expire them half way through a restore !)

nsrmm -S <savesetid> -e <date in future>

nsrmm -S <savesetid>  -w <date in the future>

you may get "a cannot change browse/retention time" error

nsrmm -o notrecyclable <volume> and rerun the nsrmm -e and -w again to fix

manual mount in library (if using)

scanner -i /dev/tapedev
will take a while

Search CFI with exact timestamp

mminfo -av -s server -q"savetime <= 09/4/2006" -c client -q'savetime > 08/20/2006' -r 'volume,client,savetime,ssid,state,name,nsavetime'  


nsrinfo -v -n 'All' -t nsavetime_from_above client

tip use grep the find what you need

 

if it returns 0 .. then you need to scan the CFI back in as it may have expired

 

List Clients and Networker Versions

#!/usr/bin/perl
use strict;
use warnings;

use IPC::Open2;

my $nsradmin = '/usr/bin/nsradmin';

my ($rdr, $wtr);
my $pid = open2($rdr, $wtr, $nsradmin, '-i', '-');
print $wtr "show name\n";
print $wtr "show networker version\n";
print $wtr "print type:nsr client\n";
close $wtr;

my $client;
while(<$rdr>)
{
  chomp;
  if (s/\\$//) # ends in backslash
    {
      $_ .= <$rdr>;
      chomp;
      redo;
    }
  if (/name\:\s*(.*);/) { $client = $1; next; }
  if (/version\:\s*(.*);/) { print "$client,$1\n"; }
}

Debuging NT client connections

restart NT service everytime you make any changes!

c:\program files\legato\nsr\res servers - contains a text list of your legato servers perhaps your server is not listed there


check Multi path networks/vlan stuff too , check network connections , ping trace route etc

 

check hosts file
<winnt>\system32\drivers\etc\hosts
<unix> you know where it is !


127.0.0.1 localhost
<IP> Short_name long_name(FQDN)

Debug nsrexecd

shutdown the nt service or on Unix

goto to the $legato\bin dir and execute nsrexecd -D 9

Debug save groups

 savegrp -vvv -D5 -G group name >test.txt 2>&1

Debug Exhange Agent

nsrxchsv -vvvv -s server -D5 MSEXCH:IS

 Daily Pool - media management

 
#!/usr/bin/ksh
#
# Script: Yank-Daily
# Removes Full Daily Tapes.
#
#

DATE=`date +%d/%m/%Y`
#get tapes from weekly pool and load into TAPE array
set -A TAPES `nsrjb -j mtxexxjbx01 -C |grep DAILY|awk '{print $2}'|
perl -p -e 's/\n/ /g'`
#get Mounted valumes
set -A MOUNTED `nsrjb -j mtxexxjbx01|grep drive|awk '{print $6}'`
#set a Full List
#this is a bit hacky what i really wanted was mminfo -m volume -r  
%used !
#mminfo -a -q $used=full,volume=volume -r volume will return volume if  
it's full and message if not its not full

#build a list of Full tape volumes
for CART in ${TAPES[*]}
do
    mminfo -a -q %used=full,volume=$CART > /dev/null 2>&1
     if [ $? -eq "0" ];then
     #pop onto array
      FULLTAPES[$((${#FULLTAPES[@]} + 1))] = ${CART}
    fi
done
if [ ${#FULLTAPES[*]} -eq "0" ];then
    echo "None today"
    exit 0
fi
#now build a string with the tape list an unload if mounted
for CART in ${FULLTAPES[*]}
do

   for LOADED in ${MOUNTED[*]}
   do
     if [ ${LOADED} = ${CART} ];then
    echo "$CART is Loaded - Requesting Unload"
    nsrjb -j mtxexxjbx01 -N -u $CART
     fi
   done
    FULLLIST="${FULLLIST} ${CART}"
done
#now we have the list again and all are unmounted withdraw the full  
dailys
echo "Now Withdrawing - can take a wee while\n"
nsrjb -j mtxexxjbx01 -Nw ${FULLLIST}