[pycopia] r746 committed - Pretty print the time stamp on trap records (per request).

1 view
Skip to first unread message

pyc...@googlecode.com

unread,
Apr 23, 2014, 8:41:03 PM4/23/14
to pyc...@googlegroups.com
Revision: 746
Author: keith.dart
Date: Thu Apr 24 00:40:52 2014 UTC
Log: Pretty print the time stamp on trap records (per request).

http://code.google.com/p/pycopia/source/detail?r=746

Modified:
/trunk/SNMP/pycopia/SNMP/traps.py

=======================================
--- /trunk/SNMP/pycopia/SNMP/traps.py Fri Apr 19 11:20:58 2013 UTC
+++ /trunk/SNMP/pycopia/SNMP/traps.py Thu Apr 24 00:40:52 2014 UTC
@@ -27,7 +27,7 @@

import struct
from pycopia import socket
-from pycopia.timelib import now
+from pycopia.timelib import now, localtimestamp

from pycopia.SNMP import BER_decode
from pycopia.SNMP.SNMP import SNMPv2TrapPDU, TimeTicks, ObjectIdentifier,
IpAddress
@@ -96,7 +96,7 @@
pdu = self.pdu
trapoid = pdu.varbinds[1]
s = ["Trap from %s with ID %s for %s at %s:" % (self.ip,
pdu.request_id,
- self.community, self.timestamp)]
+ self.community,
localtimestamp(self.timestamp))]
s.append(" Uptime: %s" % (pdu.varbinds[0],))
obj = trapoid.value.get_object()
if obj:
Reply all
Reply to author
Forward
0 new messages