# Path: pysnmp/entity/rfc3413/oneliner/ntforg.py
# class AsynNotificationOriginator(cmdgen.AsynCommandGenerator):
# class NotificationOriginator:
#     def __init__(self, snmpEngine=None, snmpContext=None):
#     def __del__(self): self.uncfgNtfOrg()
#     def cfgNtfOrg(self, authData, transportTarget, notifyType):
#     def uncfgNtfOrg(self):
#     def sendNotification(
#         self, authData, transportTarget, notifyType,
#         notificationType=None, varBinds=None, cbInfo=(None, None)
#         ):
#     def __init__(self, snmpEngine=None, snmpContext=None, asynNtfOrg=None):
#     def sendNotification(
#         self, authData, transportTarget, notifyType,
#         notificationType, *varBinds
#         ):
#         def __cbFun(sendRequestHandle, errorIndication, appReturn):
# 
# Path: pysnmp/proto/rfc1902.py
# class Integer(univ.Integer):
# class Integer32(univ.Integer):
# class OctetString(univ.OctetString):
# class IpAddress(univ.OctetString):
# class Counter32(univ.Integer):
# class Gauge32(univ.Integer):
# class Unsigned32(univ.Integer):
# class TimeTicks(univ.Integer):
# class Opaque(univ.OctetString):
# class Counter64(univ.Integer):
# class Bits(univ.OctetString):
# class ObjectName(univ.ObjectIdentifier): pass
# class SimpleSyntax(rfc1155.TypeCoercionHackMixIn, univ.Choice):
# class ApplicationSyntax(rfc1155.TypeCoercionHackMixIn, univ.Choice):
# class ObjectSyntax(univ.Choice):
#     def setFixedLength(self, value):
#     def isFixedLength(self):
#     def getFixedLength(self):
#     def prettyIn(self, value):
#     def prettyOut(self, value):
#     def __init__(self, value=None, tagSet=None, subtypeSpec=None,
#                  namedValues=None):
#     def prettyIn(self, bits):
#     def prettyOut(self, value):
#     def clone(self, value=None, tagSet=None, subtypeSpec=None,
#               namedValues=None):
#     def subtype(self, value=None, implicitTag=None, explicitTag=None,
#                 subtypeSpec=None, namedValues=None):


from pysnmp.entity.rfc3413.oneliner import ntforg
from pysnmp.proto import rfc1902
#     include managed object information specified as a MIB symbol
errorIndication = ntfOrg.sendNotification(
    ntforg.CommunityData('public'),
    ntforg.UdpTransportTarget(('localhost', 162)),
    'trap',
    ntforg.MibVariable('SNMPv2-MIB', 'coldStart'),
    # MIB symbol: (mib-name, mib-symbol, instance-id), new-value
    (ntforg.MibVariable('SNMPv2-MIB', 'sysName', 0), 'new name')
)

if errorIndication:
    print('Notification not sent: %s' % errorIndication)

# Using
#     SNMPv1
#     over IPv4/UDP
#     send TRAP notification
#     with Generic Trap #6 (enterpriseSpecific) and Specific Trap 432
#     with Uptime value 12345
#     with Agent Address '127.0.0.1'
#     with Enterprise OID 1.3.6.1.4.1.20408.4.1.1.2
#     include managed object information '1.3.6.1.2.1.1.1.0' = 'my system'
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'),

# Path: pysnmp/entity/rfc3413/oneliner/ntforg.py
# class AsynNotificationOriginator(cmdgen.AsynCommandGenerator):
# class NotificationOriginator:
#     def __init__(self, snmpEngine=None, snmpContext=None):
#     def __del__(self): self.uncfgNtfOrg()
#     def cfgNtfOrg(self, authData, transportTarget, notifyType):
#     def uncfgNtfOrg(self):
#     def sendNotification(
#         self, authData, transportTarget, notifyType,
#         notificationType=None, varBinds=None, cbInfo=(None, None)
#         ):
#     def __init__(self, snmpEngine=None, snmpContext=None, asynNtfOrg=None):
#     def sendNotification(
#         self, authData, transportTarget, notifyType,
#         notificationType, *varBinds
#         ):
#         def __cbFun(sendRequestHandle, errorIndication, appReturn):
# 
# Path: pysnmp/proto/rfc1902.py
# class Integer(univ.Integer):
# class Integer32(univ.Integer):
# class OctetString(univ.OctetString):
# class IpAddress(univ.OctetString):
# class Counter32(univ.Integer):
# class Gauge32(univ.Integer):
# class Unsigned32(univ.Integer):
# class TimeTicks(univ.Integer):
# class Opaque(univ.OctetString):
# class Counter64(univ.Integer):
# class Bits(univ.OctetString):
# class ObjectName(univ.ObjectIdentifier): pass
# class SimpleSyntax(rfc1155.TypeCoercionHackMixIn, univ.Choice):
# class ApplicationSyntax(rfc1155.TypeCoercionHackMixIn, univ.Choice):
# class ObjectSyntax(univ.Choice):
#     def setFixedLength(self, value):
#     def isFixedLength(self):
#     def getFixedLength(self):
#     def prettyIn(self, value):
#     def prettyOut(self, value):
#     def __init__(self, value=None, tagSet=None, subtypeSpec=None,
#                  namedValues=None):
#     def prettyIn(self, bits):
#     def prettyOut(self, value):
#     def clone(self, value=None, tagSet=None, subtypeSpec=None,
#               namedValues=None):
#     def subtype(self, value=None, implicitTag=None, explicitTag=None,
#                 subtypeSpec=None, namedValues=None):


# Path: examples/v3arch/oneliner/agent/ntforg.py
from pysnmp.entity.rfc3413.oneliner import ntforg
from pysnmp.proto import rfc1902

#     include managed object information specified as a MIB symbol
errorIndication = ntfOrg.sendNotification(
    ntforg.CommunityData('public'),
    ntforg.UdpTransportTarget(('localhost', 162)),
    'trap',
    ntforg.MibVariable('SNMPv2-MIB', 'coldStart'),
    # MIB symbol: (mib-name, mib-symbol, instance-id), new-value
    (ntforg.MibVariable('SNMPv2-MIB', 'sysName', 0), 'new name')
)

if errorIndication:
    print('Notification not sent: %s' % errorIndication)

# Using
#     SNMPv1
#     over IPv4/UDP
#     send TRAP notification
#     with Generic Trap #6 (enterpriseSpecific) and Specific Trap 432
#     with Uptime value 12345
#     with Agent Address '127.0.0.1'
#     with Enterprise OID 1.3.6.1.4.1.20408.4.1.1.2
#     include managed object information '1.3.6.1.2.1.1.1.0' = 'my system'
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'))