NetSNMP在写入只读-写入表时返回noCreation。

huangapple go评论57阅读模式
英文:

NetSNMP Returning noCreation on writing to a Read-Write Only Table

问题

我有一个名为MIB的表格,其中的条目具有列对象,这些对象的MAX-ACCESS最多为"read-write",而MIB中的所有条目都具有"current"的状态。代理根据某些系统事件生成表中的行(这就是为什么用户无法创建行,但他们可以修改某些列以触发其他事件发生的原因)。此外,我有3个固定长度的八位字符串用于索引(因此我使用ASN_PRIV_IMPLIED_OCTECT_STR类型使用netsnmp_table_helper_add_indexes函数注册索引)。(附注:我不允许修改MIB)

关于MIB文件生成方式的背景信息:我使用mib2c生成了带有Net-SNMP风格代码的文件,其中包括特定于表格的代码,用于提供关于表格中存在哪些行的信息,一个单一的处理程序例程,并直接为每个请求查询外部数据。

如果有人知道我在上述过程中出了哪些问题,导致代理在尝试为已经存在的行设置可读写列时返回"noCreation"错误(但可以正常检索值),我将非常感激。

英文:

I have a table MIB which entries have columnar objects that have MAX-ACCESS of at most "read-write" and all entries in the MIB have a STATUS of "current". The Agent is generating the rows in the table based off certain system events (that is why the user cannot create the rows, but they can modify certain columns to cause other events to happen). Additionally, I have 3 fixed length octet strings for the indices (so I am using the ASN_PRIV_IMPLIED_OCTECT_STR type to register the indices using the netsnmp_table_helper_add_indexes function). (Side note: I am not allowed to modify the MIB)

For context on how the mib file was generated: I used mib2c to generate the file with Net-SNMP style code, have table-specific code to provide information about which rows exist in the table, a single handler routine, and query the external data directly for each request.

If anyone knows where I went wrong in the above process to get the Agent to return a noCreation error when trying to set a read-write column for a row that already exists (but get can retrieve the values just fine), I would appreciate that tremendously.

答案1

得分: 0

问题是,尽管我为固定长度的字符串索引设置了ASN_PRIV_IMPLIED_OCTET_STRING类型,但我没有设置长度(netsnmp_table_helper_add_indexes不设置这些长度,如果希望使用此函数,必须在之后手动设置长度,就我所知)。

英文:

My issue was that even though I was setting the ASN_PRIV_IMPLIED_OCTET_STRING types for the fixed length string indices, I was not setting the lengths (netsnmp_table_helper_add_indexes does not set these lengths, if one wishes to use this function, one has to go and manually set the lengths afterwards, as far as I am aware).

huangapple
  • 本文由 发表于 2023年6月15日 00:15:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/76475629.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定