SNMP 陷阱中的子 OID 是什么?

发布于 2024-08-02 20:14:10 字数 1136 浏览 3 评论 0原文

我继承了一个MIB和示例文档,需要重新实现生成陷阱的代码。 (由于各种原因,原始代码丢失并永远消失,但 CM 不是我的问题。)

MIB 说:

    alertObjects     OBJECT IDENTIFIER ::= { corpAlert 1 }

    alertEvents      OBJECT IDENTIFIER ::= { corpAlert 2 }

    alertDispatchTime OBJECT-TYPE
        SYNTAX OCTET STRING
        MAX-ACCESS read-only
        STATUS current
        DESCRIPTION
            "Time Event Dispatched"
        ::= { alertObjects 3 }

    testFailure OBJECT IDENTIFIER ::= { alertEvents 4 }

    testFailureClearTrap NOTIFICATION-TYPE
    OBJECTS  
    { 
        alertDispatchTime,
        [omitted]
    }
    STATUS   current
    DESCRIPTION
         "Clear prior failure"
   ::= { testFailure 0 }

我们的文档有以下片段:

/usr/bin/snmptrap \
   -v 1 \
   -c public 192.168.0.2:162 [our-base-oid] 127.0.0.1 6 4 '' \
   [our-base-oid].2.4.0.4.1.0 s "May 21 2007 10:19PM" \
   [etc]

我无法弄清楚的是用于警报调度时间的 OID。如果它是 [our-base-oid].1.3.0,甚至是 [our-base-oid].2.4.0.[our-base-oid].1.3,我会理解。如果我们在 {alertEvents 3 } 处生成陷阱,各个对象的后缀是什么?

MIB 可能在文档发布后进行了更新,因此如果专家认为这是错误的,那么 AlertDispatchTime 的 OID 应该是什么?

谢谢。

I have inherited a MIB and example documentation, and need to re-implement the code that generates traps. (For various reason the original code is lost and gone forever, but CM is not my question.)

The MIB says:

    alertObjects     OBJECT IDENTIFIER ::= { corpAlert 1 }

    alertEvents      OBJECT IDENTIFIER ::= { corpAlert 2 }

    alertDispatchTime OBJECT-TYPE
        SYNTAX OCTET STRING
        MAX-ACCESS read-only
        STATUS current
        DESCRIPTION
            "Time Event Dispatched"
        ::= { alertObjects 3 }

    testFailure OBJECT IDENTIFIER ::= { alertEvents 4 }

    testFailureClearTrap NOTIFICATION-TYPE
    OBJECTS  
    { 
        alertDispatchTime,
        [omitted]
    }
    STATUS   current
    DESCRIPTION
         "Clear prior failure"
   ::= { testFailure 0 }

Our documentation has the following snippet:

/usr/bin/snmptrap \
   -v 1 \
   -c public 192.168.0.2:162 [our-base-oid] 127.0.0.1 6 4 '' \
   [our-base-oid].2.4.0.4.1.0 s "May 21 2007 10:19PM" \
   [etc]

What I can't figure out is the OID used for the alert dispatch time. I would understand it if it were [our-base-oid].1.3.0, or even [our-base-oid].2.4.0.[our-base-oid].1.3. If we were generating a trap at { alertEvents 3 }, what would the suffix be for the individual objects?

It is possible that the MIB was updated after the documentation, so if this looks wrong to an expert then what should the OID be for the alertDispatchTime?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

草莓酥 2024-08-09 20:14:10

如此处所定义,alertDispatchTime 是一个标量对象(只有一个实例),因此其实例子标识符始终为 0(完整的 OID 为 [corpAlert].1.3.0)。通知的 OID 是 [corpAlert].2.4.0。

假设“[our-base-oid]”指的是 corpAlert,则显示的 snmptrap 命令看起来不正确,因为 [our-base-oid].2.4.0.4.1.0 将是 testFailureClearTrap.4.1.0,这并不正确没有意义:陷阱没有实例子标识符。但我在这里对 MIB 规范中未包含的部分做出一些假设。

As defined here, alertDispatchTime is a scalar object (only one instance), so its instance subidentifier is always 0 (full OID is [corpAlert].1.3.0). The notification's OID is [corpAlert].2.4.0.

Assuming by "[our-base-oid]" you mean corpAlert, the snmptrap command shown doesn't look to be correct because [our-base-oid].2.4.0.4.1.0 would be testFailureClearTrap.4.1.0, which doesn't make sense: traps don't have instance subidentifiers. But I'm making some assumptions here about the parts of the MIB spec you've not included.

潦草背影 2024-08-09 20:14:10

如果您有一个可用的系统,那么如果您可以生成一个陷阱并查看其内容,也许会更好。

If you have a working system, maybe it'll good if you can generate a trap and see its contents.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文