View Source snmp_target_mib (snmp v5.18)

Instrumentation Functions for SNMP-TARGET-MIB

The module snmp_target_mib implements the instrumentation functions for the SNMP-TARGET-MIB, and functions for configuring the database.

The configuration files are described in the SNMP User's Manual.

Legacy API functions add_addr/10 that does not specify transport domain, and add_addr/11 that has got separate IpAddr and PortNumber arguments still work as before for backwards compatibility reasons.

DATA TYPES

See the data types in snmpa_conf.

Summary

Types

Note

"The maximum message size value associated with an entry in the snmpTargetAddrTable.".

Note

"The locally arbitrary, but unique identifier associated with this snmpTargetAddrEntry."

Note

"The value of this object identifies an entry in the snmpTargetParamsTable."

Note

"This object specifies a default number of retries to be attempted when a response is not received for a generated message."

Note

"An octet string containing a list of tag values. Tag values are preferably in human-readable form."

Note

"An octet string containing a tag value. Tag values are preferably in human-readable form."

Note

"The mask value associated with an entry in the snmpTargetAddrTable. The value of this object must have the same length as the corresponding instance of snmpTargetAddrTAddress, or must have length 0."

Functions

Adds a target address definition to the agent config. Equivalent to one line in the target_addr.conf file.

Adds a target parameter definition to the agent config. Equivalent to one line in the target_params.conf file.

This function is called from the supervisor at system start-up.

Delete a target address definition from the agent config.

Delete a target parameter definition from the agent config.

Inserts all data in the configuration files into the database and destroys all old data, including the rows with StorageType nonVolatile. The rows created from the configuration file will have StorageType nonVolatile.

Changes the engine id for a target in the snmpTargetAddrTable. If notifications are sent as Inform requests to a target, its engine id must be set.

Types

-type mms() :: 484..65535.

Note

"The maximum message size value associated with an entry in the snmpTargetAddrTable.".

Integer32 (484..65535)

-type name() :: snmp_framework_mib:admin_string().

Note

"The locally arbitrary, but unique identifier associated with this snmpTargetAddrEntry."

SnmpAdminString (SIZE(1..32))

-type params() :: snmp_framework_mib:admin_string().

Note

"The value of this object identifies an entry in the snmpTargetParamsTable."

SnmpAdminString (SIZE(1..32))

-type retry_count() :: 0..255.

Note

"This object specifies a default number of retries to be attempted when a response is not received for a generated message."

Integer32 (0..255)

-type tag_list() :: string().

Note

"An octet string containing a list of tag values. Tag values are preferably in human-readable form."

"To facilitate internationalization, this information is represented using the ISO/IEC IS 10646-1 character set, encoded as an octet string using the UTF-8 character encoding scheme described in RFC 2279."

OCTET STRING (SIZE (0..255))

-type tag_value() :: string().

Note

"An octet string containing a tag value. Tag values are preferably in human-readable form."

OCTET STRING (SIZE (0..255))

-type tmask() :: snmpa_conf:transportAddressMask().

Note

"The mask value associated with an entry in the snmpTargetAddrTable. The value of this object must have the same length as the corresponding instance of snmpTargetAddrTAddress, or must have length 0."

OCTET STRING (SIZE (0..255))

Functions

-spec add_addr(Name, TDomain, TAddr, Timeout, Retry, TagList, Params, EngineId, TMask, MMS) ->
                  {ok, Key} | {error, Reason}
                  when
                      Name :: name(),
                      TDomain :: snmpa_conf:transportDomain(),
                      TAddr :: snmpa_conf:transportAddress(),
                      Timeout :: snmp:time_interval(),
                      Retry :: integer(),
                      TagList :: tag_list(),
                      Params :: params(),
                      EngineId :: snmp_framework_mib:engine_id(),
                      TMask :: tmask(),
                      MMS :: snmp_framework_mib:max_message_size(),
                      Key :: term(),
                      Reason :: term();
              (Name, Ip, Port, Timeout, Retry, TagList, Params, EngineId, TMask, MMS) ->
                  {ok, Key} | {error, Reason}
                  when
                      Name :: name(),
                      Ip :: snmpa_conf:transportAddressWithoutPort(),
                      Port :: inet:port_number(),
                      Timeout :: snmp:time_interval(),
                      Retry :: integer(),
                      TagList :: tag_list(),
                      Params :: params(),
                      EngineId :: snmp_framework_mib:engine_id(),
                      TMask :: tmask(),
                      MMS :: snmp_framework_mib:max_message_size(),
                      Key :: term(),
                      Reason :: term().

Adds a target address definition to the agent config. Equivalent to one line in the target_addr.conf file.

Link to this function

add_params(Name, MPModel, SecModel, SecName, SecLevel)

View Source
-spec add_params(Name, MPModel, SecModel, SecName, SecLevel) -> {ok, Key} | {error, Reason}
                    when
                        Name :: name(),
                        MPModel :: snmp_framework_mib:message_processing_model(),
                        SecModel :: snmp_framework_mib:security_model(),
                        SecName :: snmp_framework_mib:admin_string(),
                        SecLevel :: snmp_framework_mib:security_level(),
                        Key :: term(),
                        Reason :: term().

Adds a target parameter definition to the agent config. Equivalent to one line in the target_params.conf file.

-spec configure(ConfDir) -> snmp:void() when ConfDir :: string().

This function is called from the supervisor at system start-up.

Inserts all data in the configuration files into the database and destroys all old rows with StorageType volatile. The rows created from the configuration file will have StorageType nonVolatile.

All snmp counters are set to zero.

If an error is found in the configuration file, it is reported using the function config_err/2 of the error report module, and the function fails with the reason configuration_error.

ConfDir is a string which points to the directory where the configuration files are found.

The configuration files read are: target_addr.conf and target_params.conf.

-spec delete_addr(Key) -> ok | {error, Reason} when Key :: term(), Reason :: term().

Delete a target address definition from the agent config.

-spec delete_params(Key) -> ok | {error, Reason} when Key :: term(), Reason :: term().

Delete a target parameter definition from the agent config.

-spec reconfigure(ConfDir) -> snmp:void() when ConfDir :: string().

Inserts all data in the configuration files into the database and destroys all old data, including the rows with StorageType nonVolatile. The rows created from the configuration file will have StorageType nonVolatile.

Thus, the data in the SNMP-TARGET-MIB, after this function has been called, is the data from the configuration files.

All snmp counters are set to zero.

If an error is found in the configuration file, it is reported using the function config_err/2 of the , and the function fails with the reason configuration_error.

ConfDir is a string which points to the directory where the configuration files are found.

The configuration files read are: target_addr.conf and target_params.conf.

Link to this function

set_target_engine_id(TargetAddrName, EngineId)

View Source
-spec set_target_engine_id(TargetAddrName, EngineId) -> boolean()
                              when TargetAddrName :: name(), EngineId :: snmp_framework_mib:engine_id().

Changes the engine id for a target in the snmpTargetAddrTable. If notifications are sent as Inform requests to a target, its engine id must be set.