{ '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'} ] },
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
A name identifying this Entity.
The name of the file to scan for statistics.
A list of variable names whose value should change each time the Entity scans the file.
A list of variable names whose value should not be greater than or equal to the value in levelchangelevels.
A dictionary that maps variable names to values the variable should not surpass. The variable names are defined by the levelchangefields field.
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.
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.
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:
The value of a variable name listed in changefields does not change between two successive scans of filename.
The value of a variable name listed in levelchangefields exceeds the corresponding value listed in levelchangelevels.
If a uptime variable is specified and its value is less than 430.