Compaq ACMS for OpenVMS
Remote Systems Management Guide


Previous Contents Index

7.12 ACMSMGMT_LIST_COLLECTIONS_1

ACMS Remote Manager clients call this procedure to obtain a list of Collection table entries.


Format

coll_data_list *acmsmgmt_list_collections_1(coll_sel_struct *coll_sel, CLIENT *cl)


Parameters

coll_sel_struct

Type: Coll_sel_struct
Access: Read  
Mechanism: By reference  
Usage: Defines starting point for list of records to be returned. Also identifies the user. The coll_sel_struct contains the following fields:
     
  client_id
  Type: Integer
  Access: Read
  Mechanism: By value
  Usage: If explicit authentication is being used, a valid client ID must be provided. If the value for client_id is 0, proxy access is used.
     
  starting_rec
  Type: Integer
  Access: Read
  Mechanism: By value
  Usage: Sequential record number (starting at 0) of record to begin list from. Records are returned sequentially from the table. Up to max_rpc_return_recs (Parameter table configuration value) are returned in each call.

cl

Type: CLIENT *
Access: Read  
Mechanism: By value  
Usage: Pointer to an RPC client handle previously obtained by calling the RPC routine CLNT_CREATE.

Return Value

coll_data_list

Type: Coll_data_list
Access: Write
Mechanism: By reference
Usage: Pointer to a union. The union contains either a failure code or a pointer to a structure of type coll_list, which contains the start of a linked list of records. The following are the contents of this union:
         
  rc
  Type: Integer
  Access: Write
  Mechanism: By value
  Usage: Failure return code.
         
  list
  Type: Coll_list
  Access: Write
  Mechanism: By reference
  Usage: Start of linked list. Pointer to a structure of collection table record, and a forward pointer to the next node in the linked list. The following are the contents of this structure:
         
    pNext
    Type: Proc_list
    Access: Write
    Mechanism: By value
    Usage: Start of linked list. Pointer to a structure of type coll_list.
         
    coll_data
    Type: Coll_rec
    Access: Write
    Mechanism: By reference
    Usage: Collection table row. Collection table fields are described in Section 8.3.

Description

The acmsmgmt_list_collections_1 procedure returns a linked list of collection table rows. The number of rows returned in a single call is bounded by the value of the Parameter table field max_rpc_return_recs. More than one call may be required to fetch all the rows. The selection record field starting_rec determines the table row to begin with. Records are returned sequentially from the table, beginning with the starting_rec row. Row numbering begins at 0.

Entire table rows are returned. See Section 8.3 for a description of the fields in the coll_rec structure.

If the ACMS run-time system is not running when this call is issued, the Remote Manager returns the MGMT_NOT_MAPPED error code.

If the end of the table is reached during execution of this procedure, MGMT_NOMORE_DATA is returned in the status field.


Example


int list_collection_data(int client_id,CLIENT *cl) 
{ 
 
   int rec_count = 0; 
   coll_data_list  *coll; 
   coll_link     *nl; 
   static struct coll_sel_struct coll_rec; 
   char c_states[2][9] = {"enabled","disabled"}; 
   char c_entities[10][9] = 
{"unknown","*","acc","tsc","qti","cp","exc","server","group","mgr"}; 
   char c_classes[5][8] = {"*","id","config","runtime","pool"}; 
 
   coll_rec.client_id = client_id; 
 
top: 
   coll_rec.starting_rec = rec_count; 
   coll = acmsmgmt_list_collections_1(&coll_rec,cl); 
 
   if (!coll) { 
      printf("\n RPC Call to get collection data failed"); 
      return(MGMT_FAIL); 
   } 
 
   if ((coll->status != MGMT_SUCCESS) && (coll->status != MGMT_NOMORE_DATA)) { 
       printf("\n Call to get collection data failed, returning status code 
%d",coll->coll_data_list_u.rc); 
       return(MGMT_FAIL); 
   } 
   
   for (nl = coll->coll_data_list_u.list; nl != NULL; nl = nl->pNext) { 
       rec_count++; 
       if (nl->coll_data.entity_name_s > 0) 
          printf("\n Entity: %-9s  Name: %-32s  Class: %-9s  Collection State: 
%-9s", 
                   c_entities[nl->coll_data.entity_type],   
                   nl->coll_data.entity_name, 
                   c_classes[nl->coll_data.collection_class],   
                   c_states[nl->coll_data.collection_state]);   
 
   } 
 
   if (coll->status != MGMT_NOMORE_DATA) 
        goto top; 
 
   printf("\n End of data"); 
 
   return(0); 
} 
      

In the preceding example, the acmsmgmt_list_collections_1 procedure is called to fetch the contents of the Collection table. If the call succeeds, the entity type, name, class, and collection state are printed for each row in the table. Otherwise, an error message is displayed. The example in Section 5.3.1 shows how to declare and initialize the input arguments to this procedure.

7.13 ACMSMGMT_LIST_CP_1

ACMS Remote Manager clients call this procedure to obtain a list of Command Process (CP) table entries.

Format

cp_data_list *acmsmgmt_list_cp_1(sub_id_struct *sub_id_rec, CLIENT *cl)


Parameters

sub_id_rec

Type: Sub_id_struct *
Access: Read  
Mechanism: By reference  
Usage: Structure that contains the following client authorization information.
     
  client_id
  Type: Integer
  Access: Read
  Mechanism: By value
  Usage: If explicit authentication is being used, a valid client ID must be provided. If the value for client_id is 0, proxy access is used. Client_id is obtained by calling the acms$mgmt_get_creds procedure.

cl

Type: CLIENT *
Access: Read  
Mechanism: By value  
Usage: Pointer to an RPC client handle previously obtained by calling the RPC routine CLNT_CREATE.

Return Value

cp_data_list

Type: Cp_data_list
Access: Write
Mechanism: By reference
Usage: Pointer to a union. The union contains either a failure code or a pointer to a structure of type cp_list, which contains the start of a linked list of records. The following are the contents of this union:
         
  rc
  Type: Integer
  Access: Write
  Mechanism: By value
  Usage: Failure return code.
         
  list
  Type: Cp_list
  Access: Write
  Mechanism: By reference
  Usage: Start of linked list. Pointer to a structure of CP table record, and a forward pointer to the next node in the linked list. The following are the contents of this structure:
         
    pNext
    Type: Proc_list
    Access: Write
    Mechanism: By value
    Usage: Start of linked list. Pointer to a structure of type coll_list.
         
    cp_data
    Type: Cp_rec_r
    Access: Write
    Mechanism: By reference
    Usage: CP table row. CP table fields are described in Section 8.4.

Description

The acmsmgmt_list_cp_1 procedure returns a linked list of CP table rows. All CP table rows are returned in each call. Records are returned sequentially from the table, beginning at the start of the table.

Entire table rows are returned. See Section 8.4 for a description of the fields in the cp_rec_r structure.

If the ACMS run-time system is not running when this call is issued, the Remote Manager returns the MGMT_NOT_MAPPED error code.

Rows in the CP table are subject to reuse. Rows are assigned round-robin, and are not cleared until they have been reassigned. So some rows may contain data for inactive CPs. It is the caller's responsibility to examine the record_state field to determine whether this row belongs to an active (record_state field is MGMT_VALID) or inactive (record_state field is MGMT_INACTIVE) CP, and to process the row accordingly.


Example


int list_cp_data(int client_id,CLIENT *cl) 
{ 
 
   cp_data_list  *cp_data; 
   cp_link      *nl; 
   static struct sub_id_struct sub_rec; 
 
   sub_rec.client_id = client_id; 
 
   cp_data = acmsmgmt_list_cp_1(&sub_rec,cl); 
 
   if (!cp_data) { 
      printf("\n RPC Call to get cp data failed"); 
      return(MGMT_FAIL); 
   } 
 
   if (cp_data->status == MGMT_FAIL)  { 
       if (cp_data->cp_data_list_u.rc == MGMT_NOMORE_DATA) { 
          printf("\n No CP data found"); 
          return(MGMT_FAIL); 
       }   
       printf("\n Call to get cp data failed, returning status code 
%d",cp_data->cp_data_list_u.rc); 
       return(MGMT_FAIL); 
   } 
 
   if (cp_data->status == MGMT_WARN) 
       printf("\n ** Warning, some data may be from inactive processes **"); 
   
   for (nl = cp_data->cp_data_list_u.list; nl != NULL; nl = nl->pNext) { 
       if (nl->cp_data.record_state == MGMT_INACTIVE) 
          printf("\n INACTIVE "); 
       else 
          printf("\n          "); 
       printf(" PID: %8X  Process Name: %-s", 
               nl->cp_data.pid, 
               nl->cp_data.process_name); 
   } 
 
   printf("\n End of data"); 
 
   return(0); 
} 
      

In the preceding example, the acmsmgmt_list_cp_1 procedure is called to fetch the contents of the CP table. If the call succeeds, the state of the CP (if INACTIVE), its PID, and process name are displayed for each table row returned. Otherwise, an error message is displayed. The example in Section 5.3.1 shows how to declare and initialize the input arguments to this procedure.

7.14 ACMSMGMT_LIST_EXC_1

ACMS Remote Manager clients call this procedure to obtain a list of Application Execution Controller (EXC) (ACMS application) table entries.

Format

exc_data_list = acmsmgmt_list_exc_1(exc_sel_struct *exc_sel, CLIENT *cl)


Parameters

exc_sel

Type: Exc_sel_struct
Access: Read  
Mechanism: By reference  
Usage: Structure that contains client information and application selection critera. The structure contains the following fields.
     
  client_id
  Type: Integer
  Access: Read
  Mechanism: By value
  Usage: If explicit authentication is being used, a valid client ID must be provided. If the value for client_id is 0, proxy access is used. Client_id is obtained by calling the acms$mgmt_get_creds procedure.
     
  appl_name
  Type: Null-terminated string
  Access: Read
  Mechanism: By reference
  Usage: A pointer to an application name. The name may contain wildcard characters (*, !). Specify in all uppercase characters.

cl

Type: CLIENT *
Access: Read  
Mechanism: By value  
Usage: Pointer to an RPC client handle previously obtained by calling the RPC routine CLNT_CREATE.

Return Value

exc_data_list

Type: Exc_data_list
Access: Write
Mechanism: By reference
Usage: Pointer to a union. The union contains either a failure code or a pointer to a structure of type exc_list, which contains the start of a linked list of records. The following are the contents of this union:
         
  rc
  Type: Integer
  Access: Write
  Mechanism: By value
  Usage: Failure return code.
         
  list
  Type: Exc_list
  Access: Write
  Mechanism: By reference
  Usage: Start of linked list. Pointer to a structure containing an EXC table record, and a forward pointer to the next node in the linked list. The following are the contents of this structure:
         
    pNext
    Type: Proc_list
    Access: Write
    Mechanism: By value
    Usage: Start of linked list. Pointer to a structure of type coll_list.
         
    exc_data
    Type: Exc_rec_r
    Access: Write
    Mechanism: By reference
    Usage: EXC table row. EXC table fields are described in Section 8.5.

Description

The acmsmgmt_list_exc_1 procedure returns a linked list of EXC table rows. All EXC table rows whose application_name field matches the appl_name field in the selection record are returned in each call.


Previous Next Contents Index