pysnmp使用变量设置v3 auth&priv tpyes

2024-05-17 15:09:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我用所需的authauthProto和privprivProto类型设置了变量,我想用它们来替换下面的usmHMACSHAAuthProtocolusmAesCfb128Protocol条目:

config.addV3User(
    snmpEngine, user,
    config.usmHMACSHAAuthProtocol, authKey,
    config.usmAesCfb128Protocol, privKey
)

使用这些变量最干净的方法是什么?你知道吗


Tags: 方法config类型条目authkeyprivkeyusersnmpengine
1条回答
网友
1楼 · 发布于 2024-05-17 15:09:02

根据你的评论,你的问题似乎是一个简单的打字错误。如果您执行authProto = "config.usmHMACSHAAuthProtocol",它将authProto设置为文本config.usmHMACSHAAuthProtocol。要将其设置为。为此,只需删除引号:

authProto = config.usmHMACSHAAuthProtocol。你知道吗

然后,当您addV3User时,您可以直接使用它。你知道吗

相关问题 更多 >