snmp_trap_register_im()


Maintain a list of SNMP managers that receive PATROL SNMP traps.

Syntax

snmp_trap_register_im(host/[port/community],[action])

Parameter

Parameter

Definition

host

name of the computer whose SNMP manager will be added to or deleted from the list of SNMP managers that receive PATROL SNMP traps

port

Universal Datagram Protocol (UDP) port number on which the SNMP agent socket opens

*Default* 
162

community

name of the character string used as a community string for SNMP operations

*Default* 
public

action

character string identifying an action performed against host/port/community in the list of SNMP managers that receive PATROL SNMP traps 

Valid Values

  • list -- return the list of SNMP managers that receive SNMP traps
  • add -- add " host / port / community " to the list of SNMP managers that receive PATROL SNMP traps
  • delete -- remove " host / port / community " from the list of SNMP managers that receive PATROL SNMP traps

Default
list|

 

Description

The snmp_trap_register_im() function creates and maintains a list of SNMP V1 managers that receive PATROL SNMP traps. The list is stored in piV1mTable in the PATROL Management Information Base (MIB). 

The snmp_trap_register_im() function returns the following:

  • OK string if successful for an add or delete operation
  • the list of registered SNMP managers for the list operation
  • the NULL string if an error occurs

The snmp_trap_register_im() function can also set the PSL variable errno = 96 (E_PSL_BAD_FUNCTION_PARAMETER) upon encountering a parameter error.

Example

These examples show how to use the snmp_trap_register_im() function.

Return the List of SNMP Managers

Each of the following commands returns the list of registered SNMP managers:

 

snmp_trap_register_im();
snmp_trap_register_im("myhost","list");

 

The list action in the second line causes the PSL interpreter to ignore the myhost host name.

Add an SNMP Manager to the List

The following command adds the SNMP manager identified by myhost/162/public to the list of SNMP managers that receive PATROL SNMP traps:

 

snmp_trap_register_im("myhost","add");

 

The port, 162, and community, public, are defaults and do not need to be specified in the command syntax.

Delete an SNMP Manager from the List

The following command will delete the SNMP manager identified by myhost/162/defaultcommunity from the list of SNMP managers that receive PATROL SNMP traps:

 

snmp_trap_register_im("myhost/162/defaultcommunity",delete);