HP.com home Using NS 3000/iX Network Services: HP 3000 MPE/iX Computer Systems > Chapter 6 Intrinsics for Node and Environment Status

NSSTATUS Intrinsic

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

The NSSTATUS intrinsic returns information about services, servers, and NS users on local or remote nodes. This information is equivalent to the data displayed by NSCONTROL STATUS.

Syntax

                   BA       IV         BA     IV    INSSTATUS        ([name], [namelength], {nodename], {nodelenth], status
                  (IV)     (BA)                 [,itemnum1, item1]                [,itemnum2, item2]                [,itemnum3, item3]                [,itemnum4, item4]                [,itemnum5, item5]);                                       where: BA    = Byte array                                               I    = Integer                                              IV    = Integer value

Parameters

name (Input)

26-byte character array, by reference. Service name, server name, or user name, depending on which items are specified. May be omitted for certain items.

namelength (Input)

16-bit integer, by value. Length of name in bytes. May be omitted for certain items.

nodename (Input)

52-byte character array, by reference. Name of a remote node from which information will be obtained. If omitted, NSSTATUS information will be obtained from the local node.

nodelength (Input)

16-bit integer, by value. Length of nodename in bytes. If omitted, NSSTATUS information will be obtained from the local node.

status (Output)

Required 16-bit integer, by reference. 0 is returned if call is successful; otherwise an error number is returned.

itemnum i (Input)

16-bit integer, by value. Item number identifying the item of data to be retrieved.

item i (Output)

Data type varies. By reference. Array in which data identified by itemnum i will be returned. Required parameter if itemnum i present.

Itemnum/item parameters must appear in pairs. Up to five items of information can be retrieved by specifying one or more itemnum/item pairs.

Data Items

1. service list

2000-byte character array (output). List of all services installed on indicated node. Format for the list is given in the data structure shown in Figure 6-2 “Service List Data Structure”. NM capability is not required.

Service List Fields

Number of Services

The number of Service List Entries included.

Service List Entry

One for each configured server. Format for the list entry is given in the data structure shown in Figure 6-3 “Service List Entry Data Structure”.

Service List Entries

Service Name

The name of the service; a port name for a local service or a socket name for a remote service.

Server Type Name

The name of the server created for service requests to this service

ST

If 0, the service has not been started. If 1, the service has been started.

RM

If 0, the service is local. If 1, the service is remote.

Figure 6-2 Service List Data Structure

[Service List Data Structure]

Figure 6-3 Service List Entry Data Structure

[Service List Entry Data Structure]
2. server list

2000-byte character array (output). List of all servers installed on the indicated node. Format for the list is given in the data structures shown in Figure 6-4 “Server List Data Structure”, Figure 6-7 “Server Type List Data Structure”, and Figure 6-8 “Server Entry Data Structure”.

Server List Fields

Number of Server Types

The number of Server Type Lists returned.

Server Type List

See the description of the fields under item 12.

Figure 6-4 Server List Data Structure

[Server List Data Structure]
3. user list

2400-byte character array (output). List of all users currently using NS on indicated node. Formats for the data structures of the user list and user list entries are shown in Figure 6-5 “User List Data Structure” and Figure 6-6 “User List Entry Data Structure” respectively.

4. service started

16-bit integer. Returns a value indicating one of the following conditions:

     -1 = Named service not installed.
0 = Named service not started.
1 = Named service started.

NM capability is not required.

Figure 6-5 User List Data Structure

[User List Data Structure]

Figure 6-6 User List Entry Data Structure

[User List Entry Data Structure]
5. service local

16-bit integer. Returns a value indicating one of the following conditions:

     -1 = Named service not installed.
0 = Named service not remote.
1 = Named service local.
2 = Named service is monitor.

NM capability is not required.

6. service server

8-byte character array. Name of server associated with named service. If the named server is not available, then eight ASCII spaces are returned. NM capability is not required.

7. min servers

16-bit integer. Minimum number of servers for the named server type on the indicated node. A returned value of -1 implies that the named server does not exist.

8. max servers

16-bit integer. Maximum number of servers of the named server type on the indicated node. A returned value of -1 implies that the named server is not available

9. debug create

16-bit integer. Returns a value indicating one of the following conditions:

     -1 = Named server not available.
0 = Named server not created with debug option.
1 = Named server is created with debug option.
10. active servers

16-bit integer. Current number of active servers of the named server type on the indicated node. A returned value of -1 implies that the named server type is not available.

11. reserved servers

16-bit integer. Current number of reserved servers for the named type on the indicated node. A returned value of -1 implies that the named server type is not available.

12. server type list

2000-byte character array (output). List of servers of the named server type on the indicated node. The formats of the data structures are shown in Figure 6-7 “Server Type List Data Structure” and Figure 6-8 “Server Entry Data Structure”.

Server Type List Fields

Server Name

The name of the server program file, without the group and account.

Minimum Servers

The minimum allowed number of servers for this type.

Maximum Servers

The maximum allowed number of servers for this type.

Create With Debug

If 0, servers are not created with the debug option. If 1, servers are created with a debug breakpoint.

Number of Servers

The number of active and reserved servers for this type.

Server Entry

One for each active and reserved server process. Format of the data structure of each server type entry is shown in Figure 6-8 “Server Entry Data Structure”.

Server Entry Fields

Server PIN

The process ID number for the server.

Job Number

The number of the job or session into which the server has adopted. If the server is in the system environment, the job number is 0.

Service

The service using the server (DSSERVER only). Values are:

0 — VTL (Normal VT Terminal Monitor)

1 — VT (Normal VT Application Monitor)

2 — RFA

4 — RPM

5 — VTR (Reverse VT Terminal Monitor)

6 — VTRL (Reverse VT Application Monitor)

AC

If 0, the server is reserved. If 1, the server is active

Figure 6-7 Server Type List Data Structure

[Server Type List Data Structure]

Figure 6-8 Server Entry Data Structure

[Server Entry Data Structure]
13. user.acct

26-byte character array. The user and account for the named session on the indicated node. If the named user is not present, then 26 ASCII spaces are returned.

14. job number

16-bit integer. The job number for the named session on the indicated node. If the specified session is not present, then -1 is returned.

15. session ID

16-bit integer. The session ID assigned to the user on the indicated node. If the named user is not present, then -1 is returned.

16. user type

16-bit integer. Returns a value indicating one of the following conditions:

      1 = Named user is not present.
0 = Named user is remote.
1 = Named user is local.
17. num environments

16-bit integer. Number of active environments for the user on the indicated node. If the named user is not present, then -1 is returned.

18. environment list

2400-byte character array (output). List of environments for the user on the indicated node. Formats for the data structures of the environment list and environment list entries are shown in Figure 6-9 “Env List Data Structure” and Figure 6-10 “Env List Entry Data Structure” respectively.

Figure 6-9 Env List Data Structure

[Env List Data Structure]

Figure 6-10 Env List Entry Data Structure

[Env List Entry Data Structure]
19. autologon supported

16-bit integer. Returns a value indicating one of the following conditions:

     -1 = Named service not installed.
0 = Named service does not support autologon.
1 = Named service supports autologon.

29. autologon enabled

16-bit integer. Returns a value indicating one of the following conditions:

     -1 = Named service not installed.
0 = Autologon is off for the named service.
1 = Autologoni is on for the named service.

21. NS session's initiator information

86-byte character array. The initiator's (job or session) information of the requested VT session on an indicated node. Format of the output array is shown in Figure 6-11 “Initiator's Information Format”.

Figure 6-11 Initiator's Information Format

[Initiator's Information Format]

Description

For items 1 through 3, the name and namelength parameters are ignored.

For items 4 through 6, the name and namelength parameters specify the service for which NSSTATUS information will be returned.

For items 7 through 12 the name and namelength parameters specify the server type.

For items 13 through 18, the name and namelength parameters specify the user for whom information will be returned. The format can be user.acct (specifying the user and account), or #J/Snnn (where J is the job number and S is the session number). Note: if there is more than one session for a user.acct, only information on the first session found will be returned.

The calling user must have Node Manager (NM) capability to retrieve all except item numbers 1, 4, 5, and 6. This intrinsic may not be called in split stack mode. The condition code remains unchanged.

Some of the data structure fields are described with the term "CM word." A CM word is a compatibility mode word. This is a 2-byte long, 2-byte aligned field. This corresponds to an SPL type LOGICAL or INTEGER or any 16-bit interger in other languages such as both CM and NM in PASCAL, FORTRAN, and COBOL.

NSSTATUS Intrinsic Examples

  1. Determine if the VT service is started on the local node:

         Name := 'VT';
    NameLength:=2;
    ItemNum:=4;
    NSSTATUS (Name, NameLength, , , Status, ItemNum,
    VtStarted);

    If the VT service is started, VtStarted will be set to 1; otherwise it will be set to -1 or 0.

  2. Determine if the VT service is started on the remote node NODE1:

         Name := 'VT';
    NameLength:=2;
    Node Name:= 'NODE1'
    NodeLength:=5;
    ItemNum:=4;
    NSSTATUS (Name, NameLength, NodeName, NodeLength,
    Status, ItemNum, VtStarted0;

    If the VT service on NODE1 is started, VtStarted will be set to 1; otherwise it will be set to -1 or 0.

  3. Determine if the NFT service is started and to find out how many active and reserved NFT servers currently exist on the local node:

         Name := 'NFT';
    NameLength:=3;
    ItemNum4:=4;
    ItemNum10:=10;
    ItemNum11:=11;
    NSSTATUS (Name, NameLength, , , ,Status,
    ItemNum4,NftStarted,
    ItemNum10, ActiveServers,
    ItemNum11, ReservedServers);

    This sets NftStarted to 1 if NFT is started, and returns the number of active and reserved NFT servers to ActiveServers and ReservedServers, respectively. This example uses the fact that NFT is the name of both the service and the server.

  4. To obtain all the status information for services, servers, and users on the remote node NODE1:

         NodeName := 'NODE1'
    NSSTATUS (, , NodeName, NameLength, Status,
    ItemNum1,ServiceList,
    ItemNum2, ServerList,
    ItemNum3, UserList);

    This returns to the arrays ServiceList, ServerList, and Userlist the information formatted as defined in the data structures in this chapter.

  5. Suppose #S1 (Manager.sys) on node A creates a remote session #S5 (using VT) on node B. The initiator of #S5 information can be obtained by running the following NSSTATUS intrinsic call on node B.

         Name    := '#S5'     {or logon string of #S5}
    NameLength :=3; ItemNum :=21;

    NSSTATUS (Name, NameLength, , , Status, ItemNum, InitiatorInfo);

    If the intrinsic returns without an error then the following information will be in the InitiatorInfo record.

    InitiatorInfo.JobType ---  1      { indicates Session}InitiatorInfo.JobNum  ---  1      { session num }InitiatorInfo.Ldev    ---  20     { logical device numb of #S1 }InitiatorInfo.LocRem  ---  1      { local session. not a VT session}InitiatorInfo.Logon   ---  'MANAGER.SYS'InitiatorInfo.NodeLen ---  8InitiatorInfo.NodeName---  'A.IND.HP'
  6. Consider the above example. The same information can be obtained by running the following NSSTATUS intrinsic on Node C, which is on the same network.

         Name := '#S5'           {or logon string of #S5}
    NameLength:=3;
    ItemNum:=21;
    NodeName :='B',
    NodeLength :=1;

    NSSTATUS (Name, NameLength, NodeName,NodeLength, Status, ItemNum, InitiatorInfo);

    In this case, the intrinsic on Node C first goes to Node B and gets #S5's information. From this information, it gets the initiator's SID and node name and then goes to that node--in this case Node 'A'. It then gets the initiator's session information based on the SID — in this case #S1. Note: all the three systems involved in this scenario must have this fix.

    See Table 6-2 “NSINFO Errors” for NSINFO Errors.

    Table 6-2 NSINFO Errors

    Error NumberMeaning
    0Successful completion of NSSTATUS intrinsic.
    1Required parameter missing.
    2Invalid item number. Item number must be an integer in the range 1 to 18.
    3Item number specified without corresponding item array.
    4Item array specified without corresponding item.
    5Name length too large.
    6Name length too small.
    7Expected a job or session number.
    8Non-numeric character in the job or session number.
    9Expected "#" as first character in Name parameter.
    10Bounds violation.
    11Unknown or invalid node name.
    12Node name specified without node name length.
    13Node name length specified without node name.
    14Communications error occurred with the remote NSSTATUS server. Most likely the remote system does not support the NSSTATUS intrinsic.
    15Node Manager (NM) capability required to retrieve the requested item.
    16DB not stack. (NM) capability required to retrieve the request.
    17Local NSSTATUS service has not been started. See Node Manager.
    18Internal Resource Error. Could not create reply port. Try again.
    19Remote node does not support option 21 (Remote node does not have this enhancement).
    20Option 21 works for only VT sessions. Given session is not a VT session.
    21Could not access initiator node using the node name in $BACK environment.