Compaq ACMS for OpenVMS
Remote Systems Management Guide


Previous Contents Index

Attempting to update an active field that is nondynamic is essentially useless, since the value of the active field value will not change. For instance, calling this procedure with the active_sw field set to 1 and the acc_username field populated produces no change to the system.

Setting the current_sw field to 1 causes updates to be written to the current ACMSGEN file. These updates are durable (that is, they can survive a restart of the ACMS sytem), but they do not affect the active system until the system is restarted.

Both current_sw and active_sw can be set on a given call. If they are, both the active and stored values for any nonnegative or nonnull fields will be updated.

For any nonnegative integer fields, the completion status of the update is returned in the corresponding field in the return structure. For string fields, the string field value is returned regardless of the status of the call.

In order to have one of the string fields set to a null string (that is, ""), populate the field with the value NULL. To have one of the string fields ignored, pass in a null string.


Example


int set_acc_data(int client_id,CLIENT *cl) 
 { 
 
   static char c_name_all[2] = "*"; 
   static char c_null_str[2] = ""; 
   static acc_config_rec set_struct; 
   static acc_status_rec *ret_struct; 
   dcl_link    *nl; 
   
   memset(&set_struct,-1,sizeof(set_struct)); 
 
   set_struct.client_id      = client_id; 
   set_struct.active_sw      = 1; 
   set_struct.current_sw     = 0; 
   set_struct.audit_state    = MGMT_STATE_DISABLED; 
 
   /* Have to provide a pointer for string conversions by XDR 
      or it will access vio. RM will ignore any fields with 
      strlen of 0 */ 
   set_struct.acc_username = c_null_str; 
   set_struct.username_default = c_null_str; 
   set_struct.node_name  = c_null_str; 
 
   ret_struct = acmsmgmt_set_acc_1(&set_struct,cl); 
 
   if (!ret_struct) { 
        printf("\n Call to modify acc failed"); 
        return(MGMT_FAIL); 
   } 
 
   if (ret_struct->status != MGMT_SUCCESS) 
      printf("\n Call to modify ACC returned the following warnings or 
errors\n"); 
   else 
      printf("\n Call to modify ACC completed\n"); 
 
   for (nl = ret_struct->acc_status_rec_u.data.cmd_output; nl != NULL; nl = 
nl->pNext) 
     printf("\n %s",nl->dcl_msg); 
 
   return(0); 
} 
      

In the preceding example, the acmsmgmt_set_acc_1 procedure is called to disable system auditing on the target node. If the call succeeds, system auditing is disabled on the target node, and a success message is displayed. 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.25 ACMSMGMT_SET_COLLECTION_1

This procedure modifies entries in the Remote Manager Collection table. Collection table entries can also be added (see Section 7.2) and deleted (see Section 7.4).

Format

coll_status_rec *acmsmgmt_set_collection_1(coll_config_rec *coll_cfg_rec,CLIENT *cl)


Parameters

coll_cfg_rec

Type: Coll_config_rec
Access: Read  
Mechanism: By reference  
Usage: Structure that contains the following client identification and collection table 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.
     
  coll
  Type: Struct coll_update_rec_r
  Access: Read
  Mechanism: By value
  Usage: Structure containing a Collection table record. Collection table fields are described in Section 8.3. See the Description section for information on how to initialize this record.

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

Type: Struct coll_status_rec
Access: write  
Mechanism: By reference  
Usage: Pointer to a union. The union contains either a failure code or a structure of type coll_update_rec_r, which contains status codes for each field. See the Description section for a discussion of how to determine the update status for any field. The following are the contents of this union:
     
  status
  Type: Integer
  Access: write
  Mechanism: By value
  Usage: Failure return code.
     
  data_warn
  Type: Coll_update_rec_r
  Access: write
  Mechanism: By value
  Usage: Structure containing a Collection table record. The entries in this field contain status codes that correspond to the fields in the coll structure. See the Description section for a discussion of how to determine the update status for any field.

Description

This procedure requests updates to fields in the Collection table (see Section 8.3).

Updates to this table are not durable; that is, they do not survive a restart of the Remote Manager. To make nondynamic, permanent updates to the collection table, use the ACMSCFG utility.

Calls to this procedure must specify entity_type, entity_name, and collection_class. These fields must exactly match an existing record in the Collection table for the update to be applied. Table 7-1 and Table 7-4 contain symbolic values used to populate the collection_class and entity_type fields; entity_name is specified as a null-terminated string.

For any nonnegative fields, the completion status of the update is returned in the corresponding field in the return structure. This includes the key fields of entity_type, entity_name, and collection_class. If no matching record is found in the table, entity_type and collection_class contain values of MGMT_FAIL.

Updates to the collection table are processed immediately and may affect more than one ACMS process. See Section 4.1 for discussion of how the collection table affects ACMS data collection.


Example


int set_collection_data(int client_id,CLIENT *cl) 
 { 
 
   static char c_name_all[2] = "*"; 
   static coll_config_rec set_struct; 
   static struct coll_status_rec *status_rec; 
   
   set_struct.client_id              = client_id; 
   set_struct.coll.entity_type       = MGMT_ALL; 
   set_struct.coll.entity_name       = c_name_all; 
   set_struct.coll.collection_class  = MGMT_CLASS_RT; 
   set_struct.coll.collection_state  = MGMT_STATE_ENABLED; 
 
   status_rec = acmsmgmt_set_collection_1(&set_struct,cl); 
 
   if (!status_rec) { 
        printf("\n Call to modify collection failed"); 
        return(MGMT_FAIL); 
   } 
 
   if (status_rec->status == MGMT_WARN) { 
      printf("\nThe following updates failed: "); 
      if (status_rec->coll_status_rec_u.data_warn.entity_type  == MGMT_FAIL) 
         printf("\n     Record not found"); 
      if (status_rec->coll_status_rec_u.data_warn.collection_state == 
MGMT_FAIL) 
         printf("\n     coll_state invalid"); 
     } 
   else if (status_rec->status != MGMT_SUCCESS) { 
      printf("\nCall to modify collection failed with status 
%d",status_rec->coll_status_rec_u.rc); 
      return(MGMT_FAIL); 
   } 
   else 
      printf("\nCall to modify collection was executed"); 
 
   return(0); 
} 
      

In the preceding example, the acmsmgmt_set_collection_1 procedure is called to set the collection state to ENABLED for the Collection table record with an entity of * (all), a name of * (all), and class of RUNTIME. If the call succeeds, the new value will be stored in the Collection table, all ACMS processes on the target node will begin collecting run-time data, and a success message will be displayed. 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.26 ACMSMGMT_SET_EXC_1

This procedure modifies the ACMS Application Execution Controller (EXC) Config class attributes.

Format

exc_status_rec *acmsmgmt_set_exc_1(exc_config_rec *exc_cfg_rec,CLIENT *cl)


Parameters

exc_cfg_rec

Type: Exc_config_rec
Access: Read  
Mechanism: By reference  
Usage: Structure that contains the following client identification and EXC table 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 of 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: Name of the application to update.
     
  audit_state, max_tasks, sp_mon_interval, max_servers, server_proc_dmpflag, transaction_timeout
  Type: Integer
  Access: Read
  Mechanism: By value
  Usage: Values to be updated. These fields correspond to the active fields of the same names in the EXC table (for example, max_tasks will update max_tasks_active). See Section 8.5 for a discussion of these fields. All fields in this record can be updated dynamically. Stored values cannot be changed for EXCs (application must be rebuilt).

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

Type: Struct exc_status_rec
Access: Write
Mechanism: By reference
Usage: Pointer to a union. The union contains either a failure code or a structure of type exc_config_rec_out, which contains status codes for each field, as well as a linked list of status messages associated with the update. See the Description section for a discussion of how to determine the update status for any field. The following are the contents of this union:
         
  status
  Type: Integer
  Access: Write
  Mechanism: By value
  Usage: Failure return code.
         
  data, data_warn
  Type: Exc_config_rec_out
  Access: Write
  Mechanism: By value
  Usage: Structure containing fields corresponding to the fields in the exc_config_rec structure, as well as a linked list of status messages associated with the update. See the Description section for a discussion of how to determine the update status for any field. The following are the contents of this structure:
         
    audit_state, max_tasks, sp_mon_interval, max_servers, server_proc_dmpflag, transaction_timeout
    Type: Integer
    Access: Write
    Mechanism: By value
    Usage: Status fields corresponding to the fields in the input argument.
         
    cmd_output
    Type: Dcl_list
    Access: Write
    Mechanism: By reference
    Usage: Pointer to a linked list of records containing status messages related to the failure of any updates. This structure contains the following fields:
         
      dcl_msg
      Type: Null-terminated string
      Access: Write
      Mechanism: By reference
      Usage: The status message.
         
      pNext
      Type: Dcl_list
      Access: Write
      Mechanism: By reference
      Usage: Pointer to the next node in the linked list.

Description

This procedure requests updates to ACMS EXC Config class fields contained in the EXC table (see Section 8.5). Note that the EXC table contains both active and stored values; however, only the active fields can be changed. In order to change the stored values, the application must be rebuilt.

For any nonnegative integer fields, the completion status of the update is returned in the corresponding field in the return structure.


Example


int set_exc_data(int client_id,CLIENT *cl) 
 { 
 
   static char vr_appl[] = "VR_APPL"; 
   static exc_config_rec set_struct; 
   static exc_status_rec *ret_struct; 
   dcl_link    *nl; 
   
   memset(&set_struct,-1,sizeof(set_struct)); 
 
   set_struct.client_id      = client_id; 
   set_struct.audit_state    = MGMT_STATE_DISABLED; 
   set_struct.appl_name      = vr_appl; 
 
   ret_struct = acmsmgmt_set_exc_1(&set_struct,cl); 
 
   if (!ret_struct) { 
        printf("\n Call to modify exc failed"); 
        return(MGMT_FAIL); 
   } 
 
   if (ret_struct->status != MGMT_SUCCESS) 
      printf("\n Call to modify EXC returned the following warnings or 
errors\n"); 
   else 
      printf("\n Call to modify EXC completed\n"); 
 
   for (nl = ret_struct->exc_status_rec_u.data.cmd_output; nl != NULL; nl = 
nl->pNext) 
     printf("\n %s",nl->dcl_msg); 
 
   return(0); 
} 
      

In the preceding example, the acmsmgmt_set_exc_1 procedure is called to disable application auditing for the application VR_APPL on the target node. If the call succeeds, the VR_APPL no longer writes application auditing messages, and a success message is displayed. 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.


Previous Next Contents Index