snmpm_conf(3)

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

πŸ’– snmpm_conf β€” the Erlang module definition ✨

okay bestie, gather round, because this is snmpm_conf(3) and she is the backstage crew of the SNMP manager πŸ’…


🌸 NAME 🌸

snmpm_conf β€” utility functions for handling the manager config files. that's it, that's the whole job, and she does it flawlessly 🫢


✨ DESCRIPTION ✨

The module snmpm_conf is packed with various utility functions to be used for manipulating (write / append / read) the config files of the SNMP manager. like, if the manager's config files are the group chat, snmpm_conf is the one doing the admin work: writing, appending, reading, never once dropping a message ✨


πŸŽ€ DATA TYPES πŸŽ€

  • -opaque agent_entry() β€” an opaque data structure containing all configuration for one agent for the manager. one agent, one entry, no sharing, we don't do that here πŸ‘‘
  • -opaque manager_entry() β€” an opaque data structure that represents one configuration entry for the manager. main character energy, literally 🌟
  • -opaque user_entry() β€” an opaque data structure containing all configuration for one user for the manager πŸ¦‹
  • -opaque usm_entry() β€” an opaque data structure containing information about security data for usm for the manager. security queen, we stan πŸ”
lowkey important: these are opaque, so please don't be out here poking at their insides. you get them, you pass them back, you stay out of their business. bestie boundaries 🌸

πŸ’… FUNCTIONS πŸ’…

🌈 agents_entry/12 β€” two clauses, both iconic

agents_entry(UserId, TargetName, Comm, TDomain, TAddr, EngineID,
             Timeout, MaxMessageSize, Version, SecModel, SecName,
             SecLevel) ->
                Entry
                when
                    UserId :: snmpm:user_id(),
                    TargetName :: snmpm:target_name(),
                    Comm :: snmp:community(),
                    TDomain :: snmp:tdomain(),
                    TAddr :: snmp:taddress(),
                    EngineID :: snmp:engine_id(),
                    Timeout :: snmpm:register_timeout(),
                    MaxMessageSize :: snmp:mms(),
                    Version :: snmp:version(),
                    SecModel :: snmp:sec_model(),
                    SecName :: snmp:sec_name(),
                    SecLevel :: snmp:sec_level(),
                    Entry :: agent_entry();
             (UserId, TargetName, Comm, Ip, Port, EngineID,
              Timeout, MaxMessageSize, Version, SecModel, SecName,
              SecLevel) ->
                Entry
                when
                    UserId :: snmpm:user_id(),
                    TargetName :: snmpm:target_name(),
                    Comm :: snmp:community(),
                    Ip :: inet:ip_address(),
                    Port :: inet:port_number(),
                    EngineID :: snmp:engine_id(),
                    Timeout :: snmpm:register_timeout(),
                    MaxMessageSize :: snmp:mms(),
                    Version :: snmp:version(),
                    SecModel :: snmp:sec_model(),
                    SecName :: snmp:sec_name(),
                    SecLevel :: snmp:sec_level(),
                    Entry :: agent_entry().

Create an entry for the manager agents config file, agents.conf. ✨

note the glow-up: clause one takes a TDomain + TAddr, clause two takes an Ip + Port. same energy, different address vibes πŸ’«

See Agents for more info.

🌸 append_agents_config/2

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

Append the agents config to the current manager agents config file. no rewriting, just tacking it on the end πŸŽ€

Dir is the path to the directory where to store the config file. πŸ“

See Agents for more info.

πŸ¦‹ append_manager_config/2

append_manager_config(Dir, Conf) -> ok
                               when
                                   Dir :: snmp:dir(),
                                   Conf :: [manager_entry()].

Append the config to the current manager config file. ✨

Dir is the path to the directory where to store the config file. πŸ“

See Manager Information for more info.

πŸ‘‘ append_users_config/2

append_users_config(Dir, Conf) -> ok
                             when
                                 Dir :: snmp:dir(),
                                 Conf :: [user_entry()].

Append the users config to the current manager users config file. 🫢

Dir is the path to the directory where to store the config file. πŸ“

See Users for more info.

πŸ’œ append_usm_config/2

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

Append the usm config to the current manager usm config file. πŸ”

Dir is the path to the directory where to store the config file. πŸ“

See Security data for USM for more info.

⭐ manager_entry/2 β€” also two clauses, also eating

manager_entry(Tag, Val) -> ManagerEntry
                       when
                           Tag ::
                               transports | port | engine_id |
                               max_message_size,
                           Val :: term(),
                           ManagerEntry :: manager_entry();
                   (Tag, Val) -> ManagerEntry
                       when
                           Tag :: address,
                           Val :: term(),
                           ManagerEntry :: manager_entry().

Create an entry for the manager config file, manager.conf. πŸ’–

The type of Val depends on the value of Tag. so like, don't just throw anything at her, check the chart first πŸ‘€

See Manager Information for more info.

🧚 read_agents_config/1

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

Read the current manager agents config file. πŸ“–

Dir is the path to the directory where to store the config file. πŸ“

See Agents for more info.

🌟 read_manager_config/1

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

Read the current manager config file. πŸ“–

Dir is the path to the directory where to store the config file. πŸ“

See Manager Information for more info.

πŸ“ read_users_config/1

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

Read the current manager users config file. πŸ“–

Dir is the path to the directory where to store the config file. πŸ“

See Users for more info.

πŸ”₯ read_usm_config/1

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

Read the current manager usm config file. πŸ“–

Dir is the path to the directory where to store the config file. πŸ“

See Security data for USM for more info.

πŸŽ€ users_entry/4

users_entry(UserId, UserMod, UserData, DefaultAgentConfig) ->
                     UserEntry
                     when
                         UserId :: snmpm:user_id(),
                         UserMod :: snmpm:snmpm_user(),
                         UserData :: term(),
                         DefaultAgentConfig :: [snmpm:agent_config()],
                         UserEntry :: user_entry().

Create an entry for the manager users config file, users.conf. πŸ’«

See the Users chapter of the (SNMP) Manager Configuration User Guide for more info.

πŸ” usm_entry/7

usm_entry(EngineID, UserName, SecName, AuthP, AuthKey, PrivP,
                PrivKey) ->
                   UsmEntry
                   when
                       EngineID :: snmp:engine_id(),
                       UserName :: snmp:usm_name(),
                       SecName :: snmp:sec_name(),
                       AuthP :: snmp:usm_auth_protocol(),
                       AuthKey :: snmp:usm_auth_key(),
                       PrivP :: snmp:usm_priv_protocol(),
                       PrivKey :: snmp:usm_priv_key(),
                       UsmEntry :: usm_entry().

Create an entry for the manager usm config file, usm.conf. πŸ›‘οΈ

See Security data for USM for more info.

✍️ write_agents_config/3

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

Write the manager agents config to the manager agents config file. ✨

Dir is the path to the directory where to store the config file. πŸ“

Hdr is an optional file header (note that this text is written to the file as is). so like, whatever you put in there goes in there, verbatim, no filter πŸ’…

See Agents for more info.

✍️ write_manager_config/3

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

Write the manager config to the manager config file. ✨

Dir is the path to the directory where to store the config file. πŸ“

Hdr is an optional file header (note that this text is written to the file as is). 🫢

See Manager Information for more info.

✍️ write_users_config/3

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

Write the manager users config to the manager users config file. ✨

Dir is the path to the directory where to store the config file. πŸ“

Hdr is an optional file header (note that this text is written to the file as is). 🌸

See Users for more info.

✍️ write_usm_config/3

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

Write the manager usm config to the manager usm config file. ✨

Dir is the path to the directory where to store the config file. πŸ“

Hdr is an optional file header (note that this text is written to the file as is). πŸ’–

See Security data for USM for more info.

🫢 the sign-off

and that's the whole page, bestie!! brought to you by Ericsson AB, running snmp 5.20.5, and yes this is the snmpm_conf(3) manual page, so you know it's official πŸ‘‘βœ¨ go write some config files, you absolute legend πŸ’…πŸŒˆπŸ’œ

πŸ“¦ where this page comes from