SimpleStats

Name

SimpleStats -- Inspect variables stored in a file

Synopsis

{ 'type' : 'SimpleStats',
  'name' : 'dbstats',
  'filename' : '/tmp/stats',
  'changefields': ['queries'],
  'levelchangefields' : ['replication_delay',],
  'levelchangelevels' : {'replication_delay':'300'},
  'uptime' : 'up_time',
  'logfields' : ['slow_queries',],
  'triggers': [{ 'level':'info'} ]
},

Description

The SimpleStats Entity reads a file of variable:value pairs and applies a set of rules to the values. An example file that this Entity reads looks like:

time_start: 2002-09-12 14:51:45
time_now: 2002-09-13 12:44:45
up_time: 78780
queries: 285043
slow_queries: 348
replication_delay: 1

The variable name and the value must be separated by a colon and a space.

Fields

name

A name identifying this Entity.

filename

The name of the file to scan for statistics.

changefields

A list of variable names whose value should change each time the Entity scans the file.

levelchangefields

A list of variable names whose value should not be greater than or equal to the value in levelchangelevels.

levelchangelevels

A dictionary that maps variable names to values the variable should not surpass. The variable names are defined by the levelchangefields field.

uptime

Defines a variable that should be treated as an uptime clock, measured in seconds. If the value is below 430 seconds during any Entity check then the Trigger will fire.

logfields

A list of variables whose values are logged to the Server's CollectedData but are not checked for abnormal values.

The changefields field may be omitted if the change check is not desired. Both levelchangefields and levelchangelevels fields may be omitted if the level check is not desired. The uptime field may be omitted if the uptime check is not desired.

Trigger

While the trigger value is not used in deciding to fire the Trigger, it must be specified and is put into the Server's CollectedData.

The Trigger fires if: