Ejemplo n.º 1
0
def main():
    sys.exit(muninMain(MuninPHPfpmPlugin))
Ejemplo n.º 2
0
        net_info = NetstatInfo()
        if self.hasGraph('netstat_conn_status'):
            stats = net_info.getTCPportConnStatus(include_listen=True)
            for fname in (
                    'listen',
                    'established',
                    'syn_sent',
                    'syn_recv',
                    'fin_wait1',
                    'fin_wait2',
                    'time_wait',
                    'close',
                    'close_wait',
                    'last_ack',
                    'closing',
                    'unknown',
            ):
                self.setGraphVal('netstat_conn_status', fname,
                                 stats.get(fname, 0))
        if self.hasGraph('netstat_conn_server'):
            stats = net_info.getTCPportConnCount(localport=self._port_list)
            for srv in self._srv_list:
                numconn = 0
                for port in self._srv_dict[srv]:
                    numconn += stats.get(port, 0)
                self.setGraphVal('netstat_conn_server', srv, numconn)


if __name__ == "__main__":
    sys.exit(muninMain(MuninNetstatsPlugin))
Ejemplo n.º 3
0
def main():
    sys.exit(muninMain(MuninNetstatsPlugin))
Ejemplo n.º 4
0
def main():
    sys.exit(muninMain(MuninDiskIOplugin))
Ejemplo n.º 5
0
def main():
    sys.exit(muninMain(MuninApachePlugin))
Ejemplo n.º 6
0
                        abandon = (stats.get('calls_abandoned', 0) -
                                   prev_stats.get('calls_abandoned', 0))
                        answer = (stats.get('calls_completed', 0) -
                                  prev_stats.get('calls_completed', 0))
                        if answer >= 0 and abandon >= 0:
                            total = abandon + answer
                            if total > 0:
                                val = 100.0 * float(abandon) / float(total)
                    self.setGraphVal('asterisk_queue_abandon_pcent', queue,
                                     val)
            if self.hasGraph('asterisk_queue_calls'):
                self.setGraphVal('asterisk_queue_calls', 'abandon',
                                 total_abandon)
                self.setGraphVal('asterisk_queue_calls', 'answer',
                                 total_answer)

        if self._fax_stats is not None:
            if self.hasGraph('asterisk_fax_attempts'):
                stats = self._fax_stats.get('general')
                if stats is not None:
                    self.setGraphVal('asterisk_fax_attempts', 'send',
                                     stats.get('transmit attempts'))
                    self.setGraphVal('asterisk_fax_attempts', 'recv',
                                     stats.get('receive attempts'))
                    self.setGraphVal('asterisk_fax_attempts', 'fail',
                                     stats.get('failed faxes'))


if __name__ == "__main__":
    sys.exit(muninMain(MuninAsteriskPlugin))
Ejemplo n.º 7
0
                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)

    def retrieveVals(self):
        """Retrieve values for graphs."""
        ntpinfo = NTPinfo()
        ntpstats = ntpinfo.getHostOffsets(self._remoteHosts)
        if ntpstats:
            for host in self._remoteHosts:
                hostkey = re.sub('\.', '_', host)
                hoststats = ntpstats.get(host)
                if hoststats:
                    if self.hasGraph('ntp_host_stratums'):
                        self.setGraphVal('ntp_host_stratums', hostkey,
                                         hoststats.get('stratum'))
                    if self.hasGraph('ntp_host_offsets'):
                        self.setGraphVal('ntp_host_offsets', hostkey,
                                         hoststats.get('offset'))
                    if self.hasGraph('ntp_host_delays'):
                        self.setGraphVal('ntp_host_delays', hostkey,
                                         hoststats.get('delay'))


if __name__ == "__main__":
    sys.exit(muninMain(MuninNTPhostOffsetsPlugin))
Ejemplo n.º 8
0
                if (self.graphEnabled('wanpipe_pri_errors')
                        or self.graphEnabled('wanpipe_rxlevel')):
                    try:
                        stats = self._wanpipeInfo.getPRIstats(iface)
                    except:
                        stats = None
                    if stats:
                        graph_name = 'wanpipe_pri_errors_%s' % iface
                        if self.hasGraph(graph_name):
                            for field in ('linecodeviolation',
                                          'farendblockerrors', 'crc4errors',
                                          'faserrors'):
                                self.setGraphVal(graph_name, field,
                                                 stats.get(field))
                        if self.hasGraph('wanpipe_rxlevel'):
                            self.setGraphVal('wanpipe_pri_rxlevel', iface,
                                             stats.get('rxlevel'))

    def ifaceIncluded(self, iface):
        """Utility method to check if interface is included in monitoring.
        
        @param iface: Interface name.
        @return:      Returns True if included in graphs, False otherwise.
            
        """
        return self.envCheckFilter('ifaces', iface)


if __name__ == "__main__":
    sys.exit(muninMain(MuninWanpipePlugin))
Ejemplo n.º 9
0
                '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)

    def retrieveVals(self):
        """Retrieve values for graphs."""
        fpminfo = PHPfpmInfo(self._host, self._port, self._user,
                             self._password, self._monpath, self._ssl)
        stats = fpminfo.getStats()
        if self.hasGraph('php_fpm_connections') and stats:
            self.setGraphVal('php_fpm_connections', 'conn',
                             stats['accepted conn'])
        if self.hasGraph('php_fpm_processes') and stats:
            self.setGraphVal('php_fpm_processes', 'active',
                             stats['active processes'])
            self.setGraphVal('php_fpm_processes', 'idle',
                             stats['idle processes'])
            self.setGraphVal('php_fpm_processes', 'total',
                             stats['total processes'])


if __name__ == "__main__":
    sys.exit(muninMain(MuninPHPfpmPlugin))
Ejemplo n.º 10
0
def main():
    sys.exit(muninMain(MuninCgminerPlugin))
Ejemplo n.º 11
0
def main():
    sys.exit(muninMain(MuninActiveMQPlugin))
Ejemplo n.º 12
0
def main():
    sys.exit(muninMain(MuninDiskUsagePlugin))
Ejemplo n.º 13
0
def main():
    sys.exit(muninMain(MuninPHPZopPlugin))
Ejemplo n.º 14
0
def main():
    sys.exit(muninMain(MuninDiskUsagePlugin))
Ejemplo n.º 15
0
def main():
    sys.exit(muninMain(MuninTomcatPlugin))
Ejemplo n.º 16
0
def main():
    sys.exit(muninMain(RedisPlugin))
Ejemplo n.º 17
0
def main():
    sys.exit(muninMain(MuninLighttpdPlugin))
Ejemplo n.º 18
0
def main():
    sys.exit(muninMain(MuninMemcachedPlugin))
Ejemplo n.º 19
0
                               negative='rxfifo',
                               info='Rx(-)/Tx(+) FIFO Errors per second.')
                self.appendGraph('netiface_errors_%s' % iface, graph)

    def retrieveVals(self):
        """Retrieve values for graphs."""
        for iface in self._ifaceList:
            stats = self._ifaceStats.get(iface)
            graph_name = 'netiface_traffic_%s' % iface
            if self.hasGraph(graph_name):
                self.setGraphVal(graph_name, 'rx', stats.get('rxbytes') * 8)
                self.setGraphVal(graph_name, 'tx', stats.get('txbytes') * 8)
            graph_name = 'netiface_errors_%s' % iface
            if self.hasGraph(graph_name):
                for field in ('rxerrs', 'txerrs', 'rxframe', 'txcarrier',
                              'rxdrop', 'txdrop', 'rxfifo', 'txfifo'):
                    self.setGraphVal(graph_name, field, stats.get(field))

    def ifaceIncluded(self, iface):
        """Utility method to check if interface is included in monitoring.
        
        @param iface: Interface name.
        @return:      Returns True if included in graphs, False otherwise.
            
        """
        return self.envCheckFilter('ifaces', iface)


if __name__ == "__main__":
    sys.exit(muninMain(MuninNetIfacePlugin))
Ejemplo n.º 20
0
def main():
    sys.exit(muninMain(MuninAsteriskPlugin))
Ejemplo n.º 21
0
def main():
    sys.exit(muninMain(MuninPHPOPCPlugin))
Ejemplo n.º 22
0
def main():
    sys.exit(muninMain(MuninVoyagerPlugin))
Ejemplo n.º 23
0
def main():
    sys.exit(muninMain(MuninBoincCreditPlugin))
Ejemplo n.º 24
0
def main():
    sys.exit(muninMain(MuninPgPlugin))
Ejemplo n.º 25
0
def main():
    sys.exit(muninMain(MuninPHPZopPlugin))
Ejemplo n.º 26
0
def main():
    sys.exit(muninMain(MuninMySQLplugin))
Ejemplo n.º 27
0
def main():
    sys.exit(muninMain(MuninSupervisordProcessStatsPlugin))
Ejemplo n.º 28
0
def main():
    sys.exit(muninMain(MuninPiHolePlugin))
Ejemplo n.º 29
0
def main():
    sys.exit(muninMain(MuninNTPstatsPlugin))
Ejemplo n.º 30
0
def main():
    sys.exit(muninMain(MuninPHPapcPlugin))
Ejemplo n.º 31
0
def main():
    sys.exit(muninMain(MuninProcStatsPlugin))
Ejemplo n.º 32
0
                           '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)

    def retrieveVals(self):
        """Retrieve values for graphs."""
        apacheInfo = ApacheInfo(self._host, self._port, self._user,
                                self._password, self._statuspath, self._ssl)
        stats = apacheInfo.getServerStats()
        if self.hasGraph('apache_access'):
            self.setGraphVal('apache_access', 'reqs', stats['Total Accesses'])
        if self.hasGraph('apache_bytes'):
            self.setGraphVal('apache_bytes', 'bytes',
                             stats['Total kBytes'] * 1000)
        if self.hasGraph('apache_workers'):
            self.setGraphVal('apache_workers', 'busy', stats['BusyWorkers'])
            self.setGraphVal('apache_workers', 'idle', stats['IdleWorkers'])
            self.setGraphVal('apache_workers', 'max', stats['MaxWorkers'])


if __name__ == "__main__":
    sys.exit(muninMain(MuninApachePlugin))
Ejemplo n.º 33
0
def main():
    sys.exit(muninMain(MuninFritzPlugin, debug=True))
Ejemplo n.º 34
0
def main():
    sys.exit(muninMain(MuninNetIfacePlugin))
Ejemplo n.º 35
0
def main():
    sys.exit(muninMain(MuninProcStatsPlugin))
Ejemplo n.º 36
0
def main():
    sys.exit(muninMain(MuninSysStatsPlugin))
Ejemplo n.º 37
0
def main():
    sys.exit(muninMain(MuninRackspacePlugin))
Ejemplo n.º 38
0
                                 stats['connections'])
            if self.hasGraph('nginx_connections'):
                self.setGraphVal('nginx_connections', 'handled',
                                 stats['handled'])
                self.setGraphVal('nginx_connections', 'nothandled',
                                 stats['accepts'] - stats['handled'])
            if self.hasGraph('nginx_requests'):
                self.setGraphVal('nginx_requests', 'requests',
                                 stats['requests'])
            if self.hasGraph('nginx_requestsperconn'):
                curr_stats = (stats['handled'], stats['requests'])
                hist_stats = self.restoreState()
                if hist_stats:
                    prev_stats = hist_stats[0]
                else:
                    hist_stats = []
                    prev_stats = (0, 0)
                conns = max(curr_stats[0] - prev_stats[0], 0)
                reqs = max(curr_stats[1] - prev_stats[1], 0)
                if conns > 0:
                    self.setGraphVal('nginx_requestsperconn', 'requests',
                                     float(reqs) / float(conns))
                else:
                    self.setGraphVal('nginx_requestsperconn', 'requests', 0)
                hist_stats.append(curr_stats)
                self.saveState(hist_stats[-self._numSamples:])


if __name__ == "__main__":
    sys.exit(muninMain(MuninNginxPlugin))
Ejemplo n.º 39
0
                               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)

    def retrieveVals(self):
        """Retrieve values for graphs."""
        fs = FSinfo(self._fshost, self._fsport, self._fspass)
        if self.hasGraph('fs_calls'):
            count = fs.getCallCount()
            self.setGraphVal('fs_calls', 'calls', count)
        if self.hasGraph('fs_channels'):
            count = fs.getChannelCount()
            self.setGraphVal('fs_channels', 'channels', count)


if __name__ == "__main__":
    sys.exit(muninMain(MuninFreeswitchPlugin))
Ejemplo n.º 40
0
def main():
    sys.exit(muninMain(MuninVarnishPlugin))
Ejemplo n.º 41
0
                stats = self._dbconn.getBgWriterStats()
            self.setGraphVal('pg_checkpoints', 'req', 
                             stats.get('checkpoints_req'))
            self.setGraphVal('pg_checkpoints', 'timed', 
                             stats.get('checkpoints_timed'))
        if self.hasGraph('pg_bgwriter'):
            if stats is None:
                stats = self._dbconn.getBgWriterStats()
            self.setGraphVal('pg_bgwriter', 'backend', 
                             stats.get('buffers_backend'))
            self.setGraphVal('pg_bgwriter', 'clean', 
                             stats.get('buffers_clean'))
            self.setGraphVal('pg_bgwriter', 'chkpoint', 
                             stats.get('buffers_checkpoint'))
            
    
    def dbIncluded(self, name):
        """Utility method to check if database is included in graphs.
        
        @param name: Name of database.
        @return:     Returns True if included in graphs, False otherwise.
            
        """
        return self.envCheckFilter('db', name)
              


if __name__ == "__main__":
    sys.exit(muninMain(MuninPgPlugin))

Ejemplo n.º 42
0
def main():
    sys.exit(muninMain(MuninNTPhostOffsetPlugin))
Ejemplo n.º 43
0
def main():
    sys.exit(muninMain(MuninRackspacePlugin))
Ejemplo n.º 44
0
def main():
    sys.exit(muninMain(MuninNTPhostOffsetPlugin))
Ejemplo n.º 45
0
                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)

    def retrieveVals(self):
        """Retrive values for graphs."""
        ntpinfo = NTPinfo()
        ntpstats = ntpinfo.getHostOffsets(self._remoteHosts)
        if ntpstats:
            for host in self._remoteHosts:
                hostkey = re.sub('\.', '_', host)
                hoststats = ntpstats.get(host)
                if hoststats:
                    if self.hasGraph('ntp_host_stratums'):
                        self.setGraphVal('ntp_host_stratums', hostkey, 
                                         hoststats.get('stratum'))
                    if self.hasGraph('ntp_host_offsets'):
                        self.setGraphVal('ntp_host_offsets', hostkey, 
                                         hoststats.get('offset'))
                    if self.hasGraph('ntp_host_delays'):
                        self.setGraphVal('ntp_host_delays', hostkey, 
                                         hoststats.get('delay'))


if __name__ == "__main__":
    sys.exit(muninMain(MuninNTPhostOffsetsPlugin))
Ejemplo n.º 46
0
def main():
    sys.exit(muninMain(MuninMemcachedPlugin))
Ejemplo n.º 47
0
def main():
    sys.exit(muninMain(MuninSysStatsPlugin))
Ejemplo n.º 48
0
def main():
    sys.exit(muninMain(MuninPgPlugin))
Ejemplo n.º 49
0
                if self.dbIncluded(db):
                    if self.hasGraph('pg_blockread_detail'):
                        self.setGraphVal('pg_blockread_detail', db, 
                            dbstats['blks_hit'] + dbstats['blks_read'])
                    for (graph_name, attr_name) in (
                            ('pg_xact_commit_detail', 'xact_commit'),
                            ('pg_xact_rollback_detail', 'xact_rollback'),
                            ('pg_tup_return_detail', 'tup_returned'),
                            ('pg_tup_fetch_detail', 'tup_fetched'),
                            ('pg_tup_delete_detail', 'tup_deleted'),
                            ('pg_tup_update_detail', 'tup_updated'),
                            ('pg_tup_insert_detail', 'tup_inserted'),
                        ):
                        if self.hasGraph(graph_name):
                            self.setGraphVal(graph_name, db, dbstats[attr_name])
    
    def dbIncluded(self, name):
        """Utility method to check if database is included in graphs.
        
        @param name: Name of database.
        @return:     Returns True if included in graphs, False otherwise.
            
        """
        return self.envCheckFilter('db', name)
              


if __name__ == "__main__":
    sys.exit(muninMain(MuninPgPlugin))

Ejemplo n.º 50
0
def main():
    sys.exit(muninMain(MuninNginxPlugin))
Ejemplo n.º 51
0
                    self.setGraphVal(name, 'max', thrstats['maxThreads'])
                name = "tomcat_access_%d" % port
                if self.hasGraph(name):
                    self.setGraphVal(name, 'reqs', reqstats['requestCount'])
                name = "tomcat_error_%d" % port
                if self.hasGraph(name):
                    self.setGraphVal(name, 'errors', reqstats['errorCount'])
                name = "tomcat_traffic_%d" % port
                if self.hasGraph(name):
                    self.setGraphVal(name, 'rx', reqstats['bytesReceived'])
                    self.setGraphVal(name, 'tx', reqstats['bytesSent'])
#                name = "tomcat_cputime_%d" % port
#                if self.hasGraph(name):
#                    self.setGraphVal(name, 'cpu', 
#                                     int(reqstats['processingTime'] * 1000))
    
    def portIncluded(self, port):
        """Utility method to check if connector port is included in monitoring.
        
        @param port: Port number.
        @return:     Returns True if included in graphs, False otherwise.
            
        """
        return self.envCheckFilter('ports', str(port))



if __name__ == "__main__":
    sys.exit(muninMain(MuninTomcatPlugin))

Ejemplo n.º 52
0
def main():
    sys.exit(muninMain(MuninVarnishPlugin))
Ejemplo n.º 53
0
def main():
    sys.exit(muninMain(RedisPlugin))
Ejemplo n.º 54
0
                                "txdrop",
                                "rxfifo",
                                "txfifo",
                            ):
                                self.setGraphVal(graph_name, field, stats.get(field))
                if self.graphEnabled("wanpipe_pri_errors") or self.graphEnabled("wanpipe_rxlevel"):
                    try:
                        stats = self._wanpipeInfo.getPRIstats(iface)
                    except:
                        stats = None
                    if stats:
                        graph_name = "wanpipe_pri_errors_%s" % iface
                        if self.hasGraph(graph_name):
                            for field in ("linecodeviolation", "farendblockerrors", "crc4errors", "faserrors"):
                                self.setGraphVal(graph_name, field, stats.get(field))
                        if self.hasGraph("wanpipe_rxlevel"):
                            self.setGraphVal("wanpipe_pri_rxlevel", iface, stats.get("rxlevel"))

    def ifaceIncluded(self, iface):
        """Utility method to check if interface is included in monitoring.
        
        @param iface: Interface name.
        @return:      Returns True if included in graphs, False otherwise.
            
        """
        return self.envCheckFilter("ifaces", iface)


if __name__ == "__main__":
    sys.exit(muninMain(MuninWanpipePlugin))
Ejemplo n.º 55
0
        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)

    def retrieveVals(self):
        """Retrieve values for graphs."""
        ntpinfo = NTPinfo()
        stats = ntpinfo.getPeerStats()
        if stats:
            if self.hasGraph('ntp_peer_stratum'):
                self.setGraphVal('ntp_peer_stratum', 'stratum', 
                                 stats.get('stratum'))
            if self.hasGraph('ntp_peer_stats'):
                self.setGraphVal('ntp_peer_stats', 'offset', 
                                 stats.get('offset'))
                self.setGraphVal('ntp_peer_stats', 'delay', 
                                 stats.get('delay'))
                self.setGraphVal('ntp_peer_stats', 'jitter', 
                                 stats.get('jitter'))


if __name__ == "__main__":
    sys.exit(muninMain(MuninNTPstatsPlugin))
Ejemplo n.º 56
0
                "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)

    def retrieveVals(self):
        """Retrieve values for graphs."""
        fs = FSinfo(self._fshost, self._fsport, self._fspass)
        if self.hasGraph("fs_calls"):
            count = fs.getCallCount()
            self.setGraphVal("fs_calls", "calls", count)
        if self.hasGraph("fs_channels"):
            count = fs.getChannelCount()
            self.setGraphVal("fs_channels", "channels", count)


if __name__ == "__main__":
    sys.exit(muninMain(MuninFreeswitchPlugin))
Ejemplo n.º 57
0
            self.setGraphVal('mysql_tablelocks', 'immediate',
                             self._genStats.get('Table_locks_immediate'))
        if self.hasGraph('mysql_threads'):
            if self._genStats is None:
                self._genStats = self._dbconn.getStats()
            self.setGraphVal('mysql_threads', 'running',
                             self._genStats.get('Threads_running'))
            self.setGraphVal(
                'mysql_threads', 'idle',
                self._genStats.get('Threads_connected') -
                self._genStats.get('Threads_running'))
            self.setGraphVal('mysql_threads', 'cached',
                             self._genStats.get('Threads_cached'))
            self.setGraphVal(
                'mysql_threads', 'total',
                self._genStats.get('Threads_connected') +
                self._genStats.get('Threads_cached'))

    def engineIncluded(self, name):
        """Utility method to check if a storage engine is included in graphs.
        
        @param name: Name of storage engine.
        @return:     Returns True if included in graphs, False otherwise.
            
        """
        return self.envCheckFilter('engine', name)


if __name__ == "__main__":
    sys.exit(muninMain(MuninMySQLplugin))
Ejemplo n.º 58
0
def main():
    sys.exit(muninMain(MuninPHPapcPlugin))
Ejemplo n.º 59
0
def main():
    sys.exit(muninMain(MuninFritzPlugin, debug=True))