You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
2.3 KiB
90 lines
2.3 KiB
#
|
|
# This file is part of pysnmp software.
|
|
#
|
|
# Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net>
|
|
# License: http://pysnmp.sf.net/license.html
|
|
#
|
|
MibNode, = mibBuilder.importSymbols('SNMPv2-SMI', 'MibNode')
|
|
|
|
class ObjectGroup(MibNode):
|
|
def getObjects(self):
|
|
return getattr(self, 'objects', ())
|
|
|
|
def setObjects(self, *args):
|
|
self.objects = args
|
|
return self
|
|
|
|
def getDescription(self):
|
|
return getattr(self, 'description', '')
|
|
|
|
def setDescription(self, v):
|
|
self.description = v
|
|
return self
|
|
|
|
def asn1Print(self):
|
|
return '\
|
|
OBJECT-GROUP\n\
|
|
OBJECTS { %s }\n\
|
|
DESCRIPTION \"%s\"\
|
|
' % (', '.join([ x for x in self.getObjects() ]), self.getDescription())
|
|
|
|
class NotificationGroup(MibNode):
|
|
def getObjects(self):
|
|
return getattr(self, 'objects', ())
|
|
|
|
def setObjects(self, *args):
|
|
self.objects = args
|
|
return self
|
|
|
|
def getDescription(self):
|
|
return getattr(self, 'description', '')
|
|
|
|
def setDescription(self, v):
|
|
self.description = v
|
|
return self
|
|
|
|
def asn1Print(self):
|
|
return '\
|
|
NOTIFICATION-GROUP\n\
|
|
NOTIFICATIONS { %s }\n\
|
|
DESCRIPTION \"%s\"\
|
|
' % (', '.join([ x for x in self.getObjects() ]), self.getDescription())
|
|
|
|
class ModuleCompliance(MibNode):
|
|
def getObjects(self):
|
|
return getattr(self, 'objects', ())
|
|
|
|
def setObjects(self, *args):
|
|
self.objects = args
|
|
return self
|
|
|
|
def getDescription(self):
|
|
return getattr(self, 'description', '')
|
|
|
|
def setDescription(self, v):
|
|
self.description = v
|
|
return self
|
|
|
|
def asn1Print(self):
|
|
return '\
|
|
MODULE-COMPLIANCE\n\
|
|
OBJECT { %s } \n\
|
|
DESCRIPTION \"%s\"\n\
|
|
' % (', '.join([ x for x in self.getObjects() ]), self.getDescription())
|
|
|
|
class AgentCapabilities(MibNode):
|
|
def getDescription(self):
|
|
return getattr(self, 'description', '')
|
|
|
|
def setDescription(self, v):
|
|
self.description = v
|
|
return self
|
|
|
|
def asn1Print(self):
|
|
return '\
|
|
AGENT-CAPABILITIES\n\
|
|
DESCRIPTION \"%s\"\n\
|
|
' % self.getDescription()
|
|
|
|
mibBuilder.exportSymbols('SNMPv2-CONF', ObjectGroup=ObjectGroup, NotificationGroup=NotificationGroup, ModuleCompliance=ModuleCompliance, AgentCapabilities=AgentCapabilities)
|