Re: Get ip number (EX) - VMS

This is a discussion on Re: Get ip number (EX) - VMS ; Hello, Log in via Telnet and try this ... $ write sys$output f$getdvi("SYS$COMMAND","TT_ACCPORNAM") $ write sys$output f$trnlnm("SYS$REM_NODE") The first one should show the domain name of the source of the connection (if it can be worked out) otherwise the IP ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: Get ip number (EX)

  1. Re: Get ip number (EX)

    Hello,

    Log in via Telnet and try this ...

    $ write sys$output f$getdvi("SYS$COMMAND","TT_ACCPORNAM")
    $ write sys$output f$trnlnm("SYS$REM_NODE")

    The first one should show the domain name of the source of the connection
    (if it can be worked out) otherwise the IP address. The second one should
    show the IP address as a set of hex numbers squashed together.

    Regards,

    Jeremy Begg


    >I'm using Multinet ver 4.1 on OpenVMS ver 5.5-2
    >Is there any simple way to catch the ip of a user during its login?
    >I wrote a batch file which does tease steps:
    >1. get username - f$edit(F$GETJPI("","username"),"trim")
    >2. get details as shown by "sh user/ful" - for example :
    >RAV _NTY331: 00003DAE NTY331:
    >(user_comp.deshtami.icl-ips.com)
    >- the information in the breakets is the computer name + domain name. I
    >save this information in a symbol
    >3. Now I'm able to run MU TRACE on the mentioned above symbol and I get1
    >the wanted information -
    >User_comp (192.168.119.95) 0 ms 10 ms 0 ms


    >Is there a shorter way ?


    >Thank you in advance


    >Issachar Schraub
    >Vax/OpenVMS System administrator & P.C. Support
    >IMI(TAMI) Institute for Research & Development Ltd.
    >P.Box 10140, Haifa Bay 26111 Israel
    >Phone: 972-4-8469502
    >Fax: 972-4-8450078
    >Mobile: 972-52-4709766
    >Email: issachar@tami-imi.icl-ip.com



  2. Re: Get ip number (EX)

    For Jeremy's second suggestion (and via ssh instead of telnet), I get
    the hostname portion of the FQDN of my client...

    You might also try: $ write sys$output f$trnlnm("SYS$REM_ID")

    I believe that will provide a pair hex numbers, separated by a colon.
    The source IP address is to the left of the colon and the source port is
    to the right of the colon. Here's a simplistic script to translate such
    a hex representation of the address to a normal dotted quad:

    $!HEX_TO_IP.COM
    $!
    $ if f$length(p1).eq.8
    $ then p4 = f$extract(6,2,p1)
    $ p3 = f$extract(4,2,p1)
    $ p2 = f$extract(2,2,p1)
    $ p1 = f$extract(0,2,p1)
    $ endif
    $ write sys$output %x'p1',".",%x'p2',".",%x'p3',".",%x'p4

    - ken

    Jeremy Begg wrote:
    > Hello,
    >
    > Log in via Telnet and try this ...
    >
    > $ write sys$output f$getdvi("SYS$COMMAND","TT_ACCPORNAM")
    > $ write sys$output f$trnlnm("SYS$REM_NODE")
    >
    > The first one should show the domain name of the source of the connection
    > (if it can be worked out) otherwise the IP address. The second one should
    > show the IP address as a set of hex numbers squashed together.
    >
    > Regards,
    >
    > Jeremy Begg
    >
    >
    >
    >> I'm using Multinet ver 4.1 on OpenVMS ver 5.5-2
    >> Is there any simple way to catch the ip of a user during its login?
    >> I wrote a batch file which does tease steps:
    >> 1. get username - f$edit(F$GETJPI("","username"),"trim")
    >> 2. get details as shown by "sh user/ful" - for example :
    >> RAV _NTY331: 00003DAE NTY331:
    >> (user_comp.deshtami.icl-ips.com)
    >> - the information in the breakets is the computer name + domain name. I
    >> save this information in a symbol
    >> 3. Now I'm able to run MU TRACE on the mentioned above symbol and I get1
    >> the wanted information -
    >> User_comp (192.168.119.95) 0 ms 10 ms 0 ms
    >>

    >
    >
    >> Is there a shorter way ?
    >>

    >
    >
    >> Thank you in advance
    >>

    >
    >
    >> Issachar Schraub
    >> Vax/OpenVMS System administrator & P.C. Support
    >> IMI(TAMI) Institute for Research & Development Ltd.
    >> P.Box 10140, Haifa Bay 26111 Israel
    >> Phone: 972-4-8469502
    >> Fax: 972-4-8450078
    >> Mobile: 972-52-4709766
    >> Email: issachar@tami-imi.icl-ip.com
    >>

    >
    >


    --
    - Ken
    ================================================== ===============
    Ken Connelly Associate Director, Security and Systems
    ITS Network Services University of Northern Iowa
    email: Ken.Connelly@uni.edu p: (319) 273-5850 f: (319) 273-7373



+ Reply to Thread