ADSM-L

Re: NODE Name & IP match...

1996-09-09 15:35:30
Subject: Re: NODE Name & IP match...
From: Melinda Varian <[email protected]>
Date: Mon, 9 Sep 1996 15:35:30 EDT
On Mon, 9 Sep 1996 12:31:22 -0500 Dwight Cook said:
>   Does anyone know how to find out what IP address ADSM associates with
>   a node name...?

As Paul said, it would be *wonderful* if ANR0400I or the accounting
records displayed the IP address!!!

Our ADSM servers (3 for 2020 clients) all run on VM, so I have written
a "watcher" virtual machine for the servers which processes the secondary
console from the server.  One of the functions of the watcher is to run
the ANR0400I message through the pipeline stage I'll append below to
try to identify the client.  We "encourage" our users (we have open
registration) to use their real host name as their ADSM node name, so
most of the node names can be resolved with a "hostbyname" or
"hostbyaddr" pipeline stage.  For the others, the routine does a NETSTAT
and displays all the nodes connected to that ADSM server at that moment,
from which I can generally figure out which node is which.

However, this is just a stopgap until IBM puts the information in the
session started message.

Melinda Varian,
Princeton University


/* IDCLIENT REXX:                        Identify ADSM client        */

Signal On Error
Signal On Novalue
Signal On Syntax

Parse Upper Arg server .              /* Name of server.             */

myserv = Left(server,8,'_')           /* Constant for FIND stage.    */

'CALLPIPE (endchar ? name IDClient)',
      '*: |',                         /* ANR0400I messages in.       */
      'spec w8 1 |',                  /* Select node name.           */
   'p: nfind (|',                     /* Divert if no node name.     */
   's: nlocate /@/ |',                /* Divert if email address.    */
   'x: nlocate /XXXXXX/ |',           /* Divert if invalid.          */
      'change /.PRINCETON.EDU// |',   /* For cleaning up names.      */
   'v: verify /.0123456789/ |',       /* Select IP addresses.        */
   'a: hostbyaddr |',                 /* Resolve IP addresses.       */
      'change //Resolved: / |',       /* Mark if successful.         */
   'y: faninany |',                   /* Gather all responses.       */
      '*:',                           /* Responses out to caller.    */
'?',
   'p: |',                            /* Here if no node name.       */
      'change //No node name: / |',   /* Say that's the problem.     */
   'y:',                              /* Out to caller.              */
'?',
   's: |',                            /* Here if email address.      */
      'change //Invalid node name: / |',  /* Say that's the problem. */
   'y:',                              /* Out to caller.              */
'?',
   'a: |',                            /* Here if unresolved IPAddr.  */
   'i: faninany |',                   /* Or unresolved host name.    */
      'spec /NETSTAT/ 1 |',           /* Convert each to a NETSTAT.  */
      'command |',                    /* Issue the NETSTAT command.  */
      'find' myserv'|',               /* Select ADSM users.          */
      'nlocate /FIN-wait-2/ |',       /* Discard hung sessions.      */
      'nlocate / *..1500 / |',        /* Discard server's entry.     */
      'spec word 4 1 |',              /* Reformat NETSTAT response.  */
      'chop before string /../ |',    /* Get just name/address.      */
      'change //NETSTAT: / |',        /* Mark NETSTAT output.        */
   'y:',                              /* Out to caller.              */
'?',
   'v: |',                            /* Here if not IP address.     */
   'l: locate /./ |',                 /* Divert if bare host name.   */
      'spec 1-* 1 /.PRINCETON.EDU/ n |',    /* Add domain for Pipes. */
   'f: faninany |',                   /* Plus bare names.            */
   'h: hostbyname |',                 /* Resolve host name.          */
      'change //Resolved: / |',       /* Mark if successful.         */
   'y:',                              /* Out to caller.              */
'?',
   'l: |',                            /* Here if bare host name.     */
   'f:',                              /* Shunt to HOSTBYNAME.        */
'?',
   'h: |',                            /* Here if unresolvable host.  */
   'i:',                              /* Go do a NETSTAT.            */
'?',
   'x: |',                            /* Here if invalid host name.  */
   'i:'                               /* Go do a NETSTAT.            */


Error: Exit RC*(RC<>12)               /* RC = 0 if end-of-file.      */


/*-------------------------------------------------------------------*/
/*                        Error routines                             */
/*-------------------------------------------------------------------*/

Novalue:

Parse Source . . myfn myft .

Say 'Novalue condition for symbol' Condition('D') 'on line' Sigl 'of',
   myfn myft':'
Say Sourceline(Sigl)

Exit 20                               /* Exit with error setting.    */


Syntax:

Parse Source . . myfn myft .

Say 'Syntax error on line' Sigl 'of' myfn myft':'
Say Sourceline(Sigl)
Say 'Error was:' Errortext(RC)

Exit 24                               /* Exit with error setting.    */
<Prev in Thread] Current Thread [Next in Thread>