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


Python pymunin.MuninPlugin类代码示例

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


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

示例1: __init__

    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,代码行数:32,代码来源:ntpstats.py

示例2: __init__

    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,代码行数:33,代码来源:fsstats.py

示例3: __init__

 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,代码行数:33,代码来源:phpfpmstats.py

示例4: __init__

    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,代码行数:29,代码来源:fsstats.py

示例5: __init__

    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,代码行数:35,代码来源:ntphostoffset_.py

示例6: __init__

 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,代码行数:60,代码来源:netstats.py

示例7: __init__

    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,代码行数:27,代码来源:ntpstats.py

示例8: __init__

    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._category = 'Disk IO'

        self._info = DiskIOinfo()
        
        self._labelDelim = { 'fs': '/', 'lv': '-'}
        
        self._diskList = self._info.getDiskList()
        if self._diskList:
            self._diskList.sort()
            self._configDevRequests('disk', 'Disk', self._diskList)
            self._configDevBytes('disk', 'Disk', self._diskList)
            self._configDevActive('disk', 'Disk', self._diskList)
            
        self._mdList = self._info.getMDlist()
        if self._mdList:
            self._mdList.sort()
            self._configDevRequests('md', 'MD', self._mdList)
            self._configDevBytes('md', 'MD', self._mdList)
            self._configDevActive('md', 'MD', self._mdList)
            
        devlist = self._info.getPartitionList()
        if devlist:
            devlist.sort()
            self._partList = [x[1] for x in devlist]
            self._configDevRequests('part', 'Partition', self._partList)
            self._configDevBytes('part', 'Partition', self._partList)
            self._configDevActive('part', 'Partition', self._partList)
        else:
            self._partList = None
            
        devlist = self._info.getLVlist()
        if devlist:
            devlist.sort()
            self._lvList = ["-".join(x) for x in devlist]
            self._configDevRequests('lv', 'LV', self._lvList)
            self._configDevBytes('lv', 'LV', self._lvList)
            self._configDevActive('lv', 'LV', self._lvList)
        else:
            self._lvList = None
        
        self._fsList = self._info.getFilesystemList()
        self._fsList.sort()
        self._configDevRequests('fs', 'Filesystem', self._fsList)
        self._configDevBytes('fs', 'Filesystem', self._fsList)
        self._configDevActive('fs', 'Filesystem', self._fsList)
开发者ID:phizev,项目名称:PyMunin,代码行数:54,代码来源:diskiostats.py

示例9: __init__

 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,代码行数:54,代码来源:diskusagestats.py

示例10: __init__

    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.envHasKey("ntphosts"):
            hosts_str = re.sub("[^\d\.,]", "", self.envGet("ntphosts"))
            self._remoteHosts = hosts_str.split(",")
        else:
            raise AttributeError("Remote host list must be passed in the " "'ntphosts' environment variable.")

        if self.graphEnabled("ntp_host_stratums"):
            graph = MuninGraph(
                "NTP Stratums of Multiple Hosts",
                "Time",
                info="NTP Stratum of Multiple Remote Hosts.",
                args="--base 1000 --lower-limit 0",
            )
            for host in self._remoteHosts:
                hostkey = re.sub("\.", "_", host)
                graph.addField(hostkey, host, type="GAUGE", draw="LINE2")
            self.appendGraph("ntp_host_stratums", graph)

        if self.graphEnabled("ntp_host_offsets"):
            graph = MuninGraph(
                "NTP Offsets of Multiple Hosts",
                "Time",
                info="NTP Delays of Multiple Hosts relative to current node.",
                args="--base 1000 --lower-limit 0",
                vlabel="seconds",
            )
            for host in self._remoteHosts:
                hostkey = re.sub("\.", "_", host)
                graph.addField(hostkey, host, type="GAUGE", draw="LINE2")
            self.appendGraph("ntp_host_offsets", graph)

        if self.graphEnabled("ntp_host_delays"):
            graph = MuninGraph(
                "NTP Delays of Multiple Hosts",
                "Time",
                info="NTP Delays of Multiple Hosts relative to current node.",
                args="--base 1000 --lower-limit 0",
                vlabel="seconds",
            )
            for host in self._remoteHosts:
                hostkey = re.sub("\.", "_", host)
                graph.addField(hostkey, host, type="GAUGE", draw="LINE2")
            self.appendGraph("ntp_host_delays", graph)
开发者ID:kolyagora,项目名称:PyMunin,代码行数:53,代码来源:ntphostoffsets.py

示例11: __init__

    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,代码行数:50,代码来源:lighttpdstats.py

示例12: __init__

    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._category = 'Time'

        if self.envHasKey('ntphosts'):
            hosts_str = re.sub('[^\d\.,]', '', self.envGet('ntphosts'))
            self._remoteHosts = hosts_str.split(',')
        else:
            raise AttributeError("Remote host list must be passed in the "
                                 "'ntphosts' environment variable.")

        if self.graphEnabled('ntp_host_stratums'):
            graph = MuninGraph('NTP Stratums of Multiple Hosts', self._category,
                info='NTP Stratum of Multiple Remote Hosts.',
                args='--base 1000 --lower-limit 0')
            for host in self._remoteHosts:
                hostkey = re.sub('\.', '_', host)
                graph.addField(hostkey, host, type='GAUGE', draw='LINE2')
            self.appendGraph('ntp_host_stratums', graph)

        if self.graphEnabled('ntp_host_offsets'):
            graph = MuninGraph('NTP Offsets of Multiple Hosts', self._category,
                info='NTP Delays of Multiple Hosts relative to current node.',
                args ='--base 1000 --lower-limit 0',
                vlabel='seconds'
                )
            for host in self._remoteHosts:
                hostkey = re.sub('\.', '_', host)
                graph.addField(hostkey, host, type='GAUGE', draw='LINE2')
            self.appendGraph('ntp_host_offsets', graph)
    
        if self.graphEnabled('ntp_host_delays'):
            graph = MuninGraph('NTP Delays of Multiple Hosts', self._category,
                info='NTP Delays of Multiple Hosts relative to current node.',
                args='--base 1000 --lower-limit 0',
                vlabel='seconds'
                )
            for host in self._remoteHosts:
                hostkey = re.sub('\.', '_', host)
                graph.addField(hostkey, host, type='GAUGE', draw='LINE2')
            self.appendGraph('ntp_host_delays', graph)
开发者ID:phizev,项目名称:PyMunin,代码行数:48,代码来源:ntphostoffsets.py

示例13: __init__

    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._category = 'Processes'

        for (prefix, title, desc) in (('proc', self._category, 'Number of processes'),
                                      ('thread', 'Threads', 'Number of threads')):
            graph_name = '%s_status' % prefix
            graph_title = '%s - Status' % title
            graph_desc = '%s discriminated by status.' % desc 
            if self.graphEnabled(graph_name):
                graph = MuninGraph(graph_title, self._category, info=graph_desc,
                    args='--base 1000 --lower-limit 0')
                for (fname, fdesc) in (
                    ('unint_sleep', 'Uninterruptable sleep. (Usually I/O)'),
                    ('stopped', 'Stopped, either by job control signal '
                     'or because it is being traced.'),
                    ('defunct', 'Defunct (zombie) process. '
                                'Terminated but not reaped by parent.'),
                    ('running', 'Running or runnable (on run queue).'),
                    ('sleep', 'Interruptable sleep. '
                              'Waiting for an event to complete.')): 
                    graph.addField(fname, fname, type='GAUGE', draw='AREA',
                                   info=fdesc)
                self.appendGraph(graph_name, graph)
                
            graph_name = '%s_prio' % prefix
            graph_title = '%s - Priority' % title
            graph_desc = '%s discriminated by priority.' % desc 
            if self.graphEnabled(graph_name):
                graph = MuninGraph(graph_title, self._category, info=graph_desc,
                    args='--base 1000 --lower-limit 0')
                for (fname, fdesc) in (
                    ('high', 'High priority.'),
                    ('low', 'Low priority.'),
                    ('norm', 'Normal priority.')):
                    graph.addField(fname, fname, type='GAUGE', draw='AREA',
                                   info=fdesc) 
                graph.addField('locked', 'locked', type='GAUGE', draw='LINE2',
                               info='Has pages locked into memory.')
                self.appendGraph(graph_name, graph)
开发者ID:phizev,项目名称:PyMunin,代码行数:48,代码来源:procstats.py

示例14: __init__

    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,代码行数:47,代码来源:rackspacestats.py

示例15: __init__

 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,代码行数:47,代码来源:apachestats.py


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