Networker

Re: [Networker] Script to check Networker Veriosn on Windows

2004-11-10 12:02:12
Subject: Re: [Networker] Script to check Networker Veriosn on Windows
From: Davina Treiber <Treiber AT HOTPOP DOT COM>
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Date: Wed, 10 Nov 2004 16:44:38 +0000
Maarten Boot (CWEU-USERS/CWNL) wrote:
You can also talk directly to the nsrexecd on the client with something like

echo print | nsradmin -p390113 -i - -s baba

On unix at least, it has the advantage that you can do it remote also for any
client.

I use it to test is the networker software is actually running and to exctract
the hostname as networker things it is.

Maarten


Right, it's a useful technique. I have a script to check multiple
clients on multiple servers. I'll share it. Sorry about the lack of
comments, it was knocked up in a hurry and never refined since. Some of
the lines have been wrapped by my email client, you'll need to join them
back together.



#!/bin/ksh
# allgetclientinfo
cat servers.full.list | while read SERVER undef; do
        #echo "# SERVER $SERVER"
        echo "  show name; backup command
                print type: NSR client" | nsradmin -s $SERVER -i - \
        | sed 's/;//' | while read LINE; do
                ATT=$(echo $LINE | cut -d: -f1 | sed 's/^ //')
                VAL=$(echo $LINE | cut -d: -f2 | sed 's/^ //')
                if [ "$ATT" = "backup command" ]; then
                        BUPCMD=$VAL
                elif [ "$ATT" = "name" ]; then
                        NAME=$VAL
                        PINGOP=$(ping $NAME 2>&1)
                        if [ -n "$(echo $PINGOP | grep "is alive")" ]; then
                                OSTYPE="unknown version"
                                VERSION="unknown version"
                                echo "  show version; OS
                                        print type: NSRLA" | nsradmin
-s $NAME -p 390113 -i - \
                                | sed 's/;//' | while read LINE; do
                                        ATT=$(echo $LINE | cut -d: -f1
| sed 's/^ //')
                                        VAL=$(echo $LINE | cut -d: -f2
| sed 's/^ //')
                                        if [ "$ATT" = "OS" ]; then
                                                OSTYPE=$VAL
                                        elif [ "$ATT" = "version" ]; then
                                                VERSION=$(echo $VAL |
sed 's/"//g')
                                        fi
                                done
                                echo "$NAME,$SERVER,$OSTYPE,$VERSION"
                        elif [ -n "$(echo $PINGOP | grep "unknown
host")" ] ; then
                                echo "$NAME,$SERVER,unknown
host,unknown host"
                        else
                                echo "$NAME,$SERVER,cannot ping,cannot
ping"
                        fi
                fi
        done
done

--
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. Questions regarding this list
should be sent to stan AT temple DOT edu
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

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