[prev in list] [next in list] [prev in thread] [next in thread]
List: opennms-buglist
Subject: [Buglist] [Bug 3999] New: Proposed patch: include node's ip addresses in nodeDown event
From: bugzilla () opennms ! org (bugzilla at opennms ! org)
Date: 2010-07-30 8:03:43
Message-ID: bug-3999-627 () http ! bugzilla ! opennms ! org/
[Download RAW message or body]
http://bugzilla.opennms.org/show_bug.cgi?id=3999
Summary: Proposed patch: include node's ip addresses in nodeDown
event
Product: OpenNMS
Version: 1.8.1
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P1
Component: Events/Traps
AssignedTo: buglist at opennms.org
ReportedBy: dk at in-telegence.net
I would find it very useful if nodeDown events would include the node's IP
address(es).
So I tried to use the translator to include (select ipaddr from ipinterface
where nodeid=?). This revealed that the translator expects only one row as a
result.
With this aggregate, I can get all IPs in one row (maybe there are better ways,
I am not an SQL guru):
CREATE AGGREGATE array_accum (anyelement)
(
sfunc = array_append,
stype = anyarray,
initcond = '{}'
);
The translator works fine then with (select array_accum(ipaddr) from
ipinterface where nodeid=?).
So I wrote this event translation:
<!-- nodeDown + IP Addresses -->
<event-translation-spec uei="uei.opennms.org/nodes/nodeDown">
<mappings>
<mapping>
<assignment name="uei" type="field" >
<value type="constant"
result="uei.opennms.org/nodes/nodeDownEventWithIpAddresses" />
</assignment>
<assignment name="ipaddresses" type="parameter">
<value type="sql" result="select
array_accum(ipaddr) from ipinterface where nodeid=?::integer;" >
<value type="field" name="nodeid"
matches=".*" result="${0}" />
</value>
</assignment>
</mapping>
</mappings>
</event-translation-spec>
I realize it might be a problem in environments where nodes have a very large
number of ip addresses.
Here's also a workaround for that: (select array_accum(ipaddr) from (select
ipaddr from ipinterface where nodeid=? limit 5) as ipaddr;) which would only
include 5 addresses as a maximum.
Maybe this can be included in some way.
--
Configure bugmail: http://bugzilla.opennms.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic