예제 #1
0
    "database_username",
    "Username which the agent uses to connect to PostgreSQL to retrieve monitoring data.",
    convert_to=str,
)
define_config_option(
    __monitor__,
    "database_password",
    "Password for connecting to PostgreSQL.",
    convert_to=str,
)

# Metric definitions.
define_metric(
    __monitor__,
    "postgres.database.connections",
    "The number of current active connections.  The value is accurate to when the check was made.",
    cumulative=False,
    category="connections",
)
define_metric(
    __monitor__,
    "postgres.database.transactions",
    "The number of database transactions that have been committed.  "
    "The value is relative to postgres.database.stats_reset.",
    extra_fields={"result": "committed"},
    cumulative=True,
    category="general",
)
define_metric(
    __monitor__,
    "postgres.database.transactions",
예제 #2
0
define_config_option(__monitor__, 'status_url',
                     'Optional.  Specifies the URL -- in particular, the port number -- at which the Apache status '
                     'module is served.  The URL should end in ``/?auto`` to indicate the machine-readable version of '
                     'the page should be returned.', default='http://localhost/server-status/?auto')
define_config_option(__monitor__, 'source_address',
                     'Optional (defaults to \'%s\'). The IP address to be used as the source address when fetching '
                     'the status URL.  Many servers require this to be 127.0.0.1 because they only server the status '
                     'page to requests from localhost.' % httpSourceAddress, default=httpSourceAddress)

define_log_field(__monitor__, 'monitor', 'Always ``apache_monitor``.')
define_log_field(__monitor__, 'metric', 'The metric name.  See the metric tables for more information.')
define_log_field(__monitor__, 'value', 'The value of the metric.')
define_log_field(__monitor__, 'instance', 'The ``id`` value from the monitor configuration.')

define_metric(__monitor__, 'apache.connections.active', 'The number of connections that are being handled '
                                                        'asynchronously (not using  workers) currently open on the '
                                                        'server')
define_metric(__monitor__, 'apache.connections.writing', 'The number of connections that are being handled '
                                                         'asynchronously (not using workers) that are currently '
                                                         'writing response data.')
define_metric(__monitor__, 'apache.connections.idle', 'The number of connections that are being handled '
                                                      'asynchronously (not using workers) that are currently '
                                                      'idle / sending keepalives.')
define_metric(__monitor__, 'apache.connections.closing', 'The number of connections that are being handled '
                                                         'asynchronously (not using workers) that are currently '
                                                         'closing.')
define_metric(__monitor__, 'apache.workers.active', 'How many workers are currently active.  Each worker is a process '
                                                    'handling an incoming request.')
define_metric(__monitor__, 'apache.workers.idle', 'How many of the workers are currently idle.  Each worker is a '
                                                  'process that can handle an incoming request.')
예제 #3
0
    default=None,
    convert_to=six.text_type,
)
define_config_option(
    __monitor__,
    "id",
    "Included in each log message generated by this monitor, as a field named ``instance``. Allows "
    "you to distinguish between values recorded by different monitors.",
    required_option=True,
    convert_to=six.text_type,
)

define_metric(
    __monitor__,
    "app.cpu",
    "User-mode CPU usage, in 1/100ths of a second.",
    extra_fields={"type": "user"},
    unit="secs:0.01",
    cumulative=True,
)

define_metric(
    __monitor__,
    "app.cpu",
    "System-mode CPU usage, in 1/100ths of a second.",
    extra_fields={"type": "system"},
    unit="secs:0.01",
    cumulative=True,
)

define_metric(
    __monitor__,
예제 #4
0
                     'Username which the agent uses to connect to MySQL to retrieve monitoring data.',
                     convert_to=str)
define_config_option(__monitor__, 'database_password',
                     'Password for connecting to MySQL.', convert_to=str)
define_config_option(__monitor__, 'database_socket',
                     'Location of the socket file for connecting to MySQL, e.g. '
                     '``/var/run/mysqld_instance2/mysqld.sock``. If MySQL is running on the same server as the Scalyr '
                     'Agent, you can usually set this to "default".', convert_to=str)
define_config_option(__monitor__, 'database_hostport',
                     'Hostname (or IP address) and port number of the MySQL server, e.g. ``dbserver:3306``, or simply '
                     '``3306`` when connecting to the local machine. You should specify one of ``database_socket`` or '
                     '``database_hostport``, but not both.', convert_to=str)

# Metric definitions.
define_metric(__monitor__, 'mysql.global.aborted_clients',
              'The number of connections aborted because the client died or didn\'t close the connection properly.  '
              'The value is relative to the uptime of the server.', cumulative=True, category='connections')
define_metric(__monitor__, 'mysql.global.aborted_connects',
              'The number of failed connection attempts.  The value is relative to the uptime of the server.',
              cumulative=True, category='connections')
define_metric(__monitor__, 'mysql.global.bytes_received',
              'How much data has been sent to the database from all clients.  The value is relative to the uptime of '
              'the server.', unit='bytes', cumulative=True, category='connections')
define_metric(__monitor__, 'mysql.global.bytes_sent',
              'How much data has been sent from the database to all clients.  The value is relative to the uptime of '
              'the server.', unit='bytes', cumulative=True, category='connections')
define_metric(__monitor__, 'mysql.global.connections',
              'Total number of connection attempts (successful and failed).  The value is relative to the uptime of '
              'the server.', cumulative=True, category='connections')
define_metric(__monitor__, 'mysql.global.max_used_connections',
              'High water mark for the total number of connections used at any one time since the server was started.',
            category        = "Disk",
            unit            = 'bytes',
            cumulative      = True,
            extra_fields    = {
                'type': 'write'
            },
        ),
        GATHER_METRIC('io_counters', 'write_bytes')
    )
    # TODO: Additional attributes for this section
    #  * ...
]
# pylint: enable=bad-whitespace

METRICS = _PROCESS_CPU_METRICS + _PROCESS_ATTRIBUTE_METRICS + _PROCESS_MEMORY_METRICS + _PROCESS_DISK_IO_METRICS
_ = [define_metric(__monitor__, **metric.config) for metric in METRICS]     # pylint: disable=star-args




#
# Logging / Reporting - defines the method and content in which the metrics are reported.
#
define_log_field(__monitor__, 'monitor', 'Always ``windows_process_metrics``.')
define_log_field(__monitor__, 'instance', 'The ``id`` value from the monitor configuration, e.g. ``iis``.')
define_log_field(__monitor__, 'app', 'Same as ``instance``; provided for compatibility with the original Scalyr Agent.')
define_log_field(__monitor__, 'metric', 'The name of a metric being measured, e.g. "winproc.cpu".')
define_log_field(__monitor__, 'value', 'The metric value.')


    define_log_field,
    define_config_option,
)
from scalyr_agent.third_party.tcollector.tcollector import ReaderThread
from scalyr_agent.json_lib import JsonObject
from scalyr_agent import StoppableThread

# In this file, we make use of the third party tcollector library.  Much of the machinery here is to
# shoehorn the tcollector code into our framework.

__monitor__ = __name__

# These are the metrics collected, broken up by tcollector controllor:
# We use the original tcollector documentation here has much as possible.
define_metric(__monitor__,
              "sys.cpu.count",
              "The number of CPUs on the system",
              category="general")

define_metric(
    __monitor__,
    "proc.stat.cpu",
    "CPU counters in units of jiffies, where ``type`` can be one of ``user``, ``nice``, ``system``,  "
    "``iowait``, ``irq``, ``softirq``, ``steal``, ``guest``.  As a rate, they should add up to  "
    "``100*numcpus`` on the host.",
    extra_fields={"type": ""},
    cumulative=True,
    category="general",
)
define_metric(
    __monitor__,
    "proc.stat.intr",
예제 #7
0
    convert_to=str,
)
define_config_option(
    __monitor__,
    "source_address",
    "Optional (defaults to '%s'). The IP address to be used as the source address when fetching "
    "the monitor URL.  Some servers require this to be 127.0.0.1 because they only server the monitor "
    "page to requests from localhost." % httpSourceAddress,
    default=httpSourceAddress,
)

# Metric definitions.
define_metric(
    __monitor__,
    "tomcat.runtime.memory_bytes",
    "The amount of memory free.",
    extra_fields={"type": "free"},
    cumulative=False,
    category="general",
)
define_metric(
    __monitor__,
    "tomcat.runtime.memory_bytes",
    "The total amount of memory available.",
    extra_fields={"type": "total"},
    cumulative=False,
    category="general",
)
define_metric(
    __monitor__,
    "tomcat.runtime.memory_bytes",
    "The maximum amount of memory free.",
예제 #8
0
    __monitor__,
    'readback_buffer_size',
    'Optional (defaults to 5k). The maximum number of bytes to read backwards from the end of any log files on disk\n'
    'when starting to log a containers stdout/stderr.  This is used to find the most recent timestamp logged to file '
    'was sent to Scalyr.',
    convert_to=int,
    default=5 * 1024)

# for now, always log timestamps to help prevent a race condition
#define_config_option( __monitor__, 'log_timestamps',
#                     'Optional (defaults to False). If true, stdout/stderr logs will contain docker timestamps at the beginning of the line\n',
#                     convert_to=bool, default=False)

define_metric(__monitor__,
              "docker.net.rx_bytes",
              "Total received bytes on the network interface",
              cumulative=True,
              unit="bytes",
              category="Network")
define_metric(__monitor__,
              "docker.net.rx_dropped",
              "Total receive packets dropped on the network interface",
              cumulative=True,
              category="Network")
define_metric(__monitor__,
              "docker.net.rx_errors",
              "Total receive errors on the network interface",
              cumulative=True,
              category="Network")
define_metric(__monitor__,
              "docker.net.rx_packets",
              "Total received packets on the network interface",
                     convert_to=str, required_option=True)
define_config_option(__monitor__, 'commandline',
                     'A regular expression which will match the command line of the process you\'re interested in, as '
                     'shown in the output of ``ps aux``. (If multiple processes match the same command line pattern, '
                     'only one will be monitored.)', default=None, convert_to=str)
define_config_option(__monitor__, 'pid',
                     'The pid of the process from which the monitor instance will collect metrics.  This is ignored '
                     'if the ``commandline`` is specified.',
                     default=None, convert_to=str)
define_config_option(__monitor__, 'id',
                     'Included in each log message generated by this monitor, as a field named ``instance``. Allows '
                     'you to distinguish between values recorded by different monitors.',
                     required_option=True, convert_to=str)

define_metric(__monitor__, 'app.cpu',
              'User-mode CPU usage, in 1/100ths of a second.',
              extra_fields={'type': 'user'}, unit='secs:0.01', cumulative=True)

define_metric(__monitor__, 'app.cpu',
              'System-mode CPU usage, in 1/100ths of a second.', extra_fields={'type': 'system'}, unit='secs:0.01',
              cumulative=True)

define_metric(__monitor__, 'app.uptime',
              'Process uptime, in milliseconds.', unit='milliseconds', cumulative=True)

define_metric(__monitor__, 'app.threads',
              'The number of threads being used by the process.')

define_metric(__monitor__, 'app.nice',
              'The nice value for the process.')
from Queue import Empty
from scalyr_agent import ScalyrMonitor, BadMonitorConfiguration, define_metric, define_log_field
from scalyr_agent.third_party.tcollector.tcollector import ReaderThread
from scalyr_agent.json_lib import JsonObject
from scalyr_agent import StoppableThread

# In this file, we make use of the third party tcollector library.  Much of the machinery here is to
# shoehorn the tcollector code into our framework.

__monitor__ = __name__

# These are the metrics collected, broken up by tcollector controllor:
# We use the original tcollector documentation here has much as possible.
define_metric(__monitor__, 'proc.stat.cpu',
              'CPU counters in units of jiffies, where ``type`` can be one of ``user``, ``nice``, ``system``,  '
              '``iowait``, ``irq``, ``softirq``, ``steal``, ``guest``.  As a rate, they should add up to  '
              '``100*numcpus`` on the host.',
              extra_fields={'type': ''}, cumulative=True, category='general')
define_metric(__monitor__, 'proc.stat.intr:',
              'The number of interrupts since boot.', cumulative=True, category='general')
define_metric(__monitor__, 'proc.stat.ctxt',
              'The number of context switches since boot.', cumulative=True, category='general')
define_metric(__monitor__, 'proc.stat.processes',
              'The number of processes created since boot.', cumulative=True, category='general')
define_metric(__monitor__, 'proc.stat.procs_blocked',
              'The number of processes currently blocked on I/O.', cumulative=True, category='general')
define_metric(__monitor__, 'proc.loadavg.1m',
              'The load average over 1 minute.', category='general')
define_metric(__monitor__, 'proc.loadavg.5m',
              'The load average over 5 minutes.', category='general')
define_metric(__monitor__, 'proc.loadavg.15m',
예제 #11
0
    'Name of database the agent will connect to PostgreSQL to retrieve monitoring data.',
    convert_to=str)
define_config_option(
    __monitor__,
    'database_username',
    'Username which the agent uses to connect to PostgreSQL to retrieve monitoring data.',
    convert_to=str)
define_config_option(__monitor__,
                     'database_password',
                     'Password for connecting to PostgreSQL.',
                     convert_to=str)

# Metric definitions.
define_metric(
    __monitor__,
    'postgres.database.connections',
    'The number of current active connections.  The value is accurate to when the check was made.',
    cumulative=False,
    category='connections')
define_metric(__monitor__,
              'postgres.database.transactions',
              'The number of database transactions that have been committed.  '
              'The value is relative to postgres.database.stats_reset.',
              extra_fields={'result': 'committed'},
              cumulative=True,
              category='general')
define_metric(
    __monitor__,
    'postgres.database.transactions',
    'The number of database transactions that have been rolled back.  '
    'The value is relative to postgres.database.stats_reset.',
    extra_fields={'result': 'rolledback'},
예제 #12
0
    __monitor__,
    'id',
    'Optional (defaults to empty string).  Included in each log message generated by this monitor, '
    'as a field named ``instance``. Allows you to distinguish between different Apache instances '
    'running on the same server.',
    convert_to=str)

define_log_field(__monitor__, 'monitor', 'Always ``apache_monitor``.')
define_log_field(
    __monitor__, 'metric',
    'The metric name.  See the metric tables for more information.')
define_log_field(__monitor__, 'value', 'The value of the metric.')
define_log_field(__monitor__, 'instance',
                 'The ``id`` value from the monitor configuration.')

define_metric(__monitor__, 'apache.connections.active',
              'The number of connections currently opened to the server.')
define_metric(__monitor__, 'apache.connections.writing',
              'The number of connections currently writing to the clients.')
define_metric(__monitor__, 'apache.connections.idle',
              'The number of connections currently idle/sending keep alives.')
define_metric(__monitor__, 'apache.connections.closing',
              'The number of connections currently closing.')
define_metric(__monitor__, 'apache.workers.active',
              'How many workers are currently active.')
define_metric(__monitor__, 'apache.workers.idle',
              'How many of the workers are currently idle.')


# Taken from:
#   http://stackoverflow.com/questions/1150332/source-interface-with-python-and-urllib2
#
예제 #13
0
    __monitor__,
    'monitor_password',
    'The pasword associated with the monitor_user required to access the monitor URL.',
    convert_to=str)
define_config_option(
    __monitor__,
    'source_address',
    'Optional (defaults to \'%s\'). The IP address to be used as the source address when fetching '
    'the monitor URL.  Some servers require this to be 127.0.0.1 because they only server the monitor '
    'page to requests from localhost.' % httpSourceAddress,
    default=httpSourceAddress)

# Metric definitions.
define_metric(__monitor__,
              'tomcat.runtime.memory_bytes',
              'The amount of memory free.',
              extra_fields={'type': 'free'},
              cumulative=False,
              category='general')
define_metric(__monitor__,
              'tomcat.runtime.memory_bytes',
              'The total amount of memory available.',
              extra_fields={'type': 'total'},
              cumulative=False,
              category='general')
define_metric(__monitor__,
              'tomcat.runtime.memory_bytes',
              'The maximum amount of memory free.',
              extra_fields={'type': 'max'},
              cumulative=False,
              category='general')
define_metric(__monitor__,
예제 #14
0
                     convert_to=str,
                     required_option=True)
define_config_option(__monitor__, 'monitor_user',
                     'The username required to access the monitor URL.',
                     convert_to=str)
define_config_option(__monitor__, 'monitor_password',
                     'The pasword associated with the monitor_user required to access the monitor URL.',
                     convert_to=str)
define_config_option(__monitor__, 'source_address',
                     'Optional (defaults to \'%s\'). The IP address to be used as the source address when fetching '
                     'the monitor URL.  Some servers require this to be 127.0.0.1 because they only server the monitor '
                     'page to requests from localhost.' % httpSourceAddress, default=httpSourceAddress)                    

# Metric definitions.
define_metric(__monitor__, 'tomcat.runtime.memory_bytes',
              'The amount of memory free.'
              , extra_fields={'type': 'free'}, cumulative=False, category='general')
define_metric(__monitor__, 'tomcat.runtime.memory_bytes',
              'The total amount of memory available.'
              , extra_fields={'type': 'total'}, cumulative=False, category='general')
define_metric(__monitor__, 'tomcat.runtime.memory_bytes',
              'The maximum amount of memory free.'
              , extra_fields={'type': 'max'}, cumulative=False, category='general')
define_metric(__monitor__, 'tomcat.runtime.threads',
              'The maximum number of threads available/configured.'
              , extra_fields={'type': 'max'}, cumulative=False, category='general')
define_metric(__monitor__, 'tomcat.runtime.threads',
              'The number of threads currently active.'
              , extra_fields={'type': 'active'}, cumulative=False, category='general')
define_metric(__monitor__, 'tomcat.runtime.threads',
              'The number of threads currently busy.'
예제 #15
0
    convert_to=str,
)
define_config_option(
    __monitor__,
    "source_address",
    "Optional (defaults to '%s'). The IP address to be used as the source address when fetching "
    "the monitor URL.  Some servers require this to be 127.0.0.1 because they only server the monitor "
    "page to requests from localhost." % httpSourceAddress,
    default=httpSourceAddress,
)

# Metric definitions.
define_metric(
    __monitor__,
    "tomcat.runtime.memory_bytes",
    "The amount of memory free.",
    extra_fields={"type": "free"},
    cumulative=False,
    category="general",
)
define_metric(
    __monitor__,
    "tomcat.runtime.memory_bytes",
    "The total amount of memory available.",
    extra_fields={"type": "total"},
    cumulative=False,
    category="general",
)
define_metric(
    __monitor__,
    "tomcat.runtime.memory_bytes",
    "The maximum amount of memory free.",
import scalyr_agent.third_party.tcollector.tcollector as tcollector
from Queue import Empty
from scalyr_agent import ScalyrMonitor, BadMonitorConfiguration, define_metric, define_log_field, define_config_option
from scalyr_agent.third_party.tcollector.tcollector import ReaderThread
from scalyr_agent.json_lib import JsonObject
from scalyr_agent import StoppableThread

# In this file, we make use of the third party tcollector library.  Much of the machinery here is to
# shoehorn the tcollector code into our framework.

__monitor__ = __name__

# These are the metrics collected, broken up by tcollector controllor:
# We use the original tcollector documentation here has much as possible.
define_metric(__monitor__,
              'cpu.count',
              'The number of CPUs on the system',
              category='general')

define_metric(
    __monitor__,
    'proc.stat.cpu',
    'CPU counters in units of jiffies, where ``type`` can be one of ``user``, ``nice``, ``system``,  '
    '``iowait``, ``irq``, ``softirq``, ``steal``, ``guest``.  As a rate, they should add up to  '
    '``100*numcpus`` on the host.',
    extra_fields={'type': ''},
    cumulative=True,
    category='general')
define_metric(__monitor__,
              'proc.stat.intr:',
              'The number of interrupts since boot.',
              cumulative=True,
예제 #17
0
    convert_to=str,
)
define_config_option(
    __monitor__,
    "database_hostport",
    "Hostname (or IP address) and port number of the MySQL server, e.g. ``dbserver:3306``, or simply "
    "``3306`` when connecting to the local machine. You should specify one of ``database_socket`` or "
    "``database_hostport``, but not both.",
    convert_to=str,
)

# Metric definitions.
define_metric(
    __monitor__,
    "mysql.global.aborted_clients",
    "The number of connections aborted because the client died or didn't close the connection properly.  "
    "The value is relative to the uptime of the server.",
    cumulative=True,
    category="connections",
)
define_metric(
    __monitor__,
    "mysql.global.aborted_connects",
    "The number of failed connection attempts.  The value is relative to the uptime of the server.",
    cumulative=True,
    category="connections",
)
define_metric(
    __monitor__,
    "mysql.global.bytes_received",
    "How much data has been sent to the database from all clients.  The value is relative to the uptime of "
    "the server.",
예제 #18
0
)

define_log_field(__monitor__, "monitor", "Always ``apache_monitor``.")
define_log_field(
    __monitor__,
    "metric",
    "The metric name.  See the metric tables for more information.",
)
define_log_field(__monitor__, "value", "The value of the metric.")
define_log_field(__monitor__, "instance",
                 "The ``id`` value from the monitor configuration.")

define_metric(
    __monitor__,
    "apache.connections.active",
    "The number of connections that are being handled "
    "asynchronously (not using  workers) currently open on the "
    "server",
)
define_metric(
    __monitor__,
    "apache.connections.writing",
    "The number of connections that are being handled "
    "asynchronously (not using workers) that are currently "
    "writing response data.",
)
define_metric(
    __monitor__,
    "apache.connections.idle",
    "The number of connections that are being handled "
    "asynchronously (not using workers) that are currently "
예제 #19
0
        ),
        GATHER_METRIC("io_counters", "write_bytes"),
    )
    # TODO: Additional attributes for this section
    #  * ...
]
# pylint: enable=bad-whitespace

METRICS = (
    _PROCESS_CPU_METRICS
    + _PROCESS_ATTRIBUTE_METRICS
    + _PROCESS_MEMORY_METRICS
    + _PROCESS_DISK_IO_METRICS
)
_ = [
    define_metric(__monitor__, **metric.config) for metric in METRICS
]  # pylint: disable=star-args


#
# Logging / Reporting - defines the method and content in which the metrics are reported.
#
define_log_field(__monitor__, "monitor", "Always ``windows_process_metrics``.")
define_log_field(
    __monitor__,
    "instance",
    "The ``id`` value from the monitor configuration, e.g. ``iis``.",
)
define_log_field(
    __monitor__,
    "app",
예제 #20
0
                     convert_to=str, required_option=True)
define_config_option(__monitor__, 'commandline',
                     'A regular expression which will match the command line of the process you\'re interested in, as '
                     'shown in the output of ``ps aux``. (If multiple processes match the same command line pattern, '
                     'only one will be monitored.)', default=None, convert_to=str)
define_config_option(__monitor__, 'pid',
                     'The pid of the process from which the monitor instance will collect metrics.  This is ignored '
                     'if the ``commandline`` is specified.',
                     default=None, convert_to=str)
define_config_option(__monitor__, 'id',
                     'Included in each log message generated by this monitor, as a field named ``instance``. Allows '
                     'you to distinguish between values recorded by different monitors.',
                     required_option=True, convert_to=str)

define_metric(__monitor__, 'app.cpu',
              'User-mode CPU usage, in 1/100ths of a second.',
              extra_fields={'type': 'user'}, unit='secs:0.01', cumulative=True)

define_metric(__monitor__, 'app.cpu',
              'System-mode CPU usage, in 1/100ths of a second.', extra_fields={'type': 'system'}, unit='secs:0.01',
              cumulative=True)

define_metric(__monitor__, 'app.uptime',
              'Process uptime, in milliseconds.', unit='milliseconds', cumulative=True)

define_metric(__monitor__, 'app.threads',
              'The number of threads being used by the process.')

define_metric(__monitor__, 'app.nice',
              'The nice value for the process.')
예제 #21
0
            unit='byte',
            cumulative=False,
            extra_fields={'partition': ''}), partion_disk_usage('total')),
    METRIC(
        METRIC_CONFIG(
            metric_name='winsys.disk.usage.free',
            description='The number of free bytes on each disk partition.',
            category='Disk',
            unit='byte',
            cumulative=False,
            extra_fields={'partition': ''}), partion_disk_usage('free')),
]
# pylint: enable=bad-whitespace

METRICS = _SYSTEM_CPU_METRICS + _UPTIME_METRICS + _VIRTUAL_MEMORY_METRICS + _PHYSICAL_MEMORY_METRICS + _NETWORK_IO_METRICS + _DISK_IO_METRICS + _DISK_USAGE_METRICS
_ = [define_metric(__monitor__, **metric.config) for metric in METRICS]  # pylint: disable=star-args

#
# Logging / Reporting - defines the method and content in which the metrics are reported.
#
define_log_field(__monitor__, 'monitor', 'Always ``windows_system_metrics``.')
define_log_field(__monitor__, 'metric',
                 'The name of a metric being measured, e.g. "winsys.cpu".')
define_log_field(__monitor__, 'value', 'The metric value.')


class SystemMonitor(ScalyrMonitor):
    """A Scalyr agent monitor that records system metrics for Windows platforms.

    This agent monitor plugin records CPU consumption, memory usage, and other metrics for the server on which
    the agent is running.
예제 #22
0
define_config_option(__monitor__, 'database_port',
                     'Name of port on the host machine the agent will connect to PostgreSQL to retrieve monitoring data.',
                     convert_to=str)
define_config_option(__monitor__, 'database_name',
                     'Name of database the agent will connect to PostgreSQL to retrieve monitoring data.',
                     convert_to=str)
define_config_option(__monitor__, 'database_username',
                     'Username which the agent uses to connect to PostgreSQL to retrieve monitoring data.',
                     convert_to=str)
define_config_option(__monitor__, 'database_password',
                     'Password for connecting to PostgreSQL.', 
                     convert_to=str)

# Metric definitions.
define_metric(__monitor__, 'postgres.database.connections',
              'The number of current active connections.  The value is accurate to when the check was made.'
              , cumulative=False, category='connections')
define_metric(__monitor__, 'postgres.database.transactions',
              'The number of database transactions that have been committed.  '
              'The value is relative to postgres.database.stats_reset.'
              , extra_fields={'result': 'committed'}, cumulative=True, category='general')
define_metric(__monitor__, 'postgres.database.transactions',
              'The number of database transactions that have been rolled back.  '
              'The value is relative to postgres.database.stats_reset.'
              , extra_fields={'result': 'rolledback'}, cumulative=True, category='general')
define_metric(__monitor__, 'postgres.database.disk_blocks',
              'The number of disk blocks read into the database.  '
              'The value is relative to postgres.database.stats_reset.'
              , extra_fields={'type': 'read'}, cumulative=True, category='general')
define_metric(__monitor__, 'postgres.database.disk_blocks',
              'The number of disk blocks read that were found in the buffer cache.  '