Compaq ACMS for OpenVMS
Remote Systems Management Guide


Previous Contents Index

8.4 ACMSMGMT_ADD_ERR_FILTER_2

This procedure adds entries to the ACMS Error Filter table. Error Filter table entries can also be deleted (see Section 8.7.


Format

error_filter_config_rec_r_2 *acmsmgmt_add_err_filter_2(err_filter_config_rec_r_2 *err_filter_cfg_rec,CLIENT *cl2)


Parameters

err_filter_cfg_rec

Type: Err_filter_config_rec_r_2
Access: Read  
Mechanism: By reference  
Usage: Structure that contains the following client identification and Error Filter 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.
     
  error_code
  Type: Integer
  Access: Read
  Mechanism: By value
  Usage: Structure containing an Error Filter table record. Error Filter table fields are described in Section 9.5. See the Description section for information on how to initialize this record.

cl2

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: Err_filter_status_rec
Access: Write  
Mechanism: By reference  
Usage: Pointer to a record that contains a union consisting of either a failure code or a structure of type err_filter_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: Err_filter_update_rec_r
  Access: Write
  Mechanism: By value
  Usage: Structure containing an Error Filter table record. The entries in this field contain status codes corresponding to the fields in the err_filter_entry structure. See the Description section for a discussion of how to determine the update status for any field.

Description

This procedure adds a row to the Error Filter table (see Section 9.5).

Additions to this table are durable; that is, they do survive a restart of the Remote Manager.

Calls to this procedure must specify a valid message_code for the row to be added.

The Error Filter table is dynamic and does not have a fixed upper boundary. The size of the table fluctuates as entries are added and deleted. When a row becomes empty or unoccupied, it is removed and the remaining rows are renumbered.

Additions to the Error Filter table are processed immediately, and may affect more than one ACMS process. See Section 5.1 for a discussion of how the Error Filter table affects ACMS error logging.


Example


int add_err_filter(int client_id,CLIENT *cl2) 
 { 
 
   int *status; 
   err_filter_config_rec_r_2 set struct; 
   
   set_struct.client_id                  = client_id; 
   set_struct.err_code                   = 16637820; 
 
   status = acmsmgmt_add_err_filter_2(&set_struct,cl2); 
 
   if (!status) { 
      printf("\n Call to add filter failed"); 
      return(MGMT_FAIL); 
   } 
 
   if (*status != MGMT_SUCCESS) { 
      printf("\nCall to add error filter failed with status %d", *status); 
        free(status); 
      return(MGMT_FAIL); 
   } 
   else { 
      printf("\nCall to add error filter was executed"); 
   } 
     free(status); 
   return(0); 
} 
 
      

In the preceding example, the acmsmgmt_add_err_filter_2 procedure is called to add a row to the Error Filter table. If the call succeeds, the filter is added to the Error Filter table. Otherwise, an error message is displayed. The example in Section 6.4.1 shows how to declare and initialize the input arguments to this procedure.

8.5 ACMSMGMT_ADD_TRAP_1

This procedure adds entries to the Remote Manager Trap table. Trap table entries can also be modified (see Section 8.40) and deleted (see Section 8.8).

Format

trap_status_rec *acmsmgmt_add_trap_1(trap_config_rec *set_struct,CLIENT *cl)


Parameters

set_struct

Type: Trap_config_rec
Access: Read  
Mechanism: By reference  
Usage: Structure that contains the following client identification and Trap 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.
     
  trap_entry
  Type: Trap_update_rec_r
  Access: Read
  Mechanism: By value
  Usage: Structure containing a Trap table record. Trap table fields are described in Section 9.13. 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: Trap_status_rec
Access: Write  
Mechanism: By reference  
Usage: Pointer to a record that contains a union consisting of either a failure code or a structure of type trap_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: Trap_update_rec_r
  Access: Write
  Mechanism: By value
  Usage: Structure containing a Trap table record. The entries in this field contain status codes corresponding to the fields in the trap_entry structure. See the Description section for a discussion of how to determine the update status for any field.

Description

This procedure adds a row to the Trap table (see Section 9.13).

Additions 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 Trap table, use the ACMSCFG utility.

Calls to this procedure must specify entity_type, entity_name, and param_to_trap. The combination of these fields must be unique within the Trap table for the row to be added. Table 8-1 and Table 8-4 contain symbolic values used to populate the collection_class and entity_type fields; symbolic values to the param_to_trap field are described in Table 8-8.

Setting fields trap_min, trap_max and/or severity to -1 causes them to be ignored when trap conditions are evaluated at run time; see Section 7.8 for more discussion. Otherwise, they must contain valid values for the row to be added (trap_min and trap_max must be position numbers; severity must be one of the valid severities listed in Table 8-7).

Additions to the Trap table are processed immediately, and may affect more than one ACMS process. See Section 7.8 for a discussion of how to set SNMP traps.

The size of the Trap table is unbounded.


Example


int add_trap_data(int client_id,CLIENT *cl) 
 { 
 
   static char c_name_all[2] = "*"; 
   static trap_config_rec        set_struct; 
   struct trap_status_rec        *status_rec; 
   
   set_struct.client_id                  = client_id; 
   set_struct.trap_entry.entity_type     = MGMT_ACC; 
   set_struct.trap_entry.entity_name     = c_name_all; 
   set_struct.trap_entry.param_to_trap   = MGMT_EXISTS; 
   set_struct.trap_entry.min             = -1; 
   set_struct.trap_entry.max             = 0; 
   set_struct.trap_entry.severity        = MGMT_SEV_ERR; 
 
   status_rec = acmsmgmt_add_trap_1(&set_struct,cl); 
 
   if (!status_rec) { 
      printf("\n Call to add trap failed"); 
      return(MGMT_FAIL); 
   } 
 
   if (status_rec->status == MGMT_WARN) { 
      printf("\nThe following fields are invalid: "); 
      if (status_rec->trap_status_rec_u.data_warn.entity_type  == MGMT_FAIL) 
          printf("\n     entity_type not found or invalid"); 
      if (status_rec->trap_status_rec_u.data_warn.param_to_trap == MGMT_FAIL) 
          printf("\n     param not found or invalid"); 
      if (status_rec->trap_status_rec_u.data_warn.min   == MGMT_FAIL) 
          printf("\n     min invalid"); 
      if (status_rec->trap_status_rec_u.data_warn.max   == MGMT_FAIL) 
          printf("\n     max invalid"); 
      if (status_rec->trap_status_rec_u.data_warn.severity  == MGMT_FAIL) 
          printf("\n     severity invalid"); 
     } 
   else if (status_rec->status != MGMT_SUCCESS) { 
      printf("\nCall to add trap failed with status %d", 
             status_rec->trap_status_rec_u.rc); 
        xdr_free(xdr_trap_status_rec, status_rec); 
        free(status_rec); 
      return(MGMT_FAIL); 
   } 
   else 
      printf("\nCall to add trap was executed"); 
        xdr_free(xdr_trap_status_rec, status_rec); 
        free(status_rec); 
    return(0); 
} 
 
      

In the preceding example, the ACMSMGMT_ADD_TRAP_1 procedure is called to add a row to the Trap table. The new row will contain an entity type of ACC, an entity name of * (all), and a trap parameter of EXISTS. The value of the trap_min field is -1 (ignored), and the value of the trap_max field is 0. The severity of the trap will be error. The effect of this addition is to cause an error-level trap to be generated whenever the ACC is started on the target node. If the call succeeds, the trap is added to the Trap table. Otherwise, an error message is displayed. The example in Section 6.4.1 shows how to declare and initialize the input arguments to this procedure.

8.6 ACMSMGMT_DELETE_COLLECTION_1

This procedure deletes entries from the Remote Manager Collection table. Collection table entries can also be added (see Section 8.3) and updated (see Section 8.33).

Format

int *acmsmgmt_delete_collection_1(coll_del_rec *set_struct,CLIENT *cl)


Parameters

set_struct

Type: Coll_del_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.
     
  entity_type
  Type: Integer
  Access: Read
  Mechanism: By value
  Usage: The type of ACMS entity the process is. Entity types are listed in Table 8-4.
     
  entity_name
  Type: Null-terminated string
  Access: Read
  Mechanism: By reference
  Usage: Pointer to a character string containing a full or partial entity name. May contain wildcard characters (*, !).
     
  collection_class
  Type: Integer
  Access: Read
  Mechanism: By value
  Usage: The type of collection class to delete. Collection classes are listed in Table 8-1.

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 a status code containing a success or failure status code. MGMT_SUCCESS indicates success. Other values indicate failure.

Description

This procedure deletes a row from the Collection table (see Section 9.3).

Calls to this procedure must specify entity_type, entity_name, and collection_class. The combination of these fields must exactly match an existing row in the table for the row to be deleted. Table 8-1 and Table 8-4 contain symbolic values used to populate the collection_class and entity_type fields; entity_name is specified as a null-terminated string.

ID and CONFIG class rows cannot be deleted.

The Collection table contains a fixed number of rows, which is determined by the Remote Manager Parameter table field total_entity_slots. This is a nondynamic parameter and requires a restart of the ACMS system in order to be changed. The default is 20 rows. When a row is deleted, it becomes immediately available for reuse.

Deletions from the collection table are processed immediately, and may affect more than one ACMS process. See Section 5.1 for a discussion of how the Collection table affects ACMS data collection.


Example


int delete_collection_data(int client_id,CLIENT *cl) 
 { 
 
   static char c_name_all[] = "*"; 
   static coll_del_rec set_struct; 
   int *status; 
   
   set_struct.client_id         = client_id; 
   set_struct.entity_type       = MGMT_ALL; 
   set_struct.entity_name       = c_name_all; 
   set_struct.collection_class  = MGMT_CLASS_RT; 
 
   status = acmsmgmt_delete_collection_1(&set_struct,cl); 
 
   if (!status) { 
      printf("\n Call to delete collection failed"); 
      return(MGMT_FAIL); 
   } 
 
   if (*status != MGMT_SUCCESS) { 
      printf("\n Call to delete collection failed with status %d",*status); 
        free (status); 
      return(MGMT_FAIL); 
   } 
   else 
      printf("\nCall to delete collection was executed"); 
        free (status); 
      return(0); 
} 
 
      

In the preceding example, the ACMSMGMT_DELETE_COLLECTION_1 procedure is called to delete a row from the Collection table. The row deleted is for entity type of * (all), entity name of * (all), and a collection class of RUNTIME. If the call succeeds, the collection table row is deleted, and the RUNTIME collection state for some processes may be changed depending on the collection state of the row before it was deleted. Otherwise, an error message is displayed. The example in Section 6.4.1 shows how to declare and initialize the input arguments to this procedure.


Previous Next Contents Index