Beispiel #1
0
 def __init__(self, config, logger, **kwargs):
     """TODO: Fucntion documentation
     """
     if psutil is None:
         raise UnsupportedSystem(
             'windows_system_metrics',
             'You must install the python module "psutil" to use this module.  Typically, this'
             'can be done with the following command:'
             '  pip install psutil')
     sampling_rate = kwargs.get('sampling_rate', 30)
     super(SystemMonitor, self).__init__(config, logger, sampling_rate)
    def __init__(self, monitor_config, logger, **kw):
        """TODO: Function documentation
        """
        if psutil is None:
            raise UnsupportedSystem('windows_process_metrics',
                                    'You must install the python module "psutil" to use this module.  Typically, this'
                                    'can be done with the following command:'
                                    '  pip install psutil')

        sample_interval_secs = kw.get('sample_interval_secs', None)
        super(ProcessMonitor, self).__init__(monitor_config, logger, sample_interval_secs)
        self.__process = None
 def __init__(self, config, logger, **kwargs):
     """TODO: Fucntion documentation"""
     if psutil is None:
         raise UnsupportedSystem(
             "windows_system_metrics",
             'You must install the python module "psutil" to use this module.  Typically, this'
             "can be done with the following command:"
             "  pip install psutil",
         )
     sampling_rate = kwargs.get("sampling_interval_secs", 30)
     global_config = kwargs.get("global_config")
     super(SystemMonitor, self).__init__(config,
                                         logger,
                                         sampling_rate,
                                         global_config=global_config)
Beispiel #4
0
    UnsupportedSystem,
    define_config_option,
    define_metric,
    define_log_field,
)

import scalyr_agent.scalyr_logging as scalyr_logging
import six

global_log = scalyr_logging.getLogger(__name__)

# We must require 2.6 or greater right now because PyMySQL requires it.  We are considering
# forking PyMySQL and adding in support if there is enough customer demand.
if sys.version_info[0] < 2 or (sys.version_info[0] == 2
                               and sys.version_info[1] < 7):
    raise UnsupportedSystem("mysql_monitor", "Requires Python 2.7 or greater")

# We import pymysql from the third_party directory.  This
# relies on PYTHONPATH being set up correctly, which is done
# in both agent_main.py and config_main.py
#
# noinspection PyUnresolvedReferences,PyPackageRequirements
import pymysql

__monitor__ = __name__

define_config_option(
    __monitor__,
    "module",
    "Always ``scalyr_agent.builtin_monitors.mysql_monitor ``",
    required_option=True,
Beispiel #5
0
import re
import os
import stat
import errno

from scalyr_agent import ScalyrMonitor, UnsupportedSystem, define_config_option, define_metric, define_log_field

import scalyr_agent.scalyr_logging as scalyr_logging

global_log = scalyr_logging.getLogger(__name__)

# We must require 2.6 or greater right now because PyMySQL requires it.  We are considering
# forking PyMySQL and adding in support if there is enough customer demand.
if sys.version_info[0] < 2 or (sys.version_info[0] == 2
                               and sys.version_info[1] < 6):
    raise UnsupportedSystem('mysql_monitor', 'Requires Python 2.6 or greater.')

# We import pymysql from the third_party directory.  This
# relies on PYTHONPATH being set up correctly, which is done
# in both agent_main.py and config_main.py
#
# noinspection PyUnresolvedReferences,PyPackageRequirements
import pymysql

__monitor__ = __name__

define_config_option(__monitor__,
                     'module',
                     'Always ``scalyr_agent.builtin_monitors.mysql_monitor ``',
                     required_option=True)
define_config_option(
Beispiel #6
0
import stat
import errno
import string
from datetime import datetime

from scalyr_agent import (
    ScalyrMonitor,
    UnsupportedSystem,
    define_config_option,
    define_metric,
    define_log_field,
)

# We must require 2.5 or greater right now because pg8000 requires it.
if sys.version_info[0] < 2 or (sys.version_info[0] == 2 and sys.version_info[1] < 5):
    raise UnsupportedSystem("postgresql_monitor", "Requires Python 2.5 or greater.")

import pg8000

__monitor__ = __name__


define_config_option(
    __monitor__,
    "module",
    "Always ``scalyr_agent.builtin_monitors.postgres_monitor ``",
    required_option=True,
)
define_config_option(
    __monitor__,
    "id",
# Note, this can be run in standalone mode by:
#     python -m scalyr_agent.run_monitor scalyr_agent.builtin_monitors.mysql_monitor
import sys
import re
import os
import stat
import errno
import string
from datetime import datetime

from scalyr_agent import ScalyrMonitor, UnsupportedSystem, define_config_option, define_metric, define_log_field

# We must require 2.5 or greater right now because pg8000 requires it.
if sys.version_info[0] < 2 or (sys.version_info[0] == 2
                               and sys.version_info[1] < 5):
    raise UnsupportedSystem('postgresql_monitor',
                            'Requires Python 2.5 or greater.')

import pg8000

__monitor__ = __name__

define_config_option(
    __monitor__,
    'module',
    'Always ``scalyr_agent.builtin_monitors.postgres_monitor ``',
    required_option=True)
define_config_option(
    __monitor__,
    'id',
    'Optional. Included in each log message generated by this monitor, as a field named ``instance``. '
    'Allows you to distinguish between values recorded by different monitors. This is especially '