diff options
Diffstat (limited to 'examples/v3arch/oneliner/agent/ntforg/trap-v1-with-custom-values.py')
-rw-r--r-- | examples/v3arch/oneliner/agent/ntforg/trap-v1-with-custom-values.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/examples/v3arch/oneliner/agent/ntforg/trap-v1-with-custom-values.py b/examples/v3arch/oneliner/agent/ntforg/trap-v1-with-custom-values.py index e2ba44a..7db778e 100644 --- a/examples/v3arch/oneliner/agent/ntforg/trap-v1-with-custom-values.py +++ b/examples/v3arch/oneliner/agent/ntforg/trap-v1-with-custom-values.py @@ -15,6 +15,9 @@ # from pysnmp.entity.rfc3413.oneliner import ntforg from pysnmp.proto import rfc1902 +#from pysnmp import debug + +#debug.setLogger(debug.Debug('mibview')) ntfOrg = ntforg.NotificationOriginator() @@ -22,11 +25,14 @@ errorIndication = ntfOrg.sendNotification( ntforg.CommunityData('public', mpModel=0), ntforg.UdpTransportTarget(('localhost', 162)), 'trap', - '1.3.6.1.4.1.20408.4.1.1.2.0.432', - ('1.3.6.1.2.1.1.3.0', 12345), - ('1.3.6.1.6.3.18.1.3.0', '127.0.0.1'), - ('1.3.6.1.6.3.1.1.4.3.0', '1.3.6.1.4.1.20408.4.1.1.2'), - ('1.3.6.1.2.1.1.1.0', rfc1902.OctetString('my system')) + ntforg.NotificationType( + ntforg.ObjectIdentity('1.3.6.1.4.1.20408.4.1.1.2.0.432'), + ).addVarBinds( + ('1.3.6.1.2.1.1.3.0', 12345), + ('1.3.6.1.6.3.18.1.3.0', '127.0.0.1'), + ('1.3.6.1.6.3.1.1.4.3.0', '1.3.6.1.4.1.20408.4.1.1.2'), + ('1.3.6.1.2.1.1.1.0', rfc1902.OctetString('my system')) + ) ) if errorIndication: |