Compaq ACMS for OpenVMS
Remote Systems Management Guide


Previous Contents Index

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 7-1 and Table 7-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 7-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 6.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 7-7).

Additions to the Trap table are processed immediately, and may affect more than one ACMS process. See Section 6.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; 
   static struct trap_status_rec *status_rec; 
   
   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 modify 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); 
      return(MGMT_FAIL); 
   } 
   else 
      printf("\nCall to add trap was executed"); 
 
   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 5.3.1 shows how to declare and initialize the input arguments to this procedure.

7.4 ACMSMGMT_DELETE_COLLECTION_1

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

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: iInteger
  Access: Read
  Mechanism: By value
  Usage: The type of ACMS entity the process is. Entity types are listed in Table 7-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 7-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 8.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 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.

ID and Config class rows cannot be deleted, They can be disabled using the acmsmgmt_set_collection_1 procedure.

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 4.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 int *status; 
   static coll_del_rec set_struct; 
   
   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); 
 return(MGMT_FAIL); 
   } 
   else 
 printf("\nCall to delete collection was executed"); 
 
   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 5.3.1 shows how to declare and initialize the input arguments to this procedure.

7.5 ACMSMGMT_DELETE_TRAP_1

This procedure deletes entries from the Remote Manager Trap table. Trap table entries can also be added (see Section 7.3) and updated (see Section 7.31).

Format

int *acmsmgmt_delete_trap_1(trap_del_rec *set_struct,CLIENT *cl)


Parameters

set_struct

Type: Trap_del_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 for client_id is 0, proxy access is used. Client_id is obtained by calling the acms$mgmt_get_creds procedure.
     
  entity_type
  Type: iInteger
  Access: Read
  Mechanism: By value
  Usage: The type of ACMS entity the process is. Entity types are listed in Table 7-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 (*, !).
     
  param_to_trap
  Type: Integer
  Access: Read
  Mechanism: By value
  Usage: The type of parameter to be monitored for trap conditions. Parameter types are listed in Table 7-8.

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 rows from the Trap table (see Section 8.12).

Calls to this procedure must specify entity_type, entity_name, and param_to_trap. These fields must exactly match an existing record in the Trap table for the delete to be performed. Table 7-1 and Table 7-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 7-8.

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


Example


int delete_trap_data(int client_id,CLIENT *cl) 
 { 
 
   static char c_name_all[2] = "*"; 
   static int *status; 
   static trap_del_rec set_struct; 
   
   set_struct.entity_type     = MGMT_ACC; 
   set_struct.entity_name     = c_name_all; 
   set_struct.param_to_trap   = MGMT_EXISTS; 
 
   status = acmsmgmt_delete_trap_1(&set_struct,cl); 
 
   if (!status) { 
        printf("\n Call to modify trap failed"); 
        return(MGMT_FAIL); 
   } 
 
   if (*status != MGMT_SUCCESS) { 
      printf("\nCall to delete trap failed with status %d",*status); 
      return(MGMT_FAIL); 
   } 
   else 
      printf("\nCall to delete trap was executed"); 
 
   return(0); 
} 
      

In the preceding example, the acmsmgmt_delete_trap_1 procedure is called to delete a row from the Trap table. The row to be deleted contains an entity type of ACC, an entity name of * (all), and a trap parameter of EXISTS. If the call succeeds, the trap is deleted from the Trap 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.6 ACMSMGMT_GET_ACC_1

ACMS Remote Manager clients call this procedure to obtain class information about an ACMS Central Controller (ACC) on a local or remote node.

Format

acc_rec_out *acmsmgmt_get_acc_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

acc_rec_out

Type: Acc_rec union
Access: Write
Mechanism: By reference
Usage: Pointer to record returned. If NULL, the RPC has failed. If not null, the record contains either an error code in the status field (the RPC succeeded, but the call failed for another reason) or the data requested.

Description

This procedure obtains class information about an ACC. The return pointer points to a record of type acc_rec_out, which is a union containing either a status code, or a pointer to an ACC record. See Section 8.2 for a description of the fields in the ACC record.

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


Example


int get_acc_data(int client_id,CLIENT *cl) 
 { 
 
   acc_rec_r      *accs; 
   acc_rec_out    *acc_rec; 
   static struct sub_id_struct sub_rec; 
   
   sub_rec.client_id = client_id; 
 
   acc_rec = acmsmgmt_get_acc_1(&sub_rec,cl); 
 
   if (!acc_rec) { 
 printf("\n RPC Call to get acc data failed"); 
        return(MGMT_FAIL); 
   } 
 
   if (acc_rec->status != MGMT_SUCCESS) { 
 printf("\n Call to get acc data failed, returning status code 
%d",acc_rec->status); 
        return(acc_rec->status); 
   } 
   
   accs = &acc_rec->acc_rec_out_u.acc_rec; 
   printf("\n Acc version is %s",accs->acms_version); 
 
   return(0); 
 
} 
      

In the preceding example, the acmsmgmt_get_acc_1 procedure is called to fetch ACC management information. If the call succeeds, the ACC version is printed from the retreived record. 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