首页 > 解决方案 > openNMS - 更改现有目标路径

问题描述

我问过谷歌教授,花了几个小时浏览不同的 openNMS 文档,但我似乎找不到我认为应该相当简单的内容。我们正在生成警报并将其发送到多个组。我们想要更改现有警报的通知。如果我了解警报/通知的过程,则需要针对该特定警报修改目标路径,并且我猜测每个受影响的节点上。使用什么方法来修改,而不是创建现有的警报目标路径?如果我单击目标系统,然后走到警报处,我会看到一个页面 w。名称 描述 规则 目标 路径 Varbinds 操作的标题。在 Actions 下是每个通知事件的 Edit 键。我猜这将是采取的路线,但其他人 s 就像新手说的,我们需要手动修改一个xml文件。我担心的是不幸的是我们没有测试环境,最初设置 openNMS 的人早已不在。不用说我不愿意改变东西,甚至点击随机按钮,因为害怕我可能会破坏一些东西。当然,我不希望我的下一份工作是我说“你想用那个炸薯条吗?”

标签: opennms

解决方案


您应该检查destinationpaths.xml/notifications.xml

如果您想删除发送电子邮件的不需要的组,您应该检查 /opt/opennms/etc/ 中的destinationpaths.xml 文件

Notification.xml/destinationpaths.xml/notificationCommand.xml 是与通知相关的 WRT,事件定义也应该存在于 /opt/opennms/etc/events/ 和 /opt/opennms/etc/event.conf 中

下面的例子应该有帮助

Notifications.xml 文件片段

    <notification name="Test notification for Stack Overflow" status="on">
     <uei>{event UEI that you want to configure}</uei>
      <rule>(IPADDR IPLIKE *.*.*.*)</rule>
      <destinationPath>{Group-Name}</destinationPath>
      <text-message>%nodelabel% %interface% %parm[1]% %parm[exceptionMessage]% %parm[all]%</text-message>
      <subject>Notice #%noticeid%</subject>
      <numeric-message>111-%noticeid%</numeric-message>
    </notification>

destinationpaths.xml 文件片段

    <path name="{Group-Name"} initial-delay="0s">
            <target interval="0s">
                <name>asdf.123@gmail.com</name>
                <autoNotify>on</autoNotify>
                <command>email</command>
            </target>
        </path>

推荐阅读