当前位置: 首页>>代码示例>>Python>>正文


Python MuninGraph.addField方法代码示例

本文整理汇总了Python中pymunin.MuninGraph.addField方法的典型用法代码示例。如果您正苦于以下问题:Python MuninGraph.addField方法的具体用法?Python MuninGraph.addField怎么用?Python MuninGraph.addField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pymunin.MuninGraph的用法示例。


在下文中一共展示了MuninGraph.addField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from pymunin import MuninGraph [as 别名]
# 或者: from pymunin.MuninGraph import addField [as 别名]
    def __init__(self, argv=(), env={}, debug=False):
        """Populate Munin Plugin with MuninGraph instances.
        
        @param argv:  List of command line arguments.
        @param env:   Dictionary of environment variables.
        @param debug: Print debugging messages if True. (Default: False)
        
        """
        MuninPlugin.__init__(self, argv, env, debug)

        self._fshost = self.envGet('fshost')
        self._fsport = self.envGet('fsport', None, int)
        self._fspass = self.envGet('fspass')

        if self.graphEnabled('fs_calls'):
            graph = MuninGraph('FreeSWITCH - Active Calls', 'FreeSwitch',
                info = 'FreeSWITCH - Number of Active Calls.',
                args = '--base 1000 --lower-limit 0')
            graph.addField('calls', 'calls', type='GAUGE',
                draw='LINE2',info='Active Calls')
            self.appendGraph('fs_calls', graph)

        if self.graphEnabled('fs_channels'):
            graph = MuninGraph('FreeSWITCH - Active Channels', 'FreeSWITCH',
                info = 'FreeSWITCH - Number of Active Channels.',
                args = '--base 1000 --lower-limit 0')
            graph.addField('channels', 'channels', type='GAUGE',
                           draw='LINE2')
            self.appendGraph('fs_channels', graph)
开发者ID:dhepper,项目名称:PyMunin,代码行数:31,代码来源:fsstats.py

示例2: __init__

# 需要导入模块: from pymunin import MuninGraph [as 别名]
# 或者: from pymunin.MuninGraph import addField [as 别名]
    def __init__(self, argv=(), env={}, debug=False):
        """Populate Munin Plugin with MuninGraph instances.
        
        @param argv:  List of command line arguments.
        @param env:   Dictionary of environment variables.
        @param debug: Print debugging messages if True. (Default: False)
        
        """
        MuninPlugin.__init__(self, argv, env, debug)

        self._fshost = self.envGet("fshost")
        self._fsport = self.envGet("fsport")
        self._fspass = self.envGet("fspass")

        if self.graphEnabled("fs_calls"):
            graph = MuninGraph(
                "FreeSWITCH - Active Calls",
                "FreeSwitch",
                info="FreeSWITCH - Number of Active Calls.",
                args="--base 1000 --lower-limit 0",
            )
            graph.addField("calls", "calls", type="GAUGE", draw="LINE2", info="Active Calls")
            self.appendGraph("fs_calls", graph)

        if self.graphEnabled("fs_channels"):
            graph = MuninGraph(
                "FreeSWITCH - Active Channels",
                "FreeSWITCH",
                info="FreeSWITCH - Number of Active Channels.",
                args="--base 1000 --lower-limit 0",
            )
            graph.addField("channels", "channels", type="GAUGE", draw="LINE2")
            self.appendGraph("fs_channels", graph)
开发者ID:remotesyssupport,项目名称:PyMunin,代码行数:35,代码来源:fsstats.py

示例3: __init__

# 需要导入模块: from pymunin import MuninGraph [as 别名]
# 或者: from pymunin.MuninGraph import addField [as 别名]
 def __init__(self, argv=(), env={}, debug=False):
     """Populate Munin Plugin with MuninGraph instances.
     
     @param argv:  List of command line arguments.
     @param env:   Dictionary of environment variables.
     @param debug: Print debugging messages if True. (Default: False)
     
     """     
     MuninPlugin.__init__(self, argv, env, debug)
      
     if self.graphEnabled('netstat_conn_status'):
         graph = MuninGraph('Network - Connection Status', 'Network', 
                            info='TCP connection status stats.',
                            args='--base 1000 --lower-limit 0')
         for (fname, fdesc) in (
             ('listen', 'Socket listening for incoming connections.'),
             ('established', 'Socket with established connection.'),
             ('syn_sent', 'Socket actively attempting connection.'),
             ('syn_recv', 'Socket that has received a connection request'
                          ' from network.'),
             ('fin_wait1', 'Connection closed, and connection shutting down.'),
             ('fin_wait2', 'Connection is closed, and the socket is waiting'
                           ' for  a  shutdown from the remote end.'),
             ('time_wait', 'Socket is waiting after close '
                           'to handle packets still in the network.'),
             ('close', 'Socket is not being used.'),
             ('close_wait', 'The remote end has shut down, '
                            'waiting for the socket to close.'),
             ('last_ack', 'The remote end has shut down, and the socket'
                          ' is closed.  Waiting for acknowledgement.'),
             ('closing', 'Both  sockets are shut down'
                         ' but not all data is sent yet.'),
             ('unknown', 'Sockets with unknown state.'),
             ): 
             graph.addField(fname, fname, type='GAUGE', draw='AREA',
                            info=fdesc)
         self.appendGraph('netstat_conn_status', graph)
         
     if self.graphEnabled('netstat_server_conn'):
         self._srv_dict = {}
         self._srv_list = []
         self._port_list = []
         for srv_str in self.envGetList('server_ports', '(\w+)(:\d+)+$'):
             elems = srv_str.split(':')
             if len(elems) > 1:
                 srv = elems[0]
                 ports = elems[1:]
                 self._srv_list.append(srv)
                 self._srv_dict[srv] = ports
                 self._port_list.extend(ports)      
         self._srv_list.sort()
         if len(self._srv_list) > 0:
             graph = MuninGraph('Network - Server Connections', 'Network', 
                                info='Number of TCP connections to server ports.',
                                args='--base 1000 --lower-limit 0')
             for srv in self._srv_list:
                 graph.addField(srv, srv, type='GAUGE', draw='AREA', 
                     info=('Number of connections for service %s on ports: %s' 
                           % (srv, ','.join(self._srv_dict[srv]))))
             self.appendGraph('netstat_conn_server', graph)
开发者ID:tehstone,项目名称:PyMunin,代码行数:62,代码来源:netstats.py

示例4: _configDevBytes

# 需要导入模块: from pymunin import MuninGraph [as 别名]
# 或者: from pymunin.MuninGraph import addField [as 别名]
 def _configDevBytes(self, namestr, titlestr, devlist):
     """Generate configuration for I/O Throughput stats.
     
     @param namestr:  Field name component indicating device type.
     @param titlestr: Title component indicating device type.
     @param devlist:  List of devices.
     
     """
     name = 'diskio_%s_bytes' % namestr
     if self.graphEnabled(name):
         graph = MuninGraph('Disk I/O - %s - Throughput' % titlestr, self._category,
             info='Disk I/O - %s Throughput, bytes read / written per second.'
                  % titlestr,
             args='--base 1000 --lower-limit 0', printf='%6.1lf',
             vlabel='bytes/sec read (-) / write (+)',
             autoFixNames = True)
         for dev in devlist:
             graph.addField(dev + '_read', 
                            fixLabel(dev, maxLabelLenGraphDual, 
                                     repl = '..', truncend=False,
                                     delim = self._labelDelim.get(namestr)),
                            draw='LINE2', type='DERIVE', min=0, graph=False)
             graph.addField(dev + '_write', 
                            fixLabel(dev, maxLabelLenGraphDual, 
                                     repl = '..', truncend=False,
                                     delim = self._labelDelim.get(namestr)),
                            draw='LINE2', type='DERIVE', min=0, 
                            negative=(dev + '_read'), info=dev)
         self.appendGraph(name, graph)
开发者ID:87439247,项目名称:PyMunin,代码行数:31,代码来源:diskiostats.py

示例5: __init__

# 需要导入模块: from pymunin import MuninGraph [as 别名]
# 或者: from pymunin.MuninGraph import addField [as 别名]
 def __init__(self, argv=(), env=None, debug=False):
     """Populate Munin Plugin with MuninGraph instances.
     
     @param argv:  List of command line arguments.
     @param env:   Dictionary of environment variables.
     @param debug: Print debugging messages if True. (Default: False)
     
     """
     MuninPlugin.__init__(self, argv, env, debug)
     
     self.envRegisterFilter('fspaths', '^[\w\-\/]+$')
     self.envRegisterFilter('fstypes', '^\w+$')
     self._category = 'Disk Usage'
     
     self._statsSpace = None
     self._statsInode = None
     self._info = FilesystemInfo()
     
     self._fslist = [fs for fs in self._info.getFSlist()
                     if (self.fsPathEnabled(fs) 
                         and self.fsTypeEnabled(self._info.getFStype(fs)))]
     self._fslist.sort()
     
     name = 'diskspace'
     if self.graphEnabled(name):
         self._statsSpace = self._info.getSpaceUse()
         graph = MuninGraph('Disk Space Usage (%)', self._category,
             info='Disk space usage of filesystems.',
             args='--base 1000 --lower-limit 0', printf='%6.1lf',
             autoFixNames=True)
         for fspath in self._fslist:
             if self._statsSpace.has_key(fspath):
                 graph.addField(fspath, 
                     fixLabel(fspath, maxLabelLenGraphSimple, 
                              delim='/', repl='..', truncend=False), 
                     draw='LINE2', type='GAUGE',
                     info="Disk space usage for: %s" % fspath)
         self.appendGraph(name, graph)
     
     name = 'diskinode'
     if self.graphEnabled(name):
         self._statsInode = self._info.getInodeUse()
         graph = MuninGraph('Inode Usage (%)', self._category,
             info='Inode usage of filesystems.',
             args='--base 1000 --lower-limit 0', printf='%6.1lf',
             autoFixNames=True)
         for fspath in self._fslist:
             if self._statsInode.has_key(fspath):
                 graph.addField(fspath,
                     fixLabel(fspath, maxLabelLenGraphSimple, 
                              delim='/', repl='..', truncend=False), 
                     draw='LINE2', type='GAUGE',
                     info="Inode usage for: %s" % fspath)
         self.appendGraph(name, graph)
开发者ID:87439247,项目名称:PyMunin,代码行数:56,代码来源:diskusagestats.py

示例6: __init__

# 需要导入模块: from pymunin import MuninGraph [as 别名]
# 或者: from pymunin.MuninGraph import addField [as 别名]
    def __init__(self, argv=(), env={}, debug=False):
        """Populate Munin Plugin with MuninGraph instances.
        
        @param argv:  List of command line arguments.
        @param env:   Dictionary of environment variables.
        @param debug: Print debugging messages if True. (Default: False)
        
        """      
        MuninPlugin.__init__(self, argv, env, debug)

        if self.graphEnabled('ntp_peer_stratum'):
            graph = MuninGraph('NTP Stratum for System Peer', 'Time',
                info='Stratum of the NTP Server the system is in sync with.',
                args='--base 1000 --lower-limit 0')
            graph.addField('stratum', 'stratum', type='GAUGE', draw='LINE2')
            self.appendGraph('ntp_peer_stratum', graph)

        if self.graphEnabled('ntp_peer_stats'):
            graph = MuninGraph('NTP Timing Stats for System Peer', 'Time',
                info='Timing Stats for the NTP Server the system is in sync with.',
                args='--base 1000 --lower-limit 0',
                vlabel='seconds'
                )
            graph.addField('offset', 'offset', type='GAUGE', draw='LINE2')
            graph.addField('delay', 'delay', type='GAUGE', draw='LINE2')
            graph.addField('jitter', 'jitter', type='GAUGE', draw='LINE2')
            self.appendGraph('ntp_peer_stats', graph)
开发者ID:dhepper,项目名称:PyMunin,代码行数:29,代码来源:ntpstats.py

示例7: __init__

# 需要导入模块: from pymunin import MuninGraph [as 别名]
# 或者: from pymunin.MuninGraph import addField [as 别名]
 def __init__(self, argv=(), env={}, debug=False):
     """Populate Munin Plugin with MuninGraph instances.
     
     @param argv:  List of command line arguments.
     @param env:   Dictionary of environment variables.
     @param debug: Print debugging messages if True. (Default: False)
     
     """
     MuninPlugin.__init__(self, argv, env, debug)
     
     self._host = self.envGet('host')
     self._port = self.envGet('port', None, int)
     self._user = self.envGet('user')
     self._monpath = self.envGet('monpath')
     self._password = self.envGet('password')
     self._ssl = self.envCheckFlag('ssl', False) 
     
     if self.graphEnabled('php_fpm_connections'):
         graph = MuninGraph('PHP FPM - Connections per second', 'PHP',
             info='PHP Fast Process Manager (FPM) - Connections per second.',
             args='--base 1000 --lower-limit 0')
         graph.addField('conn', 'conn', draw='LINE2', type='DERIVE', min=0)
         self.appendGraph('php_fpm_connections', graph)
     
     if self.graphEnabled('php_fpm_processes'):
         graph = MuninGraph('PHP FPM - Processes', 'PHP',
             info='PHP Fast Process Manager (FPM) - Active / Idle Processes.',
             args='--base 1000 --lower-limit 0')
         graph.addField('active', 'active', draw='AREASTACK', type='GAUGE')
         graph.addField('idle', 'idle', draw='AREASTACK', type='GAUGE')
         graph.addField('total', 'total', draw='LINE2', type='GAUGE',
                        colour='000000')
         self.appendGraph('php_fpm_processes', graph)
开发者ID:dhepper,项目名称:PyMunin,代码行数:35,代码来源:phpfpmstats.py

示例8: __init__

# 需要导入模块: from pymunin import MuninGraph [as 别名]
# 或者: from pymunin.MuninGraph import addField [as 别名]
    def __init__(self, argv=(), env={}, debug=False):
        """Populate Munin Plugin with MuninGraph instances.
        
        @param argv:  List of command line arguments.
        @param env:   Dictionary of environment variables.
        @param debug: Print debugging messages if True. (Default: False)
        
        """
        MuninPlugin.__init__(self, argv, env, debug)

        if self.graphEnabled("ntp_peer_stratum"):
            graph = MuninGraph(
                "NTP Stratum for System Peer",
                "Time",
                info="Stratum of the NTP Server the system is in sync with.",
                args="--base 1000 --lower-limit 0",
            )
            graph.addField("stratum", "stratum", type="GAUGE", draw="LINE2")
            self.appendGraph("ntp_peer_stratum", graph)

        if self.graphEnabled("ntp_peer_stats"):
            graph = MuninGraph(
                "NTP Timing Stats for System Peer",
                "Time",
                info="Timing Stats for the NTP Server the system is in sync with.",
                args="--base 1000 --lower-limit 0",
                vlabel="seconds",
            )
            graph.addField("offset", "offset", type="GAUGE", draw="LINE2")
            graph.addField("delay", "delay", type="GAUGE", draw="LINE2")
            graph.addField("jitter", "jitter", type="GAUGE", draw="LINE2")
            self.appendGraph("ntp_peer_stats", graph)
开发者ID:tehstone,项目名称:PyMunin,代码行数:34,代码来源:ntpstats.py

示例9: __init__

# 需要导入模块: from pymunin import MuninGraph [as 别名]
# 或者: from pymunin.MuninGraph import addField [as 别名]
    def __init__(self, argv=(), env={}, debug=False):
        """
        Populate Munin Plugin with MuninGraph instances.
        
        @param argv:  List of command line arguments.
        @param env:   Dictionary of environment variables.
        @param debug: Print debugging messages if True. (Default: False)
        
        """
        MuninPlugin.__init__(self, argv, env, debug)

        self._container = self.envGet("container")
        self._username = self.envGet("username")
        self._api_key = self.envGet("api_key")

        self._stats = None
        self._prev_stats = self.restoreState()
        if self._prev_stats is None:
            cdnInfo = RackspaceContainerInfo(self._container, self._username, self._api_key)
            self._stats = cdnInfo.getStats()
            stats = self._stats
        else:
            stats = self._prev_stats
        if stats is None:
            raise Exception("Undetermined error accessing stats.")

        if stats.has_key("rackspace_containersize"):
            graph = MuninGraph(
                "Rackspace - Container Size",
                "Rackspace",
                info="The total size of files contained in a Rackspace CDN container",
                vlabel="bytes",
                args="--base 1024 --lower-limit 0",
            )
            graph.addField("size", "size", draw="AREASTACK", type="GAUGE")
            self.appendGraph("rackspace_containersize", graph)

        if stats.has_key("rackspace_containercount"):
            graph = MuninGraph(
                "Rackspace - Container Count",
                "Rackspace",
                info="The total number of files contained in a Rackspace CDN container",
                vlabel="objects",
                args="--base 1000 --lower-limit 0",
            )
            graph.addField("count", "count", draw="AREASTACK", type="GAUGE")
            self.appendGraph("rackspace_containercount", graph)
开发者ID:pastpages,项目名称:PyMunin,代码行数:49,代码来源:rackspacestats.py

示例10: __init__

# 需要导入模块: from pymunin import MuninGraph [as 别名]
# 或者: from pymunin.MuninGraph import addField [as 别名]
 def __init__(self, argv=(), env=None, debug=False):
     """Populate Munin Plugin with MuninGraph instances.
     
     @param argv:  List of command line arguments.
     @param env:   Dictionary of environment variables.
     @param debug: Print debugging messages if True. (Default: False)
     
     """
     MuninPlugin.__init__(self, argv, env, debug)
     
     self._host = self.envGet('host')
     self._port = self.envGet('port', None, int)
     self._user = self.envGet('user')
     self._password = self.envGet('password')
     self._statuspath = self.envGet('statuspath')
     self._ssl = self.envCheckFlag('ssl', False)
     self._category = 'Apache'
     
     if self.graphEnabled('apache_access'):
         graph = MuninGraph('Apache Web Server - Throughput (Requests / sec)', 
             self._category,
             info='Throughput in Requests per second for Apache Web Server.',
             args='--base 1000 --lower-limit 0')
         graph.addField('reqs', 'reqs', draw='LINE2', type='DERIVE', min=0,
             info="Requests per second.")
         self.appendGraph('apache_access', graph)
     
     if self.graphEnabled('apache_bytes'):
         graph = MuninGraph('Apache Web Server - Througput (bytes/sec)', 
             self._category,
             info='Throughput in bytes per second for Apache Web Server.',
             args='--base 1024 --lower-limit 0')
         graph.addField('bytes', 'bytes', draw='LINE2', type='DERIVE', min=0)
         self.appendGraph('apache_bytes', graph)
             
     if self.graphEnabled('apache_workers'):
         graph = MuninGraph('Apache Web Server - Workers', self._category,
             info='Worker utilization stats for Apache Web server.',
             args='--base 1000 --lower-limit 0')
         graph.addField('busy', 'busy', draw='AREASTACK', type='GAUGE',
             info="Number of busy workers.")
         graph.addField('idle', 'idle', draw='AREASTACK', type='GAUGE',
             info="Number of idle workers.")
         graph.addField('max', 'max', draw='LINE2', type='GAUGE',
             info="Maximum number of workers permitted.",
             colour='FF0000')
         self.appendGraph('apache_workers', graph)
开发者ID:phizev,项目名称:PyMunin,代码行数:49,代码来源:apachestats.py

示例11: __init__

# 需要导入模块: from pymunin import MuninGraph [as 别名]
# 或者: from pymunin.MuninGraph import addField [as 别名]
 def __init__(self, argv=(), env=None, debug=False):
     """
     Populate Munin Plugin with MuninGraph instances.
     
     @param argv:  List of command line arguments.
     @param env:   Dictionary of environment variables.
     @param debug: Print debugging messages if True. (Default: False)
     
     """
     MuninPlugin.__init__(self, argv, env, debug)
     
     self.envRegisterFilter('container', '^\w+$')
     self._username = self.envGet('username')
     self._api_key = self.envGet('api_key')
     self._region = self.envGet('region')
     self._servicenet = self.envCheckFlag('servicenet', False)
     self._category = 'Rackspace'
     
     self._fileInfo = CloudFilesInfo(username=self._username,
                                     api_key=self._api_key,
                                     region=self._region,
                                     servicenet=self._servicenet)
     self._fileContList = [name for name in self._fileInfo.getContainerList()
                                if self.containerIncluded(name)]
     
     if self.graphEnabled('rackspace_cloudfiles_container_size'):
         graph = MuninGraph('Rackspace Cloud Files - Container Size (bytes)', 
                            self._category,
             info='The total size of files for each Rackspace Cloud Files container.',
             args='--base 1024 --lower-limit 0', autoFixNames=True)
         for contname in self._fileContList:
                 graph.addField(contname, contname, draw='AREASTACK', 
                                type='GAUGE')
         self.appendGraph('rackspace_cloudfiles_container_size', graph)
     
     if self.graphEnabled('rackspace_cloudfiles_container_count'):
         graph = MuninGraph('Rackspace Cloud Files - Container Object Count', 
                            self._category,
             info='The total number of files for each Rackspace Cloud Files container.',
             args='--base 1024 --lower-limit 0', autoFixNames=True)
         for contname in self._fileContList:
                 graph.addField(contname, contname, draw='AREASTACK', 
                                type='GAUGE')
         self.appendGraph('rackspace_cloudfiles_container_count', graph)
开发者ID:87439247,项目名称:PyMunin,代码行数:46,代码来源:rackspacestats.py

示例12: __init__

# 需要导入模块: from pymunin import MuninGraph [as 别名]
# 或者: from pymunin.MuninGraph import addField [as 别名]
 def __init__(self, argv=(), env={}, debug=False):
     """
     Populate Munin Plugin with MuninGraph instances.
     
     @param argv:  List of command line arguments.
     @param env:   Dictionary of environment variables.
     @param debug: Print debugging messages if True. (Default: False)
     
     """
     MuninPlugin.__init__(self, argv, env, debug)
     
     self._container = self.envGet('container')
     self._username = self.envGet('username')
     self._api_key = self.envGet('api_key')
     
     self._stats = None
     self._prev_stats = self.restoreState()
     if self._prev_stats is None:
         cdnInfo = RackspaceContainerInfo(
             self._container,
             self._username, 
             self._api_key
         )
         self._stats = cdnInfo.getStats()
         stats = self._stats
     else:
         stats = self._prev_stats
     if stats is None:
         raise Exception("Undetermined error accessing stats.")
     
     if stats.has_key('rackspace_containersize'):
         graph = MuninGraph('Rackspace - Container Size', 'Rackspace',
             info='The total size of files contained in a Rackspace CDN container',
             vlabel='bytes', args='--base 1024 --lower-limit 0')
         graph.addField('size', 'size', draw='AREASTACK', type='GAUGE')
         self.appendGraph('rackspace_containersize', graph)
     
     if stats.has_key('rackspace_containercount'):
         graph = MuninGraph('Rackspace - Container Count', 'Rackspace',
             info='The total number of files contained in a Rackspace CDN container',
             vlabel='objects', args='--base 1000 --lower-limit 0')
         graph.addField('count', 'count', draw='AREASTACK', type='GAUGE')
         self.appendGraph('rackspace_containercount', graph)
开发者ID:earino,项目名称:pastpages.org,代码行数:45,代码来源:rackspacestats.py

示例13: __init__

# 需要导入模块: from pymunin import MuninGraph [as 别名]
# 或者: from pymunin.MuninGraph import addField [as 别名]
    def __init__(self, argv=(), env=None, debug=False):
        """Populate Munin Plugin with MuninGraph instances.
        
        @param argv:  List of command line arguments.
        @param env:   Dictionary of environment variables.
        @param debug: Print debugging messages if True. (Default: False)
        
        """
        MuninPlugin.__init__(self, argv, env, debug)

        if self.arg0 is None:
            raise Exception("Remote host name cannot be determined.")
        else:
            self._remoteHost = self.arg0

        if self.graphEnabled('ntp_host_stratum'):
            graphName = 'ntp_host_stratum_%s' % self._remoteHost
            graph = MuninGraph('NTP Stratum of Host %s' % self._remoteHost, 
                'Time',
                info='NTP Stratum of Host %s.' % self._remoteHost,
                args='--base 1000 --lower-limit 0')
            graph.addField('stratum', 'stratum', type='GAUGE', draw='LINE2')
            self.appendGraph(graphName, graph)

        if self.graphEnabled('ntp_host_stat'):
            graphName = 'ntp_host_stat_%s' % self._remoteHost
            graph = MuninGraph('NTP Offset of Host %s' % self._remoteHost, 'Time',
                info=('NTP Offset of Host %s relative to current node.' 
                      % self._remoteHost),
                args='--base 1000 --lower-limit 0',
                vlabel='seconds'
                )
            graph.addField('offset', 'offset', type='GAUGE', draw='LINE2')
            graph.addField('delay', 'delay', type='GAUGE', draw='LINE2')
            self.appendGraph(graphName, graph)
开发者ID:kolyagora,项目名称:PyMunin,代码行数:37,代码来源:ntphostoffset_.py

示例14: __init__

# 需要导入模块: from pymunin import MuninGraph [as 别名]
# 或者: from pymunin.MuninGraph import addField [as 别名]
 def __init__(self, argv=(), env={}, debug=False):
     """Populate Munin Plugin with MuninGraph instances.
     
     @param argv:  List of command line arguments.
     @param env:   Dictionary of environment variables.
     @param debug: Print debugging messages if True. (Default: False)
     
     """
     MuninPlugin.__init__(self, argv, env, debug)
     
     self.envRegisterFilter('ports', '^\d+$')
     
     self._host = self.envGet('hostname')
     self._community = self.envGet('community')
     self._name_full = []
     self._data_full = []
     self._protocol_name = []
     self._variable_name = []
     self._variable_type = []
     self._variable_data = []
     
     self._names_dic = self.dict_snmpbulkwalk('1.3.6.1.4.1.8384.1001.1.1.205',self._community,self._host)
     self._types_dic = self.dict_snmpbulkwalk('1.3.6.1.4.1.8384.1001.1.1.206',self._community,self._host)
     self._values_dic = self.dict_snmpbulkwalk('1.3.6.1.4.1.8384.1001.1.1.207',self._community,self._host)
     
         
     #Start of voyager graphing   
     if self.graphEnabled('vserverTable'):
         
         for name in self._names_dic['variable_data']:
             
             graph = MuninGraph('Voyager stats for %s' %(name), 'Voyager',
             info='%s'%(name),
             args='--base 1000 --lower-limit 0')
             
             
             graph.addField(name, name, draw='LINESTACK1', type='GAUGE',
                         info="Counts the %s field"%(name))
             
             self.appendGraph('%s'%(name), graph)
开发者ID:prizos,项目名称:common-scripts,代码行数:42,代码来源:pymunin-voyagersnmp.py

示例15: __init__

# 需要导入模块: from pymunin import MuninGraph [as 别名]
# 或者: from pymunin.MuninGraph import addField [as 别名]
    def __init__(self, argv=(), env=None, debug=False):
        """Populate Munin Plugin with MuninGraph instances.
        
        @param argv:  List of command line arguments.
        @param env:   Dictionary of environment variables.
        @param debug: Print debugging messages if True. (Default: False)
        
        """
        MuninPlugin.__init__(self, argv, env or {}, debug)

        self._host = self.envGet("host")
        self._port = self.envGet("port", None, int)
        self._user = self.envGet("user")
        self._password = self.envGet("password")
        self._statuspath = self.envGet("statuspath")
        self._ssl = self.envCheckFlag("ssl", False)

        if self.graphEnabled("lighttpd_access"):
            graph = MuninGraph(
                "Lighttpd Web Server - Throughput (Requests / sec)",
                "Lighttpd",
                info="Throughput in Requests per second for Lighttpd Web Server.",
                args="--base 1000 --lower-limit 0",
            )
            graph.addField("reqs", "reqs", draw="LINE2", type="DERIVE", min=0, info="Requests per second.")
            self.appendGraph("lighttpd_access", graph)

        if self.graphEnabled("lighttpd_bytes"):
            graph = MuninGraph(
                "Lighttpd Web Server - Througput (bytes/sec)",
                "Lighttpd",
                info="Throughput in bytes per second for Lighttpd Web Server.",
                args="--base 1024 --lower-limit 0",
            )
            graph.addField("bytes", "bytes", draw="LINE2", type="DERIVE", min=0)
            self.appendGraph("lighttpd_bytes", graph)

        if self.graphEnabled("lighttpd_servers"):
            graph = MuninGraph(
                "Lighttpd Web Server - Servers",
                "Lighttpd",
                info="Server utilization stats for Lighttpd Web server.",
                args="--base 1000 --lower-limit 0",
            )
            graph.addField("busy", "busy", draw="AREASTACK", type="GAUGE", info="Number of busy servers.")
            graph.addField("idle", "idle", draw="AREASTACK", type="GAUGE", info="Number of idle servers.")
            graph.addField(
                "max", "max", draw="LINE2", type="GAUGE", info="Maximum number of servers permitted.", colour="FF0000"
            )
            self.appendGraph("lighttpd_servers", graph)
开发者ID:redtoad,项目名称:PyMunin,代码行数:52,代码来源:lighttpdstats.py


注:本文中的pymunin.MuninGraph.addField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。