Compaq ACMS for OpenVMS
Remote Systems Management Guide


Previous Contents Index

7.27 ACMSMGMT_SET_INTERFACE_1

This procedure modifies the status of a Remote Manager interface. Either the SNMP or RPC interface can be modified.

Note

The ACMS Remote Manager will not allow the RPC interface to be DISABLED through this call. The only way to disable the RPC interface dynamically is to use the SNMP interface.

Format

int *acmsmgmt_set_interface_1(interface_config_rec *if_cfg_rec,CLIENT *cl)


Parameters

if_cfg_rec

Type: Interface_config_rec
Access: Read  
Mechanism: By reference  
Usage: Structure that contains the following client identification and interface configuration 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.
     
  interface_type
  Type: Integer
  Access: Read
  Mechanism: By value
  Usage: Indicates the interface to be modified. Table 7-2 shows the valid symbolic values for interface types.
     
  state
  Type: Integer
  Access: Read
  Mechanism: By value
  Usage: Indicates desired state of the interface. Table 7-3 shows the valid symbolic values for the allowable states.

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: Integer
Access: Write
Mechanism: By reference
Usage: Pointer to status value returned. If NULL or MGMT_SUCCESS, the RPC has succeeded. If neither NULL nor MGMT_SUCCESS, the procedure call failed and the value pointed to is the reason for failure.

Description

This procedure modifies the status of an interface. Interfaces can be enabled (that is, requested to start) or disabled (that is, requested to stop) by setting the state field in if_cfg_rec to the appropriate value.

Note that it is not possible to use the RPC interface to enable the RPC interface. In order to use the RPC interface, it must already be enabled. In order to start the RPC interface, either use the SNMP interface, or use the ACMSCFG utility to configure the RPC interface to be enabled when the Remote Manager starts up.

It is also not possible to use this call to disable the RPC interface. The ACMS Remote Manager does not allow an interface to disable itself. The only way to disable the RPC interface dynamically is to use the SNMP interface.


Example


int set_interface_data(int client_id,CLIENT *cl) 
 { 
 
   static interface_config_rec set_struct; 
   static int *status; 
   
   memset(&set_struct,-1,sizeof(set_struct)); 
 
   set_struct.client_id = client_id; 
   set_struct.interface_type = MGMT_IF_SNMP; 
   set_struct.state = MGMT_STATE_ENABLED; 
 
   status = acmsmgmt_set_interface_1(&set_struct,cl); 
 
   if (!status) { 
      printf("\n Call to update SNMP interface failed"); 
      return(MGMT_FAIL); 
   } 
 
   if (*status != MGMT_SUCCESS) { 
      printf("\n Call to update SNMP interface failed with status %d",*status); 
      return(MGMT_FAIL); 
   } 
   else 
      printf("\n Call to set SNMP interface completed"); 
 
   return(0); 
} 
      

In the preceding example, the acmsmgmt_set_interface_1 procedure is called to enable the SNMP interface. If the call succeeds, the SNMP interface is running 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.28 ACMSMGMT_SET_PARAM_1

This procedure requests updates to fields in the Remote Manager Parameter table.

Format

param_status_rec *acmsmgmt_set_param_1(param_config_rec *param_cfg_rec,CLIENT *cl)


Parameters

param_cfg_rec

Type: Param_config_rec
Access: Read  
Mechanism: By reference  
Usage: Structure that contains the following client identification and parameter configuration 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.
     
  params
  Type: Struct param_rec
  Access: Read
  Mechanism: By value
  Usage: Structure containing a Parameter table record. Parameter table fields are described in Section 8.8. 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 param_status_rec
Access: write  
Mechanism: By reference  
Usage: Pointer to a union. The union either contains a failure code or a structure of type param_rec, 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, data_warn
  Type: Param_rec
  Access: write
  Mechanism: By value
  Usage: Structure containing a Parameter table record. The entries in this field contain status codes correspond to the fields in the params 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 Parameter table (see Section 8.8). Some field updates are dynamic; others are not. Updates to this table are not durable; that is, they do not survive a restart of the Remote Manager.

When this procedure is called, any fields with negative values are ignored. Callers should initialize any fields to a negative value (for example, -1) for which updates are not to be applied. All nonnegative fields are validated prior to being updated.

For any nonnegative fields, the completion status of the update is returned in the corresponding field in the return structure. For instance, if the mss_coll_interval and max_logins fields in the params structure of the param_config_rec are nonnegative when this procedure is called, the mss_coll_interval and max_logins field of the data or data_warn structures of the param_status_rec will contain the completion status for those updates.

The data and data_warn structures contain identical data. If the operation fails, the status field of either structure is MGMT_WARN; in this case, use the data_warn structure to fetch the status messages from the cmd_output linked list.

If the operation is successful, the status field of either structure is MGMT_SUCCESS. There are no status messages associated with a successful call.

If the status field contains MGMT_FAIL, the call failed. There are no status messages returned; instead, the reason for the failure is contained in the rc field.


Example


int set_param_data(int client_id,CLIENT *cl) 
 { 
 
   static param_config_rec set_struct; 
   static param_status_rec *ret_struct; 
   
   memset(&set_struct,-1,sizeof(set_struct)); 
 
   set_struct.client_id = client_id; 
   set_struct.params.max_logins = 25; 
 
   ret_struct = acmsmgmt_set_param_1(&set_struct,cl); 
 
   if (!ret_struct) 
        return(MGMT_FAIL); 
 
   if (ret_struct->status != MGMT_SUCCESS) { 
 
   if (ret_struct->status != MGMT_WARN) { 
       printf("\nCall to modify parameters failed, returning 
%d",ret_struct->status); 
       return(MGMT_FAIL); 
     } 
 
   if (ret_struct->param_status_rec_u.data.max_logins  != MGMT_SUCCESS) 
       printf("\n max_logins specified was invalid "); 
       return(MGMT_FAIL); 
    } 
   else 
      printf("\n Call to set params completed"); 
 
   return(0); 
} 
      

In the preceding example, the acmsmgmt_set_param_1 procedure is called to set the maximum number of logins to the Remote Manager to 25. If the call succeeds, the new value will be stored in the Parameter table 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.29 ACMSMGMT_SET_QTI_1

This procedure modifies Queued Task Initator (QTI) Config class attributes.

Format

qti_status_rec *acmsmgmt_set_qti_1(qti_config_rec *qti_cfg_rec,CLIENT *cl)


Parameters

qti_cfg_rec

Type: Qti_config_rec
Access: Read  
Mechanism: By reference  
Usage: Structure that contains the following client identification and QTI 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.
     
  active_sw
  Type: Integer
  Access: Read
  Mechanism: By value
  Usage: Indicates whether active variables should be updated (active_sw = 1). Active variables are currently in use by the ACMS system; updates to active variables take effect immediately but are not durable (that is, they do not survive a restart of the ACMS system). Not all variables are dynamic, however. Refer to Section 8.9 and to the field descriptions in this section, to determine whether a particular variable can be updated dynamically.
     
  current_sw
  Type: Integer
  Access: Read
  Mechanism: By value
  Usage: Indicates whether current variables should be updated (current_sw = 1). Current variables are those stored in the ACMSGEN file currently in use by the ACMS system and are durable (that is, they survive a restart of the ACMS system). Updates to current variables take effect when the ACMS system is restarted.
     
  qti_priority, max_threads, sub_timeout, retry_timer, polling_timer
  Type: Integer
  Access: Read
  Mechanism: By value
  Usage: Values to be updated. These fields correspond to fields of the same names in the QTI table, depending on the value of active_sw and current_sw in this record (for example, qti_priority will update the qti_priority_stored field if current_sw is equal to 1). See Section 8.9 for a discussion of these fields. Note that not all fields can be updated dynamically.
     
  qti_username
  Type: Null-terminated string
  Access: Read
  Mechanism: By reference
  Usage: Values to be updated. This field corresponds to the qti_username field in the QTI table; the exact field depends on the value of active_sw and current_sw in this record (for example, qti_username will update the qti_username_stored field if current_sw is equal to 1). See Section 8.9 for a discussion of these fields. Note that not all fields can be updated dynamically. In order to have this field set to null (that is, ""), set the field to the string "NULL".

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 qti_status_rec
Access: Write
Mechanism: By reference
Usage: Pointer to a union. The union contains either a failure code or a structure of type qti_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: Qti_config_rec_out
  Access: Write
  Mechanism: By value
  Usage: Structure containing fields corresponding to the fields in the qti_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:
         
    qti_priority, max_threads, sub_timeout, retry_timer, polling_timer
    Type: Integer
    Access: Write
    Mechanism: By value
    Usage: Status fields corresponding to the fields in the input argument.
         
    qti_username
    Type: Null-terminated string
    Access: Write
    Mechanism: By reference
    Usage: This field contains the value that was supplied in the input argument and can be ignored.
         
    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 QTI Config class fields contained in the QTI table (see Section 8.9). Note that the QTI table contains both active and stored values. The active_sw field and current_sw field control which fields should be updated.


Previous Next Contents Index