Operating System - OpenVMS
Showing results for 
Search instead for 
Did you mean: 

Displaying interactive sessions

Edmundo T Rodriguez
Frequent Advisor

Displaying interactive sessions

I done quiet good research on the following issue and canâ t find an answer.
I have my ideas about the why but I want to know the specific reason.

Why is there a difference in the result of performing the following DCL commands â ¦


â ¦ in order to obtain the amount of interactive users in the system?

(Even if we execute them immediately one after the other)

Example: Execute from a command procedure â ¦

See attachment
Respected Contributor

Re: Displaying interactive sessions

The SET LOGIN shows you the total number of interactive users logged in at the time. The SHOW USERS ("Total Number of Users" part) shows you the numer of unique usernames logged in. Some users may have multiple logged in sessions.

Respected Contributor

Re: Displaying interactive sessions

If you want your values to match, change your SHOW USER command to SHOW USER/INTER.

Robert Gezelter
Honored Contributor

Re: Displaying interactive sessions


It is quite possible that there is some login/logout activity going on. With over 290 active users, it is certainly a possibility.

I would also be interested in the output of a SHOW SYSTEM/INTERACTIVE to see what the full list of processes is. A word of caution, SHOW SYSTEM/INTERACTIVE will also display spawned subprocesses.

There is also the route of going through SDA and looking at the online system, but that is a more involved process.

- Bob Gezelter, http://www.rlgsc.com
Edmundo T Rodriguez
Frequent Advisor

Re: Displaying interactive sessions

This is serious subject even it look simple.


The SET LOGINS command displays the current
interactive limit and the number of interactive users.

The SHOW USER command will always provide a display of all
the interactive users processes count.

We don't need to execute


I do believe that one of the possible reasons for the difference
is due to the "login/logout activity going on".

I did compared the result of SHOW SYSTEM/INTER considering
the spawned subprocesses as part of the count.

I also look at the SDA and it provides the same result with
a minir difference some times ( -1 or -2 user counts)

The thing is that I don't see an straigh answer in any of
these possibilities.


OpenVMS is a very dynamic environment with many variables but
I believe that there should be a way of exactlty establshing
the reason for the discrepancy.

Volker Halle
Honored Contributor

Re: Displaying interactive sessions


the no. of interactive users returned by SET LOGIN is returned from a data cell in the executive (SYS$GL_IJOBCNT), which is an atomic operation.

$ SHOW USER/INTER/NODE needs to traverse the list of processes in the system using some system service and does not synchronize this operation with the overall system and users logging in and out.

This may account for the difference seen. Does the different values you see stay constant ? Or is there always a constant difference ?

Edmundo T Rodriguez
Frequent Advisor

Re: Displaying interactive sessions


That is the question for the question!

Why does any system service synchronize the SHOW USER operation with
the overall system and users logging in and out at any given point?

The different values we see stay constant between the two commands, with
a difference not less than 2 not higher than 4 at any time.


We are running multiple OpenVMS system with various OS versions.

One in specific is a cause of concern because we have a lot of activity
In this system, one of the user accounts is a generic account were there
may be over 400 user connect sometimes.

So I need to follow-up the load and side effects created by them very keenly
Respected Contributor

Re: Displaying interactive sessions

One very possible explanation for the discrepancy is that there are 2 - 4 users who are in the process of logging in but haven't completed login yet (i.e. at username or password prompt). Those processes will be added to the set login display but you won't see them on the show user.
Doug Phillips
Trusted Contributor

Re: Displaying interactive sessions


If you modify your command file to do only a bunch of SET LOGINS *or* SHOW USERS do you see the count change?

Have you looked at the accounting journal (help accounting, help set accounting/enable)?

Have you considered using T4 or one of the other such tools?
Jon Pinkley
Honored Contributor

Re: Displaying interactive sessions

I did some testing on a system with no activity but me.

I was surprised to see that the output of

$ set login/inter

was one higher than

$ show user/inter/node

Starting a login on a terminal and letting it sit at the Login: prompt does increment the SYS$GL_IJOBCNT displayed by $ set login/inter, but it is not displayed by $ show user/inter/node.

So I then started looking for an explanation of the additional one that was being included in SYS$GL_IJOBCNT. On this test system, it was the DTLOGIN process running LOGINOUT (DecTerm/Decwindows).

There may be other processes like this (SSH?) that could account for the minimum of 2 you are seeing, and the variable additional ones are most likely to be embryonic login sessions.

it depends
Honored Contributor

Re: Displaying interactive sessions

Counting interactive users looks to be easy and simple, and it isn't.

I don't mean that to be flippant.

There are a variety of different details that trip you. The area is replete with assumptions.

Printers can have terminal devices, but aren't interactive users. Remote users are usually interactive, but some of the processes involved get marked as network. DECwindows logins are usually one user (one "seat"), but there are usually multiple DECterm sessions with associated foreign terminals.

I might ask what goal you're seeking to address here, as there can be different answers and different assumptions.

Why? User-based licensing might want a different count than another counting-based application, for instance, as licensing might want to count "seats" and not interactive processes. How do you could a DECterm aimed at a remote DECwindows display, for instance?

Stephen Hoffman
HoffmanLabs LLC

John Gillings
Honored Contributor

Re: Displaying interactive sessions


>Why does any system service synchronize
>the SHOW USER operation with the overall
>system and users logging in and out at any
>given point?

I'm not sure if this answers your question... SET LOGIN is "synchronized" because all it's doing is returning a single system cell SYS$GL_IJOBCNT. It's the counter the operating system keeps for interactive jobs (defined as any process in mode "INTERACTIVE", which might not be the same definition as other entities assume). Nothing can change *while* sampling the cell, though it might change immediately before and/or after.

SHOW USERS scans through all processes on the system, counting processes that it decides are interactive. As Hoff has explained, this is non-trivial, and may use a different definition from what you expect). This operation is NOT synchronized from start to finish, as it could take considerable time, especially if are many processes. It's therefore possible that numerous processes are created and/or deleted in front of or behind the scan, while it's in progress. The count can therefore be "wrong" relative to any particular instant in time, and indeed might not be "correct" for ANY particular instant, depending on exactly when particular processes were created or deleted. To synchronize would require blocking all activities which change the number of processes at the beginning of the scan, until the end. Obviously this is not a good idea. Consider if a user hit HOLD SCREEN in the middle of a SHOW USER display, they would block logins and logouts!

Bottom line is, the two commands give different answers, because they do different things. If you can explain your objectives, I'm sure someone here can give you a way to determine what you need (which may be a completely different mechanism again, possibly giving a different answer from both SET LOGINS and SHOW USERS!)
A crucible of informative mistakes