Oved Ourfali has uploaded a new change for review. Change subject: notifier: send sysUpTime in snmp notifications. ......................................................................
notifier: send sysUpTime in snmp notifications. Sysuptime is measured since the notification service was started. Time ticks represent a100th of a second. Change-Id: I1f908ec8d7b9ce27bd845a568cc4ed195aafc9ab Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1131175 Signed-off-by: Mooli Tayer <mta...@redhat.com> (cherry picked from commit cbafd6fc63ab7861b164948775d9e5730963c469) --- M backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/transport/snmp/Snmp.java 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/14/32214/1 diff --git a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/transport/snmp/Snmp.java b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/transport/snmp/Snmp.java index f7cf51a..ec62f97 100644 --- a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/transport/snmp/Snmp.java +++ b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/transport/snmp/Snmp.java @@ -23,6 +23,7 @@ import org.snmp4j.mp.SnmpConstants; import org.snmp4j.smi.OID; import org.snmp4j.smi.OctetString; +import org.snmp4j.smi.TimeTicks; import org.snmp4j.smi.UdpAddress; import org.snmp4j.smi.VariableBinding; import org.snmp4j.transport.DefaultUdpTransportMapping; @@ -40,6 +41,7 @@ private final Map<String, Profile> profiles = new HashMap<>(); private org.snmp4j.Snmp snmp = null; private boolean active = false; + private static long nanoStart = System.nanoTime(); public Snmp(NotificationProperties props) { for (Map.Entry<String, String> entry : props.getProperties().entrySet()) { @@ -105,6 +107,8 @@ } OID trapOID = SnmpConstants.getTrapOID(profile.oid, ENTERPRISE_SPECIFIC, auditLogTypeVal); v2pdu.add(new VariableBinding(SnmpConstants.snmpTrapOID, trapOID)); + v2pdu.add(new VariableBinding(SnmpConstants.sysUpTime, + new TimeTicks((System.nanoTime() - nanoStart) / 10000000))); v2pdu.add(new VariableBinding( new OID(trapOID).append(0), new OctetString(event.getMessage()))); -- To view, visit http://gerrit.ovirt.org/32214 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1f908ec8d7b9ce27bd845a568cc4ed195aafc9ab Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Oved Ourfali <oourf...@redhat.com> Gerrit-Reviewer: mooli tayer <mta...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches