snmpa_conf(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

🌸 snmpa_conf(3) β€” Erlang Module Definition 🌸

okay so this is the manual page for snmpa_conf, bestie, and it's literally the glow-up toolkit for your SNMP agent's config files. Erlang module, group-chat energy, let's go. ✨


πŸ’– NAME πŸ’–

snmpa_conf β€” utility functions for handling the agent config files. that's it, that's the vibe. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so the module snmpa_conf is where all the little helper functions live β€” the ones you use to manipulate the config files of the SNMP agent. and by "manipulate" we mean write, read, and append. no cap. πŸ’…


✨ DATA TYPES ✨

ngl this section is giving "the lore drop" but it's important so stay with me. 🫢

  • -opaque agent_entry() β€” an opaque term that represents an entry in the 'agent' config.
  • -opaque community_entry() β€” an opaque term that represents an entry in the 'community' (agent) config.
  • -opaque context_entry() β€” an opaque term that represents an entry in the 'context' (agent) config.

extended_transport_address() is defined as:

extended_transport_address() :: {inet:ip_address(), port_info()}.

intAgentTransport() is defined as:

intAgentTransport() ::
          {transportDomain(), transport_address()} |
          {transportDomain(),
           extended_transport_address(),
           snmpa:transport_kind()} |
          {transportDomain(),
           extended_transport_address(),
           transport_opts()} |
          {transportDomain(),
           extended_transport_address(),
           snmpa:transport_kind(),
           transport_opts()}.

ip_address() is defined as:

ip_address() :: inet:ip_address() | snmp_ip_address().
  • -opaque notify_entry() β€” an opaque term that represents an entry in the 'notify' (agent) config.

port_info() is defined as:

port_info() :: inet:port_number() | system | range() | ranges().
⚠️ heads up bestie: port number 0 (zero) can't be specified directly β€” it's used internally βœ‹ β€” so don't even try it. instead you use the atom 'system'. periodt. πŸ’€

range() is defined as:

range() :: {Min :: inet:port_number(), Max :: inet:port_number()}.

and the rule is Min < Max. πŸŽ€

ranges() is defined as:

ranges() :: [inet:port_number() | range()].

snmp_ip_address() is defined as:

snmp_ip_address() :: [non_neg_integer()].
  • -opaque standard_entry() β€” an opaque term that represents an entry in the 'standard' (agent) config.
  • -opaque target_addr_entry() β€” an opaque term that represents an entry in the 'target address' (agent) config.
  • -opaque target_params_entry() β€” an opaque term that represents an entry in the 'target parameters' (agent) config.

transportAddress() is defined as:

transportAddress() ::
          transportAddressIPv4() | transportAddressIPv6().

transportAddressIPv4() is defined as:

transportAddressIPv4() ::
          transportAddressIPv4WithPort() |
          transportAddressIPv4WithoutPort().

transportAddressIPv4WithPort() is defined as:

transportAddressIPv4WithPort() ::
          {transportAddressIPv4WithoutPort(), inet:port_number()} |
          [byte()].

okay so the Erlang type language has limitations, bestie 😭 β€” we literally cannot define this type in full detail. so instead, here's the description. the list variant is 4 bytes for address + 2 bytes for port:

[byte() x 4, byte() x 2]

transportAddressIPv4WithoutPort() is defined as:

transportAddressIPv4WithoutPort() :: inet:ip4_address() | [byte()].

again, Erlang type language limitations, we can't spell it out β€” so here's the description. the list variant is 4 bytes for address:

[byte() x 4]

transportAddressIPv6() is defined as:

transportAddressIPv6() ::
          transportAddressIPv6WithPort() |
          transportAddressIPv6WithoutPort().

transportAddressIPv6WithPort() is defined as:

transportAddressIPv6WithPort() ::
          {transportAddressIPv6WithoutPort(), inet:port_number()} |
          [word() | inet:port_number()] |
          [word() | byte()] |
          [byte()].

and you guessed it β€” Erlang type language limitations, so description time. ✨

  • First list variant: 8 words for address + 1 word for port:
[word() x 8, inet:port_number()]
  • Second list variant: 8 words for address + 2 bytes for port:
[word() x 8, byte() x 2]
  • Third list variant: 16 bytes for address + 2 bytes for port:
[byte() x 16, byte() x 2]

transportAddressIPv6WithoutPort() is defined as:

transportAddressIPv6WithoutPort() ::
          inet:ip6_address() | [word()] | [byte()].

once more for the people in the back β€” Erlang type language limitations, so:

  • First list variant: 8 words for address:
[word() x 8]
  • Second list variant: 16 bytes for address:
[byte() x 16]

transportAddressMask() is defined as:

transportAddressMask() :: [] | transportAddressWithPort().

transportAddressWithPort() is defined as:

transportAddressWithPort() ::
          transportAddressIPv4WithPort() |
          transportAddressIPv6WithPort().

transportAddressWithoutPort() is defined as:

transportAddressWithoutPort() ::
          transportAddressIPv4WithoutPort() |
          transportAddressIPv6WithoutPort().

transportDomain() is defined as:

transportDomain() :: snmp:tdomain().

transport_address() is defined as:

transport_address() ::
          {ip_address(), inet:port_number()} | ip_address().

transport_opts() is defined as:

transport_opts() :: list().
  • -opaque usm_entry() β€” an opaque term that represents an entry in the 'user based sm' (agent) config.
  • -opaque vacm_acc_entry() β€” an opaque term that represents an (access) entry in the 'vacm access' (agent) config.

vacm_entry() is defined as:

vacm_entry() ::
          vacm_s2g_entry() | vacm_acc_entry() | vacm_vtf_entry().

basically an opaque term (well, basically opaque) that represents an entry in the 'view based acm' (agent) config. πŸ’…

  • -opaque vacm_s2g_entry() β€” an opaque term that represents a (security to group) entry in the 'vacm security to group' (agent) config.
  • -opaque vacm_vtf_entry() β€” an opaque term that represents a (tree family) entry in the 'vacm tree family' (agent) config.

word() is defined as:

word() :: 0..65535.

πŸ”₯ FUNCTIONS πŸ”₯

the main characters. let's meet them. πŸ‘‘


πŸŽ€ agent_entry(Tag, Val) -> AgentEntry

agent_entry(Tag, Val) -> AgentEntry
                     when
                         Tag ::
                             intAgentTransports | intAgentUDPPort |
                             snmpEngineMaxMessageSize | snmpEngineID,
                         Val :: term(),
                         AgentEntry :: agent_entry().

creates an entry for the agent config file, agent.conf. 🫢

the type of Val depends on the value of Tag, so pay attention bestie:

  • intAgentTransports: [snmpa_conf:intAgentTransport()] <mandatory>
  • intAgentUDPPort: inet:port_number() <optional>
  • snmpEngineMaxMessageSize: snmp_framework_mib:max_message_size() <mandatory>
  • snmpEngineID: snmp_framework_mib:engine_id() <mandatory>

see Agent Information for more info. ✨


πŸŽ€ append_agent_config(Dir, Conf) -> ok

append_agent_config(Dir, Conf) -> ok
                                 when
                                     Dir :: snmp:dir(),
                                     Conf :: [agent_entry()].

appends the config to the current agent config file. πŸ¦‹

Dir is the path to the directory where you're storing the config file.

see Agent Information for more info. ✨


πŸŽ€ append_community_config(Dir, Conf) -> ok

append_community_config(Dir, Conf) -> ok
                                     when
                                         Dir :: snmp:dir(),
                                         Conf :: [community_entry()].

appends the community config to the current agent community config file. πŸ’–

Dir is the path to the directory where you're storing the config file.

see Community for more info. ✨


πŸŽ€ append_context_config(Dir, Conf) -> ok

append_context_config(Dir, Conf) -> ok
                                   when
                                       Dir :: snmp:dir(),
                                       Conf :: [context_entry()].

appends the context config to the current agent context config file. 🌸

Dir is the path to the directory where you're storing the config file.

see Contexts for more info. ✨


πŸŽ€ append_notify_config(Dir, Conf) -> ok

append_notify_config(Dir, Conf) -> ok
                                  when
                                      Dir :: snmp:dir(),
                                      Conf :: [notify_entry()].

appends the notify config to the current agent notify config file. πŸ”” (okay that emoji isn't on the list but you get the vibe) πŸ’œ

Dir is the path to the directory where you're storing the config file.

see Notify Definitions for more info. ✨


πŸŽ€ append_standard_config(Dir, Conf) -> ok

append_standard_config(Dir, Conf) -> ok
                                    when
                                        Dir :: snmp:dir(),
                                        Conf :: [standard_entry()].

appends the standard config to the current agent standard config file. ⭐

Dir is the path to the directory where you're storing the config file.

see System Information for more info. ✨


πŸŽ€ append_target_addr_config(Dir, Conf) -> ok

append_target_addr_config(Dir, Conf) -> ok
                                       when
                                           Dir :: snmp:dir(),
                                           Conf :: [target_addr_entry()].

appends the target_addr config to the current agent target_addr config file. 🎯

Dir is the path to the directory where you're storing the config file.

see Target Address Definitions for more info. ✨


πŸŽ€ append_target_params_config(Dir, Conf) -> ok

append_target_params_config(Dir, Conf) -> ok
                                         when
                                             Dir :: snmp:dir(),
                                             Conf ::
    [target_params_entry()].

appends the target_params config to the current agent target_params config file. πŸ’…

Dir is the path to the directory where you're storing the config file.

see Target Parameters Definitions for more info. ✨


πŸŽ€ append_usm_config(Dir, Conf) -> ok

append_usm_config(Dir, Conf) -> ok
                               when Dir :: snmp:dir(), Conf ::
    [usm_entry()].

appends the usm config to the current agent usm config file. πŸ”

Dir is the path to the directory where you're storing the config file.

see Security data for USM for more info. ✨


πŸŽ€ append_vacm_config(Dir, Conf) -> ok

append_vacm_config(Dir, Conf) -> ok
                                when
                                    Dir :: snmp:dir(),
                                    Conf :: [vacm_entry()].

appends the vacm config to the current agent vacm config file. πŸ‘‘

Dir is the path to the directory where you're storing the config file.

see MIB Views for VACM for more info. ✨


πŸŽ€ community_entry(CommIndex) -> CommunityEntry

community_entry(CommIndex) -> CommunityEntry
                             when
                                 CommIndex ::
                                     snmp_framework_mib:admin_string(),
                                 CommunityEntry :: community_entry().

creates an entry for the agent community config file, community.conf. πŸ’–

⚠️ CommunityIndex must be a non-empty string. don't come in here with an empty string bestie, it's not the vibe. πŸ™ˆ

this function only accepts the following values of CommIndex:

  • "public" β€” translates to the following call:
community_entry(CommunityIndex, CommunityIndex, "initial", "", "").
  • "all-rights" β€” translates to the following call:
community_entry(CommunityIndex, CommunityIndex, CommunityIndex, "", "").

see Community for more info. ✨


…and that's part 1 bestie, more chaos incoming 🌈

🫢 community_entry

community_entry(CommIndex, CommName, SecName, CtxName, TransportTag) ->
    CommunityEntry
    when
        CommIndex :: snmp_community_mib:index(),
        CommName :: snmp_community_mib:name(),
        SecName :: snmp_community_mib:security_name(),
        CtxName :: snmp_community_mib:context_name(),
        TransportTag :: snmp_community_mib:transport_tag(),
        CommunityEntry :: community_entry().

Okay so this one makes you an entry for the agent community config file, community.conf. ✨

Quick lil rule: CommunityIndex has to be a non-empty string, no blank vibes allowed bestie. 🚫

Wanna know more? Go peek at Community. πŸ’–


πŸ¦‹ context_entry

context_entry(Ctx) -> ContextEntry
    when
        Ctx :: snmp_community_mib:context_name(),
        ContextEntry :: context_entry().

This builds you an entry for the agent context config file, context.conf. 🌸

More deets live in Contexts, go check it. 🫢


πŸ”” notify_entry

notify_entry(Name, Tag, Type) -> NotifyEntry
    when
        Name :: snmp_notification_mib:notify_name(),
        Tag :: snmp_notification_mib:notify_tag(),
        Type :: snmp_notification_mib:notify_type(),
        NotifyEntry :: notify_entry().

Entry for the agent notify config file, notify.conf. πŸ’Œ

And yeah β€” Name must be a non-empty string. Periodt. πŸ’…

Full lore is under Notify Definitions. πŸ‘‘


πŸ“– read_agent_config

read_agent_config(Dir) -> {ok, Conf} | {error, Reason}
    when
        Dir :: snmp:dir(),
        Conf :: [agent_entry()],
        Reason :: term().

Reads the current agent config file, literally just grabs it for you. πŸ“

Dir is the path to the directory where the config file lives. πŸ—‚οΈ

See Agent Information for the tea. πŸ«–


πŸ“– read_community_config

read_community_config(Dir) -> {ok, Conf} | {error, Reason}
    when
        Dir :: snmp:dir(),
        Conf :: [community_entry()],
        Reason :: term().

Reads the current agent community config file. πŸ’–

Dir = the path to the directory where the config file is stored. πŸ—‚οΈ

Communities has the details, iykyk. ✨


πŸ“– read_context_config

read_context_config(Dir) -> {ok, Conf} | {error, Reason}
    when
        Dir :: snmp:dir(),
        Conf :: [context_entry()],
        Reason :: term().

Reads the current agent context config file. 🌸

Dir is the path to the directory where the config file hangs out. πŸ—‚οΈ

Look at Contexts for more. πŸ¦‹


πŸ“– read_notify_config

read_notify_config(Dir) -> {ok, Conf} | {error, Reason}
    when
        Dir :: snmp:dir(),
        Conf :: [notify_entry()],
        Reason :: term().

Reads the current agent notify config file. πŸ””

Dir is the path to the directory where the config file is kept. πŸ—‚οΈ

See Notify Definitions for the full rundown. πŸ’œ


πŸ“– read_standard_config

read_standard_config(Dir) -> {ok, Conf} | {error, Reason}
    when
        Dir :: snmp:dir(),
        Conf :: [standard_entry()],
        Reason :: term().

Reads the current agent standard config file. ⭐

Dir is the path to the directory where the config file is stored. πŸ—‚οΈ

Check System Information for more. πŸ‘‘


πŸ“– read_target_addr_config

read_target_addr_config(Dir) -> {ok, Conf} | {error, Reason}
    when
        Dir :: snmp:dir(),
        Conf :: [target_addr_entry()],
        Reason :: term().

Reads the current agent target_addr config file. 🎯

Dir is the path to the directory where the config file lives. πŸ—‚οΈ

See Target Address Definitions for more. πŸ”₯


πŸ“– read_target_params_config

read_target_params_config(Dir) -> {ok, Conf} | {error, Reason}
    when
        Dir :: snmp:dir(),
        Conf :: [target_params_entry()],
        Reason :: term().

Reads the current agent target_params config file. 🎯

Dir is the path to the directory where the config file sits. πŸ—‚οΈ

See Target Parameters Definitions for more. ✨


πŸ“– read_usm_config

read_usm_config(Dir) -> {ok, Conf} | {error, Reason}
    when
        Dir :: snmp:dir(),
        Conf :: [usm_entry()],
        Reason :: term().

Reads the current agent usm config file. πŸ”

Dir is the path to the directory where the config file is parked. πŸ—‚οΈ

See Security data for USM for more. πŸ’…


πŸ“– read_vacm_config

read_vacm_config(Dir) -> {ok, Conf} | {error, Reason}
    when
        Dir :: snmp:dir(),
        Conf :: [vacm_entry()],
        Reason :: term().

Reads the current agent vacm config file. πŸ›‘οΈ

Dir is the path to the directory where the config file is chilling. πŸ—‚οΈ

See MIB Views for VACM for more. 🌈


⭐ standard_entry

standard_entry(Tag, Val) -> StandardEntry
    when
        Tag ::
            sysDescr | sysObjectID | sysContact |
            sysName | sysLocation | sysServices |
            snmpEnableAuthenTraps,
        Val :: term(),
        StandardEntry :: standard_entry().

Makes an entry for the agent standard config file, standard.conf. πŸ‘‘

Here's the thing bestie β€” the type of Val depends on what Tag you picked. So listen up: 🎧

  • sysDescr: string() <mandatory> β€” it's a DisplayString (SIZE(0..255))
  • sysObjectID: snmp:oid() <mandatory> β€” it's an OBJECT IDENTIFIER
  • sysContact: string() <mandatory> β€” it's a DisplayString (SIZE(0..255))
  • sysName: string() <mandatory> β€” it's a DisplayString (SIZE(0..255))
  • sysLocation: string() <mandatory> β€” it's a DisplayString (SIZE(0..255))
  • sysLocation: non_neg_integer() <mandatory> β€” "A value which indicates the set of services that this entity primarily offers." It's an INTEGER (0..127)
  • snmpEnableAuthenTraps: enabled | disabled <mandatory> β€” it's an INTEGER { enabled(1), disabled(2) }
Not me noticing that sysLocation shows up twice in that list πŸ’€ β€” I'm just reading the source, bestie, that's literally what it says. Don't come for me. πŸ™ˆ

See System Information for more. πŸ’–


🎯 target_addr_entry / 6

target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId) ->
    TargetAddrEntry
    when
        Name :: snmp_target_mib:name(),
        Domain :: transportDomain(),
        Addr :: transportAddress(),
        TagList :: snmp_target_mib:tag_list(),
        ParamsName :: snmp_target_mib:params(),
        EngineId :: snmp_framework_mib:engine_id(),
        TargetAddrEntry :: target_addr_entry();
(Name, IP, TagList, ParamsName, EngineId, TMask) ->
    TargetAddrEntry
    when
        Name :: snmp_target_mib:name(),
        IP :: inet:ip_address(),
        TagList :: snmp_target_mib:tag_list(),
        ParamsName :: snmp_target_mib:params(),
        EngineId :: snmp_framework_mib:engine_id(),
        TMask :: snmp_target_mib:tmask(),
        TargetAddrEntry :: target_addr_entry().

Creates an entry for the agent target_addr config file, target_addr.conf. 🎯

And yes, Name must be a non-empty string. No empty names, we don't do that here. πŸ’…

Real talk, here's the translation lore:

  • target_addr_entry/6 (1) turns into this call, lowkey just with an empty mask list appended:
target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId, [])
  • target_addr_entry/6 (2) turns into this call β€” with Domain and Addr built from IP and the default port number:
target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId, TMask, 2048)

See Target Address Definitions for more. ✨


🎯 target_addr_entry / 7

target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId, TMask) ->
    TargetAddrEntry
    when
        Name :: snmp_target_mib:name(),
        Domain :: transportDomain(),
        Addr :: transportAddress(),
        TagList :: snmp_target_mib:tag_list(),
        ParamsName :: snmp_target_mib:params(),
        EngineId :: snmp_framework_mib:engine_id(),
        TMask :: snmp_target_mib:tmask(),
        TargetAddrEntry :: target_addr_entry();
(Name, IP, Port, TagList, ParamsName, EngineId, TMask) ->
    TargetAddrEntry
    when
        Name :: snmp_target_mib:name(),
        IP :: inet:ip_address(),
        Port :: inet:port_number(),
        TagList :: snmp_target_mib:tag_list(),
        ParamsName :: snmp_target_mib:params(),
        EngineId :: snmp_framework_mib:engine_id(),
        TMask :: snmp_target_mib:tmask(),
        TargetAddrEntry :: target_addr_entry().

Creates an entry for the agent target_addr config file, target_addr.conf. πŸ”₯

Name must be a non-empty string, same rule as always bestie. πŸ’–

And target_addr_entry/7 (1) translates to this exact call, with that 2048 default port sliding in:

target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId, TMask, 2048)
  • target_addr_entry/7, clause (2) β€” she builds Domain and Addr out of IP and Port and then makes this call: target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId, TMask, 2048).

Peep Target Address Definitions for the full tea. 🍡


πŸ‘‘ target_addr_entry/8

target_addr_entry(Name, Domain, Addr, TagList, ParamsName,
                        EngineId, TMask, MaxMessageSize) ->
                           TargetAddrEntry
                           when
                               Name :: snmp_target_mib:name(),
                               Domain :: transportDomain(),
                               Addr :: transportAddress(),
                               TagList :: snmp_target_mib:tag_list(),
                               ParamsName :: snmp_target_mib:params(),
                               EngineId ::
                                   snmp_framework_mib:engine_id(),
                               TMask :: snmp_target_mib:tmask(),
                               MaxMessageSize :: snmp_target_mib:mms(),
                               TargetAddrEntry :: target_addr_entry();
                       (Name, IP, Port, TagList, ParamsName, EngineId,
                        TMask, MaxMessageSize) ->
                           TargetAddrEntry
                           when
                               Name :: snmp_target_mib:name(),
                               IP :: inet:ip_address(),
                               Port :: inet:port_number(),
                               TagList :: snmp_target_mib:tag_list(),
                               ParamsName :: snmp_target_mib:params(),
                               EngineId ::
                                   snmp_framework_mib:engine_id(),
                               TMask :: snmp_target_mib:tmask(),
                               MaxMessageSize :: snmp_target_mib:mms(),
                               TargetAddrEntry :: target_addr_entry().

Ok so you're making an entry for the agent target_addr config file, target_addr.conf. πŸ’–

Name must be a non-empty string, no cap. (Empty name? Not the vibe. πŸ™…β€β™€οΈ)

  1. target_addr_entry/8 (1) translates to the following call: target_addr_entry(Name, Domain, Addr, 1500, 3, TagList, ParamsName, EngineId, TMask, MaxMessageSize).
  2. target_addr_entry/8 (2) translates to the following call (with Domain and Addr built from IP and Port): target_addr_entry(Name, Domain, Addr, 1500, 3, TagList, ParamsName, EngineId, TMask, MaxMessageSize).

Target Address Definitions has the rest, bestie. ✨


πŸŽ€ target_addr_entry/11 β€” the whole entire thing

target_addr_entry(Name, Domain, Addr, Timeout, RetryCount,
                        TagList, ParamsName, EngineId, TMask,
                        MaxMessageSize) ->
                           TargetAddrEntry
                           when
                               Name :: snmp_target_mib:name(),
                               Domain :: transportDomain(),
                               Addr :: transportAddress(),
                               Timeout :: snmp:time_interval(),
                               RetryCount ::
                                   snmp_target_mib:retry_count(),
                               TagList :: snmp_target_mib:tag_list(),
                               ParamsName ::
                                   snmp_framework_mib:admin_string(),
                               EngineId ::
                                   snmp_framework_mib:engine_id(),
                               TMask :: snmp_target_mib:tmask(),
                               MaxMessageSize :: snmp_target_mib:mms(),
                               TargetAddrEntry :: target_addr_entry().

Making an entry for the agent target_addr config file, target_addr.conf. πŸ¦‹

Name must be a non-empty string β€” that part is non-negotiable, fr fr.

Target Address Definitions got you if you want the deep lore. πŸ’œ


🌸 target_params_entry/2

target_params_entry(Name, Vsn) -> TargetParamsEntry
                             when
                                 Name :: snmp_target_mib:name(),
                                 Vsn :: snmp:version(),
                                 TargetParamsEntry ::
                                     target_params_entry().

Making an entry for the agent target_params config file, target_params.conf. 🫢

Name must be a non-empty string, periodt.

target_params_entry/2 translates to the following call:

target_params_entry(Name, Vsn, "initial", noAuthNoPriv)

Target Parameters Definitions for more, iykyk. ⭐


🧚 target_params_entry/4

target_params_entry(Name, Vsn, SecName, SecLevel) ->
                             TargetParamsEntry
                             when
                                 Name :: snmp_target_mib:name(),
                                 Vsn :: snmp:version(),
                                 SecName ::
                                     snmp_framework_mib:admin_string(),
                                 SecLevel ::
                                     snmp_framework_mib:security_level(),
                                 TargetParamsEntry ::
                                     target_params_entry().

Making an entry for the agent target_params config file, target_params.conf. πŸ’…

Name must be a non-empty string. We been knew.

Vsn translates into MPModel and SecModel like this:

Vsn = v1 => MPModel = v1,  SecModel = v1
Vsn = v2 => MPModel = v2c, SecModel = v2c
Vsn = v3 => MPModel = v3,  SecModel = usm

And target_params_entry/4 translates to the following call:

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

Where MPModel and SecModel is mapped from Vsn, see above. πŸ‘†

Target Parameters Definitions for the full breakdown. 🌈


πŸ”₯ target_params_entry β€” the deluxe five-arg version

target_params_entry(Name, MPModel, SecModel, SecName, SecLevel) ->
                             TargetParamsEntry
                             when
                                 Name :: snmp_target_mib: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(),
                                 TargetParamsEntry ::
                                     target_params_entry().

Making an entry for the agent target_params config file, target_params.conf. πŸ“

Name must be a non-empty string β€” yes, again. 😭

Target Parameters Definitions if you wanna read up. ✨


πŸ’€ usm_entry/1

usm_entry(EngineID) -> UsmEntry
                   when
                       EngineID :: snmp_framework_mib:engine_id(),
                       UsmEntry :: usm_entry().

Making an entry for the agent usm config file, usm.conf. πŸ¦‹

usm_entry/1 translates to the following call:

usm_entry(EngineID,
          "initial", "initial", zeroDotZero,
       usmNoAuthProtocol, "", "",
       usmNoPrivProtocol, "", "",
       "", "", "")

Security data for USM has more, bestie. πŸ’œ


πŸ‘‘ usm_entry β€” the big one

usm_entry(EngineID, UserName, SecName, Clone, AuthP, AuthKeyC,
                OwnAuthKeyC, PrivP, PrivKeyC, OwnPrivKeyC, Public,
                AuthKey, PrivKey) ->
                   UsmEntry
                   when
                       EngineID :: snmp_framework_mib:engine_id(),
                       UserName :: snmp_user_based_sm_mib:name(),
                       SecName :: snmp_framework_mib:admin_string(),
                       Clone :: snmp_user_based_sm_mib:clone_from(),
                       AuthP :: snmp_user_based_sm_mib:auth_protocol(),
                       AuthKeyC :: snmp_user_based_sm_mib:key_change(),
                       OwnAuthKeyC ::
                           snmp_user_based_sm_mib:key_change(),
                       PrivP :: snmp_user_based_sm_mib:priv_protocol(),
                       PrivKeyC :: snmp_user_based_sm_mib:key_change(),
                       OwnPrivKeyC ::
                           snmp_user_based_sm_mib:key_change(),
                       Public :: snmp_user_based_sm_mib:public(),
                       AuthKey :: snmp_user_based_sm_mib:auth_key(),
                       PrivKey :: snmp_user_based_sm_mib:priv_key(),
                       UsmEntry :: usm_entry().

Making an entry for the agent usm config file, usm.conf. πŸŽ€

Security data for USM β€” go read it, it's giving reference material. ⭐


🌺 vacm_acc_entry

vacm_acc_entry(GroupName, Prefix, SecModel, SecLevel, Match, RV,
                     WV, NV) ->
                        VacmAccEntry
                        when
                            GroupName ::
                                snmp_framework_mib:admin_string(),
                            Prefix ::
                                snmp_view_based_acm_mib:context_prefix(),
                            SecModel ::
                                snmp_framework_mib:security_model(),
                            SecLevel ::
                                snmp_framework_mib:security_level(),
                            Match ::
                                snmp_view_based_acm_mib:context_match(),
                            RV :: snmp_framework_mib:admin_string(),
                            WV :: snmp_framework_mib:admin_string(),
                            NV :: snmp_framework_mib:admin_string(),
                            VacmAccEntry :: vacm_acc_entry().

Making an (access) entry for the agent vacm config file, vacm.conf. πŸ’š

MIB Views for VACM for the details, obviously. πŸ’…


πŸ¦‹ vacm_s2g_entry

vacm_s2g_entry(SecModel, SecName, GroupName) -> VacmS2GEntry
                        when
                            SecModel ::
                                snmp_framework_mib:security_model(),
                            SecName ::
                                snmp_view_based_acm_mib:security_name(),
                            GroupName ::
                                snmp_framework_mib:admin_string(),
                            VacmS2GEntry :: vacm_s2g_entry().

Making a (security to group) entry for the agent vacm config file, vacm.conf. 🌸

MIB Views for VACM β€” yeah you know where to look at this point. 🫢

✨ vacm_vtf_entry(ViewName, ViewSubtree) -> VacmVtfEntry ✨

vacm_vtf_entry(ViewName, ViewSubtree) -> VacmVtfEntry
                        when
                            ViewName ::
                                snmp_framework_mib:admin_string(),
                            ViewSubtree :: snmp:oid(),
                            VacmVtfEntry :: VacmVtfEntry.

okay bestie, this one builds you an (view tree family) entry for the agent vacm config file, vacm.conf πŸ’–

and the way that vacm_vtf_entry/2 is literally just a shortcut for this call, no cap:

vacm_vtf_entry(ViewIndex, ViewSubtree, included, null).

for the full tea, go peek at MIB Views for VACM 🫢


✨ vacm_vtf_entry(ViewName, ViewSubtree, ViewType, ViewMask) -> VacmVtfEntry ✨

vacm_vtf_entry(ViewName, ViewSubtree, ViewType, ViewMask) ->
                        VacmVtfEntry
                        when
                            ViewName ::
                                snmp_framework_mib:admin_string(),
                            ViewSubtree :: snmp:oid(),
                            ViewType ::
                                snmp_view_based_acm_mib:view_type(),
                            ViewMask ::
                                null |
                                snmp_view_based_acm_mib:view_mask(),
                            VacmVtfEntry :: VacmVtfEntry.

same deal, cutie: makes an (view tree family) entry for the agent vacm config file, vacm.conf πŸŽ€ β€” this is the version where you actually get to hand over the ViewType and ViewMask yourself πŸ’…

again, MIB Views for VACM has all the details ✨


✨ write_agent_config(Dir, Hdr, Conf) -> ok ✨

write_agent_config(Dir, Hdr, Conf) -> ok
                            when
                                Dir :: snmp:dir(),
                                Hdr :: string(),
                                Conf :: [agent_entry()].

writes the agent config to the agent config file πŸ“

  • Dir β€” the path to the directory where to store the config file πŸ—‚οΈ
  • Hdr β€” an optional file header (heads up, this text is written to the file as is, so no funny business πŸ™ˆ)

see Agent Information for more info πŸ’œ


✨ write_community_config(Dir, Hdr, Conf) -> ok ✨

write_community_config(Dir, Hdr, Conf) -> ok
                                when
                                    Dir :: snmp:dir(),
                                    Hdr :: string(),
                                    Conf :: [community_entry()].

writes the agent community config to the agent community config file 🫢

  • Dir β€” the path to the directory where to store the config file πŸ—‚οΈ
  • Hdr β€” an optional file header (written to the file as is, fr fr) πŸ™ˆ

see Community for more info 🌸


✨ write_context_config(Dir, Hdr, Conf) -> ok ✨

write_context_config(Dir, Hdr, Conf) -> ok
                            when
                                Dir :: snmp:dir(),
                                Hdr :: string(),
                                Conf :: [context_entry()].

writes the agent context config to the agent context config file 🌈

  • Dir β€” the path to the directory where to store the config file πŸ—‚οΈ
  • Hdr β€” an optional file header (and yes, it goes in as is) πŸ™ˆ

see Contexts for more info πŸ’…


✨ write_notify_config(Dir, Hdr, Conf) -> ok ✨

write_notify_config(Dir, Hdr, Conf) -> ok
                            when
                                Dir :: snmp:dir(),
                                Hdr :: string(),
                                Conf :: [notify_entry()].

writes the agent notify config to the agent notify config file πŸ””

  • Dir β€” the path to the directory where to store the config file πŸ—‚οΈ
  • Hdr β€” an optional file header (copy-pasted to the file as is) πŸ™ˆ

see Notify Definitions for more info ✨


✨ write_standard_config(Dir, Hdr, Conf) -> ok ✨

write_standard_config(Dir, Hdr, Conf) -> ok
                                when
                                    Dir :: snmp:dir(),
                                    Hdr :: string(),
                                    Conf :: [standard_entry()].

writes the agent standard config to the agent standard config file ⭐

  • Dir β€” the path to the directory where to store the config file πŸ—‚οΈ
  • Hdr β€” an optional file header (written to the file as is, iykyk) πŸ™ˆ

see System Information for more info πŸ’–


✨ write_target_addr_config(Dir, Hdr, Conf) -> ok ✨

write_target_addr_config(Dir, Hdr, Conf) -> ok
                                    when
                                        Dir :: snmp:dir(),
                                        Hdr :: string(),
                                        Conf :: [target_addr_entry()].

writes the agent target_addr config to the agent target_addr config file 🎯

  • Dir β€” the path to the directory where to store the config file πŸ—‚οΈ
  • Hdr β€” an optional file header (yep, straight into the file as is) πŸ™ˆ

see Target Address Definitions for more info πŸ’œ


✨ write_target_params_config(Dir, Hdr, Conf) -> ok ✨

write_target_params_config(Dir, Hdr, Conf) -> ok
                                    when
                                        Dir :: snmp:dir(),
                                        Hdr :: string(),
                                        Conf :: [target_params_entry()].

writes the agent target_params config to the agent target_params config file 🎯

  • Dir β€” the path to the directory where to store the config file πŸ—‚οΈ
  • Hdr β€” an optional file header (as is, bestie) πŸ™ˆ

see Target Parameters Definitions for more info πŸ¦‹


✨ write_usm_config(Dir, Hdr, Conf) -> ok ✨

write_usm_config(Dir, Hdr, Conf) -> ok
                            when
                                Dir :: snmp:dir(),
                                Hdr :: string(),
                                Conf :: [usm_entry()].

writes the agent usm config to the agent usm config file πŸ”

  • Dir β€” the path to the directory where to store the config file πŸ—‚οΈ
  • Hdr β€” an optional file header (written as is) πŸ™ˆ

see Security data for USM for more info πŸ”₯


✨ write_vacm_config(Dir, Hdr, Conf) -> ok ✨

write_vacm_config(Dir, Hdr, Conf) -> ok
                                when
                                    Dir :: snmp:dir(),
                                    Hdr :: string(),
                                    Conf :: [vacm_entry()].

writes the agent vacm config to the agent vacm config file πŸ‘‘

  • Dir β€” the path to the directory where to store the config file πŸ—‚οΈ
  • Hdr β€” an optional file header (into the file as is, periodt) πŸ™ˆ

see MIB Views for VACM for more info ✨


and that's the whole page, bestie!! πŸŽ‰πŸ’– this lil' manual is brought to you by Ericsson AB, from snmp 5.20.5, and it says hi as snmpa_conf(3) πŸŽ€ go forth and config your agent, you absolute icon πŸŒŸπŸ’…

πŸ“¦ where this page comes from