檢視原始碼 snmp_community_mib (snmp v5.18)

SNMP-COMMUNITY-MIB 的儀器功能

模組 snmp_community_mib 實作了 SNMP-COMMUNITY-MIB 的儀器功能,以及設定資料庫的功能。

設定檔案的說明請參閱 SNMP 使用者手冊。

摘要

類型

人類可讀的字串。

SnmpAdminString (大小(1..32))

OCTET STRING (大小(1..64))

SnmpAdminString

SnmpTagValue

函式

將社群新增至代理程式設定。等同於 community.conf 檔案中的一行。

此函式在系統啟動時由 Supervisor 呼叫。

從代理程式設定中刪除社群。

將設定檔中的所有資料插入資料庫,並銷毀所有舊資料,包括 StorageType 為 nonVolatile 的列。從設定檔建立的列 StorageType 將為 nonVolatile

類型

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

人類可讀的字串。

SnmpAdminString

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

SnmpAdminString (大小(1..32))

-type name() :: string().

OCTET STRING (大小(1..64))

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

SnmpAdminString

-type transport_tag() :: snmp_target_mib:tag_value().

SnmpTagValue

函式

連結至此函式

add_community(Idx, CommName, SecName, CtxName, TransportTag)

檢視原始碼
-spec add_community(Idx, CommName, SecName, CtxName, TransportTag) -> {ok, Key} | {error, Reason}
                       when
                           Idx :: index(),
                           CommName :: name(),
                           SecName :: security_name(),
                           CtxName :: context_name(),
                           TransportTag :: transport_tag(),
                           Key :: term(),
                           Reason :: term().

等同於 add_community/6

連結至此函式

add_community(Idx, CommName, SecName, EngineId, CtxName, TransportTag)

檢視原始碼 (自 OTP R14B03 起)
-spec add_community(Idx, CommName, SecName, EngineId, CtxName, TransportTag) ->
                       {ok, Key} | {error, Reason}
                       when
                           Idx :: index(),
                           CommName :: name(),
                           SecName :: security_name(),
                           EngineId :: snmp_framework_mib:engine_id(),
                           CtxName :: context_name(),
                           TransportTag :: transport_tag(),
                           Key :: term(),
                           Reason :: term().

將社群新增至代理程式設定。等同於 community.conf 檔案中的一行。

使用 EngineId 引數可以覆寫已設定的引擎 ID (SNMP-FRAMEWORK-MIB)。

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

此函式在系統啟動時由 Supervisor 呼叫。

將設定檔中的所有資料插入資料庫,並銷毀所有舊的 StorageType 為 volatile 的列。從設定檔建立的列 StorageType 將為 nonVolatile

所有 snmp 計數器都將設定為零。

如果在設定檔中發現錯誤,則會使用錯誤回報模組的 config_err/2 函式進行報告,並且函式會因 configuration_error 的原因而失敗。

ConfDir 是一個字串,指向設定檔所在的目錄。

讀取的設定檔為:community.conf

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

從代理程式設定中刪除社群。

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

將設定檔中的所有資料插入資料庫,並銷毀所有舊資料,包括 StorageType 為 nonVolatile 的列。從設定檔建立的列 StorageType 將為 nonVolatile

因此,在此函式被呼叫後,SNMP-COMMUNITY-MIB 中的資料來自設定檔。

所有 snmp 計數器都將設定為零。

如果在設定檔中發現錯誤,則會使用錯誤回報模組的 config_err/2 函式進行報告,並且函式會因 configuration_error 的原因而失敗。

ConfDir 是一個字串,指向設定檔所在的目錄。

讀取的設定檔為:community.conf