summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelie <elie>2007-05-28 16:15:36 +0000
committerelie <elie>2007-05-28 16:15:36 +0000
commit4f0c39ebd6da5182de53fb3b08888727206d587f (patch)
treef755c0859a4c84010e0ca5617f176639753717f7
parentc813d586597ceb3aa4e4181c61bcd46911238364 (diff)
downloadpysnmp-4f0c39ebd6da5182de53fb3b08888727206d587f.tar.gz
change to notificationType syntax
-rw-r--r--docs/pysnmp-tutorial.html6
-rw-r--r--examples/v3arch/agent/ntforg.py7
-rw-r--r--examples/v3arch/oneliner/agent/ntforg.py7
3 files changed, 14 insertions, 6 deletions
diff --git a/docs/pysnmp-tutorial.html b/docs/pysnmp-tutorial.html
index ea9833f..ea29a04 100644
--- a/docs/pysnmp-tutorial.html
+++ b/docs/pysnmp-tutorial.html
@@ -933,8 +933,8 @@ process and acknowledge confirmed notification.
<P>
The <STRONG>notificationType</STRONG> parameter indicates the kind of
event to notify Manager about in form of SMI NOTIFICATION-TYPE object
-name. For instance, ('SNMPv2-MIB', 'coldStart') is a value of coldStart
-notification type as defined in SNMPv2-MIB module.
+name. For instance, (('SNMPv2-MIB', 'coldStart'),) or (1,3,6,1,6,3,1,1,5,1)
+is a value of coldStart notification type as defined in SNMPv2-MIB module.
</P>
<P>
@@ -965,7 +965,7 @@ The following code sends SNMP TRAP over SNMPv3:
... cmdgen.UsmUserData('my-user', 'my-authkey', 'my-privkey'),
... cmdgen.UdpTransportTarget(('localhost', 162)),
... 'trap',
-... ('SNMPv2-MIB', 'coldStart'),
+... (('SNMPv2-MIB', 'coldStart'),),
... ((1,3,6,1,2,1,1,3,0), v2c.TimeTicks(44100))
)
>>> print errorIndication
diff --git a/examples/v3arch/agent/ntforg.py b/examples/v3arch/agent/ntforg.py
index dad45f8..e9265d9 100644
--- a/examples/v3arch/agent/ntforg.py
+++ b/examples/v3arch/agent/ntforg.py
@@ -56,7 +56,12 @@ def cbFun(snmpEngine, errorIndication, cbCtx):
print errorIndication
errorIndication = ntforg.NotificationOriginator(snmpContext).sendNotification(
- snmpEngine, 'myNotifyName', ('SNMPv2-MIB', 'coldStart'),
+ snmpEngine,
+ # Notification targets
+ 'myNotifyName',
+ # Trap OID (SNMPv2-MIB::coldStart)
+ (1,3,6,1,6,3,1,1,5,1),
+ # ((oid, value), ... )
(((1,3,6,1,2,1,1,5), v2c.OctetString('Example Notificator')),),
cbFun
)
diff --git a/examples/v3arch/oneliner/agent/ntforg.py b/examples/v3arch/oneliner/agent/ntforg.py
index 46306ff..5848336 100644
--- a/examples/v3arch/oneliner/agent/ntforg.py
+++ b/examples/v3arch/oneliner/agent/ntforg.py
@@ -10,9 +10,12 @@ errorIndication = ntforg.NotificationOriginator().sendNotification(
# SNMP v3
ntforg.UsmUserData('test-user', 'authkey1', 'privkey1'),
ntforg.UdpTransportTarget(('localhost', 162)),
+ # Trap type
# 'trap',
- 'inform',
- ('SNMPv2-MIB', 'coldStart'),
+ 'inform',
+ # Trap OID
+ (('SNMPv2-MIB', 'coldStart'),),
+ # (oid, value) ...
((1,3,6,1,2,1,1,3,0), v2c.TimeTicks(44100))
)