Package Products :: Package ZenRRD :: Module SnmpDaemon |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenRRD.SnmpDaemon

     1  ###########################################################################
     2  #
     3  # This program is part of Zenoss Core, an open source monitoring platform.
     4  # Copyright (C) 2007, Zenoss Inc.
     5  #
     6  # This program is free software; you can redistribute it and/or modify it
     7  # under the terms of the GNU General Public License version 2 as published by
     8  # the Free Software Foundation.
     9  #
    10  # For complete information please visit: http://www.zenoss.com/oss/
    11  #
    12  ###########################################################################
    13
    14  __doc__ = """SnmpDaemon
    15
    16  Common performance monitoring daemon code for zenperfsnmp and zenprocess.
    17
    18  """
    19
    20  from RRDDaemon import RRDDaemon
    21
    22  from pynetsnmp.twistedsnmp import snmpprotocol
    23
    24 -class SnmpDaemon(RRDDaemon):
    25      snmpCycleInterval = 5*60            # seconds
    26      heartbeatTimeout = snmpCycleInterval*3
    27
    28      properties = RRDDaemon.properties + ('snmpCycleInterval',)
    29
    30 -    def __init__(self, name, noopts=False):
    31          """
    32          Initializer for common SNMP daemon classes
    33
    34          @param name: name of the daemon
    35          @type name: string
    36          @param noopts: process command-line arguments?
    37          @type noopts: boolean
    38          """
    39          RRDDaemon.__init__(self, name, noopts)
    40          self.snmpPort = snmpprotocol.port()
    41
    42 -    def setPropertyItems(self, items):
    43          """
    44          Set all of the specified zProperties.
    45
    46          @param items: kwargs
    47          @type items: list
    48          """
    49          RRDDaemon.setPropertyItems(self, items)
    50          self.heartbeatTimeout = self.snmpCycleInterval*3
    51