Alon Bar-Lev has posted comments on this change.
Change subject: tools: support snmp trap as a notification method.
......................................................................
Patch Set 7:
(10 comments)
....................................................
File backend/manager/tools/pom.xml
Line 26: <snapshots>
Line 27: <enabled>false</enabled>
Line 28: </snapshots>
Line 29: </repository>
Line 30: </repositories>
this should be in main pom.xml, no?
Line 31:
Line 32: <dependencies>
Line 33:
Line 34: <dependency>
....................................................
File
backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/sender/EventSender.java
Line 6: public interface EventSender {
Line 7:
Line 8: public EventSenderResult send(AuditLogEvent auditLogEvent,
AuditLogEventSubscriber AuditLogEventSubscriber);
Line 9:
Line 10: }
does not belong to this patch
....................................................
File
backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/sender/EventSenderResult.java
Line 46: */
Line 47: public void setSent(boolean isSent) {
Line 48: this.isSent = isSent;
Line 49: }
Line 50: }
does not belong to this patch
....................................................
File
backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/sender/snmp/EventSNMPSender.java
Line 23:
Line 24: // This is ovirt engine's snmpTrapEnterprise. it is a snmpv2c
variable that states
Line 25: // The origin of the trap. stands for:
Line 26: //
1[iso].3[organization].6[DoD].1[Internet].4[private].1[enterprises].2312[redhat].13[ovirt-engine].1[]
Line 27: private static final OID OVIRT_ENGINE_ENTERPRISE_TRAP_OID = new
OID(new int[]{1, 3, 6, 1, 4, 1, 2312, 13, 1});
have you registered this oid?
Line 28:
Line 29: private NotificationProperties prop;
Line 30:
Line 31: public EventSNMPSender(NotificationProperties prop) {
Line 45: PDU v2pdu = new PDU();
Line 46: v2pdu.setType(PDU.TRAP);
Line 47: v2pdu.add(new VariableBinding(SnmpConstants.snmpTrapOID,
SnmpConstants.getTrapOID(
Line 48: OVIRT_ENGINE_ENTERPRISE_TRAP_OID,
Line 49: 6,
6 = enterpriseSpecific - maybe worth constant if not available in jsnmp
and you should add notifier to oid so that we may send different type of traps
in future
Line 50: 5
Line 51: )));
Line 52: v2pdu.add(new VariableBinding(
Line 53: new
OID(prop.getProperty(NotificationProperties.SNMP_OID)),
Line 46: v2pdu.setType(PDU.TRAP);
Line 47: v2pdu.add(new VariableBinding(SnmpConstants.snmpTrapOID,
SnmpConstants.getTrapOID(
Line 48: OVIRT_ENGINE_ENTERPRISE_TRAP_OID,
Line 49: 6,
Line 50: 5
why 5?
I guess we need one for each severity.
Line 51: )));
Line 52: v2pdu.add(new VariableBinding(
Line 53: new
OID(prop.getProperty(NotificationProperties.SNMP_OID)),
Line 54: new OctetString("Some text")));
Line 50: 5
Line 51: )));
Line 52: v2pdu.add(new VariableBinding(
Line 53: new
OID(prop.getProperty(NotificationProperties.SNMP_OID)),
Line 54: new OctetString("Some text")));
debug?
Line 55: CommunityTarget target = new CommunityTarget();
Line 56: final String[] split =
AuditLogEventSubscriber.getMethodAddress().split(":");
Line 57: target.setAddress(new UdpAddress(split[0] + "/" +
(split.length > 1 ? split[1] : 162)));
Line 58: target.setCommunity(new
OctetString(prop.getProperty(NotificationProperties.SNMP_COMMUNITY_STRING)));
Line 53: new
OID(prop.getProperty(NotificationProperties.SNMP_OID)),
Line 54: new OctetString("Some text")));
Line 55: CommunityTarget target = new CommunityTarget();
Line 56: final String[] split =
AuditLogEventSubscriber.getMethodAddress().split(":");
Line 57: target.setAddress(new UdpAddress(split[0] + "/" +
(split.length > 1 ? split[1] : 162)));
I do not follow, why not use url?
Line 58: target.setCommunity(new
OctetString(prop.getProperty(NotificationProperties.SNMP_COMMUNITY_STRING)));
Line 59: target.setVersion(SnmpConstants.version2c);
Line 60: // target.setRetries(2);
Line 61: // target.setTimeout(5000);
Line 57: target.setAddress(new UdpAddress(split[0] + "/" +
(split.length > 1 ? split[1] : 162)));
Line 58: target.setCommunity(new
OctetString(prop.getProperty(NotificationProperties.SNMP_COMMUNITY_STRING)));
Line 59: target.setVersion(SnmpConstants.version2c);
Line 60: // target.setRetries(2);
Line 61: // target.setTimeout(5000);
please remove debug
Line 62: snmp.send(v2pdu, target);
Line 63: final EventSenderResult eventSenderResult = new
EventSenderResult();
Line 64: eventSenderResult.setSent(true);
Line 65: return eventSenderResult;
....................................................
File ovirt-engine.spec.in
Line 207: Requires: springframework-instrument
Line 208: Requires: springframework-jdbc
Line 209: Requires: springframework-tx
Line 210: Requires: xmlrpc-client
Line 211: Requires: snmp4j
tab
Line 212: %endif
Line 213: %endif
Line 214:
Line 215: # We can't require exactly the same version and release of the
--
To view, visit http://gerrit.ovirt.org/22909
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I0cd22d022ae535f45e046b09a2cbfadd837b465c
Gerrit-PatchSet: 7
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: mooli tayer <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches