HP3000-L Archives

August 2000, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Barry Lake <[log in to unmask]>
Reply To:
Barry Lake <[log in to unmask]>
Date:
Wed, 16 Aug 2000 18:19:37 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (93 lines)
At 1:21 PM -0700 8/16/00, [log in to unmask] wrote:
>Barry Lake wrote:
>> If you do
>>
>>    :listf ci.pub.sys,8
>>
>> you'll get a list of all connected users [showing ip addresses]...
...
>> Next, you can do :showjob to get the ldev numbers.
>>
>> With some clever CI programming you [can] cross reference the
>> two listings...in order to match ip addresses with ldev numbers.
>
>good suggestion....but there's an atomic problem.  between doing the two
>commands, a user could easily have logged off and that's makes the 'clever' ci
>programming rather a pain (imo)

Well, if the user logs off, then he isn't interesting anyway, as the
original poster was worried about too many multiple logons eating up the
session limit. The other direction might be of greater concern -- if a user
logs *on* between the two commands.

>> I'm less familiar with the JINFO function, ...[but using it]...
>> you might be able to get the same result as my first suggestion.
>
>yes, both ipaddr and ldevin are available but you still are left with the
>atomic problem.
>
>may i suggest as an alternative though:
>http://jazz.external.hp.com/src/showconn/showconn.html
>
>showconn gives both the ip and the ldev all at once

Thanks for the suggestion. SHOWCONN looks like it could be quite useful.

However, just for fun, I'll be argumentative.
It seems to me that even SHOWCONN, regardless of how it works, must gather
its information about sessions from at least a couple of different places
within the system, in between which, sessions could conceivably log on or
off. So, the "atomic problem" would still exist, n'est-ce pas?

The original poster was looking for a "vanilla MPE" way to get a listing
that cross referenced the ldev number of a session with its ip address. If
the posix shell as shipped by HP falls under the "vanilla" category, then
this little bare-bones shell script gives him exactly what he's looking for:


   #!/SYS/HPBIN/SH

   rm iplist
   touch iplist
   callci file ip=./iplist,old

   slist=`callci showjob job=@s | grep '#S' \
          | cut -c1-7,18-22                 \
          | tee sjlist                      \
          | cut -c1-7`

   for s in $slist
      do
      callci "echo ![jinfo(\"$s\",\"ipaddr\")] >>*ip"
      done

   echo "Job#   Ldev#    Ip Address"
   paste sjlist iplist


When I execute it, the output looks like this:


   /BARRY/PUB $ ldevip
   Job#   Ldev#    Ip Address
   #S23      20
   #S24       5    192.168.0.102
   #S25       2    192.168.0.44
   #S26       6    192.168.0.56
   /BARRY/PUB $


The script is simple enough that on a reasonably speedy system it should
execute fairly quickly. Obviously, there is plenty of room for improvement
or enhancement, and there's no error checking, but it does illustrate how
you can get a lot done in little space using the shell. A CI script that
produces the same output would likely be much longer.


Barry Lake                              [log in to unmask]
Allegro Consultants, Inc.               www.allegro.bogus.com
(408)252-2330
--------
Attempting to use anti-spam technique.
Remove "bogus" to create valid address.

ATOM RSS1 RSS2