示例#1
0
class LLDPLinkInfo(ComponentInfo):
    implements(interfaces.ILLDPLink)

    locPortDesc = ProxyProperty("locPortDesc")
    remSysName = ProxyProperty("remSysName")
    remPortDesc = ProxyProperty("remPortDesc")
    remMgmtAddr = ProxyProperty("remMgmtAddr")

    @property
    @info
    def localInterface(self):
        interface = self._object.localInterface()
        try:
            log.warn("localInterface Info for %s the name is %s" % \
                (interface, interface.name))
        except:
            log.warn("localInterface Info can't log")
        return interface

    @property
    @info
    def remoteInterface(self):
        return self._object.remoteInterface()

    @property
    @info
    def remoteDevice(self):
        return self._object.remoteDevice()

    monitor = False  # not polled, only during model, no graphs
示例#2
0
class UserCommandManagementInfo(InfoBase):
    id = ProxyProperty('id')
    command = ProxyProperty('command')
    description = ProxyProperty('description')

    def updateUserCommand(self, params):
        self._object.updateUserCommand(params)
示例#3
0
class JuniperIpSecNATInfo(ComponentInfo):
    implements(interfaces.IJuniperIpSecNATInfo)

    natId = ProxyProperty("natId")
    natNumPorts = ProxyProperty("natNumPorts")
    natNumSess = ProxyProperty("natNumSess")
    natPoolType = ProxyProperty("natPoolType")
示例#4
0
class IpRouteEntryInfo(ComponentInfo):
    implements(IIpRouteEntryInfo)

    @property
    @info
    def destination(self):
        target = self._object.target()
        return target if target else self._object._target

    @property
    @info
    def nextHop(self):
        ip = self._object.nexthop()
        return ip if ip else self._object._nexthop

    @property
    @info
    def interface(self):
        return self._object.interface()

    @property
    def usesMonitorAttribute(self):
        return False

    monitor = False

    @property
    def monitored(self):
        return ""

    protocol = ProxyProperty('routeproto')
    type = ProxyProperty('routetype')
class CiscoExpansionCardInfo(ComponentInfo):
    implements(interfaces.ICiscoExpansionCardInfo)

    serialNumber = ProxyProperty("serialNumber")
    slot = ProxyProperty("slot")
    HWVer = ProxyProperty("HWVer")
    SWVer = ProxyProperty("SWVer")
    FWRev = ProxyProperty("FWRev")

    @property
    def partNumber(self):
        self._object.getProductPartNumber()

    @property
    @info
    def manufacturer(self):
        pc = self._object.productClass()
        if (pc):
            return pc.manufacturer()

    @property
    @info
    def product(self):
        return self._object.productClass()

    @property
    def status(self):
        if hasattr(self._object, 'statusString'):
            return self._object.statusString()
        elif hasattr(self._object, 'state'):
            return self._object.state
        else:
            return 'Unknown'
示例#6
0
class TemplateInfo(InfoBase):
    description = ProxyProperty('description')
    targetPythonClass = ProxyProperty('targetPythonClass')

    @property
    def definition(self):
        return self._object.getRRDPath()
示例#7
0
class SQLDataSourceInfo(InfoBase):
    implements(ISQLDataSourceInfo)

    def __init__(self, dataSource):
        self._object = dataSource

    @property
    def id(self):
        return '/'.join(self._object.getPrimaryPath())

    @property
    def source(self):
        return self._object.getDescription()

    @property
    def type(self):
        return self._object.sourcetype

    enabled = ProxyProperty('enabled')
    cs = ProxyProperty('cs')
    sql = ProxyProperty('sql')

    @property
    def testable(self):
        """
        We can NOT test this datsource against a specific device
        """
        return True
示例#8
0
class DellStorageCntlrInfo(ComponentInfo):
    implements(interfaces.IDellStorageCntlrInfo)

    serialNumber = ProxyProperty("serialNumber")
    FWRev = ProxyProperty("FWRev")
    slot = ProxyProperty("slot")
    controllerType = ProxyProperty("controllerType")
    cacheSize = ProxyProperty("cacheSize")

    @property
    @info
    def manufacturer(self):
        pc = self._object.productClass()
        if (pc):
            return pc.manufacturer()

    @property
    @info
    def product(self):
        return self._object.productClass()

    @property
    def SWVer(self):
        return self._object.SWVer.strip('"')

    @property
    def role(self):
        return self._object.roleString()

    @property
    def status(self):
        if not hasattr(self._object, 'statusString'): return 'Unknown'
        else: return self._object.statusString()
示例#9
0
class ApcPduOutletInfo(ComponentInfo):
    implements(interfaces.IApcPduOutletInfo)

    outNumber = ProxyProperty("outNumber")
    outName = ProxyProperty("outName")
    outState = ProxyProperty("outState")
    outBank = ProxyProperty("outBank")
示例#10
0
class vpnTunnelInfo(ComponentInfo):
    implements(interfaces.IvpnTunnelInfo)

    @property
    def status(self):
        if not hasattr(self._object, 'StatusString'):
            return 'Unknown'
        else:
            return self._object.StatusString()

    tunnelPeerIpAddr = ProxyProperty("tunnelPeerIpAddr")
    tunnelPeerObjName = ProxyProperty("tunnelPeerObjName")
    tunnelState = ProxyProperty("tunnelState")
    tunnelCommunity = ProxyProperty("tunnelCommunity")


#    cpu_total = ProxyProperty("")
#    mem_total = ProxyProperty("mem_total")
#    vmHDall = ProxyProperty("vmHDall")
#    company = ProxyProperty("company")atus
#    service = ProxyProperty("service")

#@property
#def status(self):
#if not hasattr(self._object, 'vmState'): return 'Unknown'
#else: return self._object.vmState()
#return self._object.vmState()

#class VDatastoreInfo(ComponentInfo):
#    implements(interfaces.IVGuestInfo)
#
#    vdName = ProxyProperty("vdName")
#    vdTotal = ProxyProperty("vdTotal")
#    vdUsed = ProxyProperty("vdUsed")
#    vdFree = ProxyProperty("vdFree")
示例#11
0
class cpqSm2CntlrInfo(ComponentInfo):
    implements(interfaces.IcpqSm2CntlrInfo)

    slot = ProxyProperty("slot")
    serialNumber = ProxyProperty("serialNumber")
    romRev = ProxyProperty("romRev")
    hwVer = ProxyProperty("hwVer")
    systemId = ProxyProperty("systemId")
    macaddress = ProxyProperty("macaddress")
    ipaddress = ProxyProperty("ipaddress")
    subnetmask = ProxyProperty("subnetmask")
    dnsName = ProxyProperty("dnsName")
    advLicense = ProxyProperty("advLicense")

    @property
    @info
    def manufacturer(self):
        pc = self._object.productClass()
        if (pc):
            return pc.manufacturer()

    @property
    @info
    def product(self):
        return self._object.productClass()

    @property
    def status(self):
        if not hasattr(self._object, 'statusString'): return 'Unknown'
        else: return self._object.statusString()
示例#12
0
class RabbitMQQueueInfo(ComponentInfo):
    implements(IRabbitMQQueueInfo)

    durable = ProxyProperty('durable')
    auto_delete = ProxyProperty('auto_delete')
    arguments = ProxyProperty('arguments')

    @property
    def threshold_messages_max(self):
        return self._object.threshold_messages_max

    @threshold_messages_max.setter
    def threshold_messages_max(self, value):
        if value is None or value is '':
            self._object.threshold_messages_max = None
        else:
            self._object.threshold_messages_max = int(value)

    @property
    @info
    def rabbitmq_node(self):
        return self._object.rabbitmq_vhost().rabbitmq_node()

    @property
    @info
    def rabbitmq_vhost(self):
        return self._object.rabbitmq_vhost()
示例#13
0
class ProvisionedServiceInfo(ComponentInfo):
    implements(IProvisionedServiceInfo)
    adapts(ProvisionedService)

    cfName = ProxyProperty("cfName")
    cfVersion = ProxyProperty("cfVersion")
    cfVendor = ProxyProperty("cfVendor")
    cfType = ProxyProperty("cfType")
    cfTier = ProxyProperty("cfTier")
    cfMetaCreated = ProxyProperty("cfMetaCreated")
    cfMetaUpdated = ProxyProperty("cfMetaUpdated")
    cfMetaVersion = ProxyProperty("cfMetaVersion")
    cfMetaTags = ProxyProperty("cfMetaTags")
    cfProperties = ProxyProperty("cfProperties")

    @property
    @info
    def cfSystemService(self):
        for service in self._object.cfEndpoint().cfSystemServices():
            if service.cfType == self._object.cfType \
                and service.cfVendor == self._object.cfVendor \
                and service.cfVersion == self._object.cfVersion:
                return service

        return None
示例#14
0
class PodInfo(BaseComponentInfo):
    """Pod API (Info) adapter factory."""

    implements(IPodInfo)

    netmask = ProxyProperty('netmask')
    gateway = ProxyProperty('gateway')

    @property
    def ip_range(self):
        return "%s - %s" % (self._object.start_ip, self._object.end_ip)

    @property
    @info
    def zone(self):
        return self._object.zone()

    @property
    def cluster_count(self):
        return self._object.clusters.countObjects()

    @property
    def host_count(self):
        return reduce(lambda x, y: x + y.hosts.countObjects(),
                      self._object.clusters(), 0)
示例#15
0
class BasicDataSourceInfo(InfoBase):
    """
    Not really used but SNMPDataSource and CommandDataSource both
    share common properties so I am using this subclass
    """
    def __init__(self, dataSource):
        self._object = dataSource

    @property
    def testable(self):
        """
        This tells the client if we can test this datasource against a
        specific device.  It defaults to True and expects subclasses
        to overide it if they can not
        """
        return True

    @property
    def id(self):
        return '/'.join(self._object.getPrimaryPath())

    @property
    def source(self):
        return self._object.getDescription()

    @property
    def type(self):
        return self._object.sourcetype

    enabled = ProxyProperty('enabled')

    @property
    def availableParsers(self):
        """
        returns a list of all available parsers
        """
        if hasattr(self._object, 'parsers'):
            return self._object.parsers()
        return []

    # severity
    def _setSeverity(self, value):
        try:
            if isinstance(value, str):
                value = severityId(value)
        except ValueError:
            # they entered junk somehow (default to info if invalid)
            value = severityId('info')
        self._object.severity = value

    def _getSeverity(self):
        return self._object.severity

    @property
    def newId(self):
        return self._object.id

    severity = property(_getSeverity, _setSeverity)
    cycletime = ProxyProperty('cycletime')
    eventClass = ProxyProperty('eventClass')
示例#16
0
class WinRMPingDataSourceInfo(InfoBase):
    """
    Pull in proxy values so they can be utilized
    within the WinRS Service plugin.
    """
    implements(IWinRMPingDataSourceInfo)
    adapts(WinRMPingDataSource)

    cycletime = ProxyProperty('cycletime')
    enabled = ProxyProperty('enabled')

    @property
    def id(self):
        return '/'.join(self._object.getPrimaryPath())

    @property
    def type(self):
        return self._object.sourcetype

    @property
    def newId(self):
        return self._object.id

    @property
    def source(self):
        return self._object.getDescription()
示例#17
0
class PerfmonDataSourceInfo(RRDDataSourceInfo):
    implements(IPerfmonDataSourceInfo)
    adapts(PerfmonDataSource)

    testable = False
    cycletime = ProxyProperty('cycletime')
    counter = ProxyProperty('counter')
class HardDiskInfo(ComponentInfo):
    implements(interfaces.IHardDiskInfo)

    serialNumber = ProxyProperty("serialNumber")
    diskType = ProxyProperty("diskType")
    FWRev = ProxyProperty("FWRev")
    rpm = ProxyProperty("rpm")
    bay = ProxyProperty("bay")

    @property
    def size(self):
        return convToUnits(self._object.size, divby=1000.00)

    @property
    @info
    def manufacturer(self):
        pc = self._object.productClass()
        if (pc):
            return pc.manufacturer()

    @property
    @info
    def product(self):
        return self._object.productClass()

    @property
    def status(self):
        if not hasattr(self._object, 'statusString'): return 'Unknown'
        else: return self._object.statusString()
示例#19
0
class EC2VPCInfo(ComponentInfo):
    '''
    API Info adapter factory for EC2VPC.
    '''

    implements(IEC2VPCInfo)
    adapts(EC2VPC)

    state = ProxyProperty('state')
    cidr_block = ProxyProperty('cidr_block')
    collector = ProxyProperty('collector')

    @property
    @info
    def account(self):
        return self._object.device()

    @property
    @info
    def region(self):
        return self._object.region()

    @property
    def vpc_subnet_count(self):
        return self._object.vpc_subnets.countObjects()

    @property
    def instance_count(self):
        return sum(x.instances.countObjects()
                   for x in self._object.vpc_subnets())
示例#20
0
class PrintGraphPointInfo(GraphPointInfo):
    """
    Info Object for print graph points
    """
    implements(graphPointInterfaces.IPrintGraphPointInfo)
    vname = ProxyProperty('vname')
    format = ProxyProperty('format')
    strftime = ProxyProperty('strftime')
示例#21
0
class LineGraphPointInfo(ColorGraphPointInfo):
    """
    Info Object for Line Graph Points
    """
    implements(graphPointInterfaces.ILineGraphPointInfo)
    lineWidth = ProxyProperty('lineWidth')
    stacked = ProxyProperty('stacked')
    value = ProxyProperty('value')
示例#22
0
class WinIISInfo(WinComponentInfo):
    implements(IWinIISInfo)

    sitename = ProxyProperty('sitename')
    apppool = ProxyProperty('apppool')
    caption = ProxyProperty('caption')
    status = ProxyProperty('status')
    statusname = ProxyProperty('statusname')
class PythonDataSourceInfo(RRDDataSourceInfo):
    implements(IPythonDataSourceInfo)
    adapts(PythonDataSource)

    testable = False

    plugin_classname = ProxyProperty('plugin_classname')
    cycletime = ProxyProperty('cycletime')
示例#24
0
class xupsOutputInfo(ComponentInfo):
    implements(interfaces.IxupsOutputInfo)

    xupsOutputPhaseText = ProxyProperty("xupsOutputPhaseText")
    xupsOutputVoltage = ProxyProperty("xupsOutputVoltage")
    xupsOutputCurrent = ProxyProperty("xupsOutputCurrent")
    xupsOutputWatts = ProxyProperty("xupsOutputWatts")
    upsOutputPercentLoad = ProxyProperty("upsOutputPercentLoad")
示例#25
0
class xupsContactSenseInfo(ComponentInfo):
    implements(interfaces.IxupsContactSenseInfo)

    xupsContactType = ProxyProperty("xupsContactType")
    xupsContactTypeText = ProxyProperty("xupsContactTypeText")
    xupsContactState = ProxyProperty("xupsContactState")
    xupsContactStateText = ProxyProperty("xupsContactStateText")
    xupsContactDescr = ProxyProperty("xupsContactDescr")
class ZenPackCodeInfo(ComponentInfo):
    ''' API Info adapter factory for ZenPackCode '''

    implements(IZenPackCodeInfo)
    adapts(ZenPackCode)

    path = ProxyProperty('path')
    zenpack_state = ProxyProperty('zenpack_state')
class ActiveMQDataSourceInfo(RRDDataSourceInfo):
	implements(IActiveMQDataSourceInfo)
	adapts(ActiveMQDataSource)

	testable = False

	plugin_classname = ProxyProperty('plugin_classname')
	cycletime = ProxyProperty('cycletime')
示例#28
0
class upsOutputInfo(ComponentInfo):
    implements(interfaces.IupsOutputInfo)

    upsOutputLineIndexText = ProxyProperty("upsOutputLineIndexText")
    upsOutputVoltage = ProxyProperty("upsOutputVoltage")
    upsOutputCurrent = ProxyProperty("upsOutputCurrent")
    upsOutputPower = ProxyProperty("upsOutputPower")
    upsOutputPercentLoad = ProxyProperty("upsOutputPercentLoad")
示例#29
0
class upsInputInfo(ComponentInfo):
    implements(interfaces.IupsInputInfo)

    upsInputLineIndexText = ProxyProperty("upsInputLineIndexText")
    upsInputFrequency = ProxyProperty("upsInputFrequency")
    upsInputVoltage = ProxyProperty("upsInputVoltage")
    upsInputCurrent = ProxyProperty("upsInputCurrent")
    upsInputTruePower = ProxyProperty("upsInputTruePower")
示例#30
0
class IMMFwVpdInfo(ComponentInfo):
    implements(interfaces.IIMMFwVpdInfo)

    immVpdIndex = ProxyProperty("immVpdIndex")
    immVpdType = ProxyProperty("immVpdType")
    immVpdVersionString = ProxyProperty("immVpdVersionString")
    immVpdReleaseDate = ProxyProperty("immVpdReleaseDate")
    comment = ProxyProperty("comment")